fberry-test

Package Information

Released: 6/8/2025
Downloads: 16 weekly / 410 monthly
Latest Version: 0.1.5
Author: idokraicer

Documentation

n8n-nodes-fireberry

This is an n8n community node for interacting with Fireberry CRM. It provides functionality to perform operations on Fireberry custom objects.

Installation

Automatic Installation

Follow these steps to install this node:

  1. Open your n8n instance
  2. Go to Settings > Community Nodes
  3. Click on "Install a Community Node"
  4. Enter n8n-nodes-fireberry and click "Install"
  5. Restart your n8n instance

Docker Installation

If you're using Docker to run n8n, you can use volume mapping to install the node:

services:
  n8n:
    image: n8nio/n8n
    environment:
      - N8N_CUSTOM_EXTENSIONS=/home/node/.n8n/custom/fireberry
    volumes:
      - n8n_data:/home/node/.n8n
      - ../n8n-nodes-fireberry/dist:/home/node/.n8n/custom/fireberry

With this setup, you just need to build the node and restart the n8n container.

Development & Testing

Setup for Development

  1. Clone the repository
  2. Install dependencies: npm install
  3. Build the code: npm run build

Dependency Handling

This node requires n8n core dependencies (n8n-workflow and n8n-core). In a custom node installation, these dependencies are provided by the n8n environment rather than being bundled with the node. Our build process handles this by:

  1. Declaring these dependencies in package.json
  2. Using the prepareForN8n.js script to add dynamic module resolution that works in both development and production environments

The script wraps module imports in try-catch blocks to ensure that:

  • In n8n's production environment, it loads the modules from n8n's installation
  • In development, it falls back to the local node_modules

This ensures that when the node is loaded in n8n, it can properly resolve dependencies without conflicts.

Automated Deployment

This repository includes a deployment script that automates the process of updating and deploying the node:

  1. deploy.sh - Updates code from git, builds the node, and restarts the n8n container
#!/bin/bash
set -e

# Update and build the node
cd ~/n8n-nodes-Fireberry
git reset --hard origin/main
git pull origin main
npm install
npm run build

# Restart n8n
cd ~/n8n-docker
docker compose down
docker compose up -d

Verification

To verify that the node is installed correctly in your n8n container, you can use the included verification script:

docker cp verify-n8n-node.js n8n-docker-n8n-1:/tmp/
docker exec -it n8n-docker-n8n-1 node /tmp/verify-n8n-node.js

This will check if the files are in the right locations and can be loaded correctly.

Running Tests

This package includes two test scripts:

  1. Test the direct API integration:

    npm run test:api
    
  2. Test the n8n node implementation:

    npm run test
    

Both tests perform a complete CRUD (Create, Read, Update, Delete) operation cycle to validate functionality.

Note: Before running tests, update the API key in the test files.

Node Usage

Authentication

This node authenticates with Fireberry using an API key. You need to:

  1. Obtain a Fireberry API key from your Fireberry account
  2. Create a credential of type "Fireberry API" in n8n
  3. Enter your API key in the "API Key" field

Supported Operations

This node allows you to interact with custom objects in Fireberry:

Query

Search for records in a custom object with various filtering conditions.

  • Fields:
    • Object Type: The number or name of the object (e.g., "1" for Contacts)
    • Fields to Retrieve: Use "*" for all fields or specify comma-separated field names
    • Conditions: Add multiple conditions to filter your query
    • Limit: Maximum number of records to return
    • Sort By: Field to sort by
    • Sort Order: Ascending or Descending
  • API Endpoint: POST /api/query

Create

Create a single record in a custom object.

  • Fields:
    • Object Type: The number or name of the object
    • Record Data: Fields and values for the new record
  • API Endpoint: POST /api/v3/record/{objectType}/batch/create
  • Request Format: { "data": [{ "field1": "value1", "field2": "value2" }] }

Update

Update an existing record in a custom object.

  • Fields:
    • Object Type: The number or name of the object
    • Record ID: The unique identifier of the record to update
    • Record Data: Fields and values to update
  • API Endpoint: POST /api/v3/record/{objectType}/batch/update
  • Request Format: { "data": [{ "id": "recordId", "field1": "value1", "field2": "value2" }] }

Delete

Delete a record from a custom object.

  • Fields:
    • Object Type: The number or name of the object
    • Record ID: The unique identifier of the record to delete
  • API Endpoint: POST /api/v3/record/{objectType}/batch/delete
  • Request Format: { "data": [{ "id": "recordId" }] }

Batch Operations

The node also supports batch operations for creating, updating, and deleting multiple records in a single request:

  • Batch Create: Create multiple records at once
  • Batch Update: Update multiple records at once
  • Batch Delete: Delete multiple records at once

For batch operations, you'll need to provide the data in JSON format following the same structure as the individual operations, but with multiple records in the data array.

API Reference

The Fireberry API documentation can be found at https://developers.fireberry.com/reference. This node implements the following endpoints:

  • Query: POST /api/query
  • Create: POST /api/v3/record/{objectType}/batch/create
  • Update: POST /api/v3/record/{objectType}/batch/update
  • Delete: POST /api/v3/record/{objectType}/batch/delete

Query Syntax

The Query operation uses Fireberry's query language:

  • No quotes around field names or values
  • Example: ((email = [email protected]) AND (firstname start-with John))
  • Supported operators:
    • =, !=, <, >, <=, >=
    • start-with, not-start-with
    • is-null, is-not-null
  • Related fields supported using underscore: accountid_telephone1 = 0541234567

Example Usage

Query Contacts

  1. Create a new workflow
  2. Add a "Fireberry" node
  3. Select Resource: "Custom Object"
  4. Select Operation: "Query"
  5. Enter Object Type: "1" (for Contacts)
  6. Enter Fields to Retrieve: "*"
  7. Add condition:
  8. Set Limit: 10
  9. Set Sort By: "createdon"
  10. Set Sort Order: "Descending"

Create Contact

  1. Create a new workflow
  2. Add a "Fireberry" node
  3. Select Resource: "Custom Object"
  4. Select Operation: "Create"
  5. Enter Object Type: "1" (for Contacts)
  6. Add Record Data:
    • Field Name: "firstname"
    • Field Value: "John"
    • Field Name: "lastname"
    • Field Value: "Doe"
    • Field Name: "email"
    • Field Value: "[email protected]"

License

MIT

Discussion