![Banner image](https://user-images.githubusercontent.com/10284570/173569848-c624317f-42b1-45a6-ab09-f0ea3c247648.png)

# n8n-nodes-fireberry

This is an n8n community node for Fireberry API. It provides a node to interact with [Fireberry](https://developers.fireberry.com/) CRM system.

This node was developed by [Ido Kraicer](https://www.linkedin.com/in/ido-kraicer/)

[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.

## Table of Contents

- [Installation](#installation)
- [Operations](#operations)
- [Credentials](#credentials)
- [Examples](#examples)
- [Documentation](#documentation)
- [Resources](#resources)
- [Deployment](#deployment)
- [License](#license)

## Installation

Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.

### Local Installation

```bash
npm install n8n-nodes-fireberry
```

### Docker Installation

When using n8n in Docker, add this node to your Docker container using the following environment variable:

```
N8N_COMMUNITY_PACKAGES=n8n-nodes-fireberry
```

## Operations

The Fireberry node supports the following operations:

### Records

- **Query Records**: Search for records using Fireberry's query syntax
  - Supports both text-based queries and a visual query builder
  - Offers filtering by field values with multiple operators
  - Supports pagination with up to 500 records per page
  - Retrieves all records with automatic handling of rate limiting
- **Create Record**: Create a single record
- **Create Batch**: Create multiple records (up to 20) in one request
  - Automatically splits larger batches into API-compliant chunks
- **Update Record**: Update a single record
- **Update Batch**: Update multiple records (up to 20) in one request
  - Automatically splits larger batches into API-compliant chunks
- **Delete Record**: Delete a single record
- **Delete Batch**: Delete multiple records (up to 20) in one request
  - Automatically splits larger batches into API-compliant chunks

## Credentials

To use the Fireberry node, you need to create credentials with your Fireberry API Key:

1. Get your API Key from your Fireberry account
2. In n8n, go to **Settings** > **Credentials** > **New**
3. Select the **Fireberry API** credential type
4. Enter your API Key
5. Save the credential

## Examples

### Query Records Example

Use the visual query builder or enter a query string directly:

```
// Query all contacts with a specific email domain
(emailaddress1 start-with %@example.com)
```

### Batch Operations Format

The batch operations (create, update, delete) use specific data formats:

#### Create Batch Format

```json
{
	"data": [
		{
			"field1": "value1",
			"field2": "value2"
		},
		{
			"field1": "value3",
			"field2": "value4"
		}
	]
}
```

#### Update Batch Format

```json
{
	"data": [
		{
			"id": "record-id-1",
			"record": {
				"field1": "value1",
				"field2": "value2"
			}
		},
		{
			"id": "record-id-2",
			"record": {
				"field1": "value3",
				"field2": "value4"
			}
		}
	]
}
```

#### Delete Batch Format

```json
{
	"data": ["record-id-1", "record-id-2"]
}
```

## Documentation

For more detailed information, please check the following documentation:

- [User Guide](./docs/USER-GUIDE.md) - Step-by-step instructions for using the node, including common workflows
- [Technical Documentation](./docs/TECHNICAL.md) - Developer-focused documentation on implementation details
- [Full Documentation](./docs/README.md) - Comprehensive documentation covering all aspects of the node

## Resources

- [n8n Community Nodes Documentation](https://docs.n8n.io/integrations/community-nodes/)
- [Fireberry API Documentation](https://developers.fireberry.com/reference/)
- [GitHub Repository](https://github.com/idokraicer/n8n-nodes-fireberry)

## Deployment

To deploy this node as a community package:

1. Clone the repository
2. Install dependencies: `npm install`
3. Build the package: `npm run build`
4. Publish to npm: `npm publish`

After publishing, users can install your node using npm or the n8n interface.

## License

[MIT License](LICENSE.md)
