Synchronize Brevo Contact Analytics with NocoDB Database - n8n Workflow

Automate syncing detailed Brevo contact engagement metrics (opens, clicks, deliveries, blacklist status) directly into your NocoDB database using this complex n8n workflow. Efficiently manage marketing data.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

This is ideal for:
CRM managers needing detailed email activity tracked in a custom, self-hosted database like NocoDB.
Data analysts who use NocoDB for centralized reporting and require complete campaign statistics for contacts.
Automation architects seeking robust n8n templates for handling complex parallel API requests and data merging.
Users who require an automated, scheduled synchronization process initiated by an n8n trigger.

Overview

Maintaining accurate and up-to-date marketing campaign data within a centralized database like NocoDB can be challenging, especially when dealing with verbose external APIs like Brevo (Sendinblue). This advanced n8n workflow solves this by providing a highly structured and efficient synchronization pipeline.

The primary value of this solution is its ability to handle complex, nested API responses (Brevo statistics often list multiple actions per campaign ID) and consolidate them into clean, structured rows suitable for NocoDB. This reliable n8n workflow starts with an n8n trigger and uses filtering to process only records that haven't been completed (done != 1), ensuring the process is fast and idempotent. It demonstrates best practices for data segmentation, merging, and custom JavaScript consolidation within the n8n node environment, making it one of the most useful n8n templates for CRM operations.

How it Works

The n8n workflow operates on a scheduled basis, starting with the Schedule Trigger n8n node.


  1. Data Retrieval: The flow first uses the Insert Emails from NocoDB n8n node to retrieve all existing contact records from the database table.

  2. Filtering: The Check if Email is Inserted Before n8n node filters the results, allowing only records where the done flag is unset, preventing repeated processing.

  3. Batch Processing: The items are split into batches (10 items per batch) using the Loop n8n node before the API call.

  4. Brevo API Call: The Get Brevo Contact Report n8n node queries the Brevo API using the contact's email address retrieved from NocoDB.

  5. Blacklist Check: An If Email Blacklisted n8n node checks the API response. If true, the contact is marked as blacklisted and done=1 in NocoDB via the parallel branch.

  6. Statistics Segmentation: If not blacklisted, the main flow splits the response using four specialized Split Out n8n node instances, isolating data for messagesSent, delivered, opened, and clicked statistics.

  7. Data Consolidation (Code): Each of the four parallel branches uses a combination of Edit Fields (Set) and custom Code n8n node scripts. The custom JavaScript code groups campaign IDs by email and converts the array of campaign IDs into a comma-separated string, cleaning the data for insertion.

  8. Merging and Cleanup: The four paths converge into the Merge n8n node, followed by the Delete Nulls custom Code n8n node, which performs a final grouping to ensure all four statistic strings belong to one single output item per contact.

  9. NocoDB Update: The final Update NocoDB n8n node writes the complete, merged statistics back to the corresponding NocoDB record and sets the done flag to '1'. This comprehensive n8n node sequence ensures successful data sync.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import: Copy the provided JSON data and paste it directly into your n8n instance using the 'Import Workflow' function.

  2. Brevo Credentials: Locate the Get Brevo Contact Report n8n node and configure your Brevo API key connection using the 'HTTP Header Auth' method. Brevo requires an API key in the api-key header (though this template uses generic authentication setup, ensure the credential linked is a valid Brevo token).

  3. NocoDB Credentials: Configure the NocoDB Token account credentials. This is needed for all three NocoDB n8n node instances (Insert Emails from NocoDB, Update NocoDB - blacklisted, and Update NocoDB).

  4. NocoDB Configuration: Review all NocoDB n8n node settings. Ensure the projectId (px9vf43y9cqtdog in the template) and the table name (mz06ar1jy2ca287 in the template) match your specific NocoDB setup.

  5. Table Structure: Verify that your NocoDB table includes fields named email, messagesSent, delivered, opened, clicked, done, and optionally blacklisted for the update operations.

  6. Activate: After configuring the API keys and database parameters, activate the n8n workflow to begin scheduled data synchronization based on the Schedule Trigger n8n trigger settings.

Node Details

This n8n workflow utilizes several key n8n node types for flow control and data transformation:

Schedule Trigger: The starting n8n trigger, configured to run the workflow automatically based on a predefined interval (set here for frequent testing/demo).
NocoDB (Insert Emails from NocoDB): Retrieves contact records from the specified NocoDB table using the 'getAll' operation. This provides the initial dataset for the n8n workflow.
HTTP Request (Get Brevo Contact Report): A crucial n8n node that communicates with the Brevo API to fetch detailed statistics for the specific email address provided by the preceding NocoDB node.
If (If Email Blacklisted): A flow control n8n node that branches the execution based on the emailBlacklisted flag returned by the Brevo API.
Split Out: Four instances of this n8n node are used to flatten specific statistical arrays (messagesSent, delivered, opened, clicked) from the complex Brevo JSON response, enabling parallel processing.
Code (Grouping Nodes): Multiple Code n8n node instances use custom JavaScript to group the output items by email and consolidate multiple campaign IDs (e.g., all opened campaign IDs) into a single, comma-separated string per email address.
Merge: Combines the four parallel statistical data streams into a single path for final processing.
NocoDB (Update NocoDB): The final n8n node that performs the database update operation, inserting the compiled statistics (messagesSent, delivered, opened, clicked) and marking the record as done=1.

Related n8n Workflows

Free

Nodes: 11 Nodes
Updated: December 26 2025
View all
Created by

With a deep understanding of marketing processes and data flows, I create solutions that streamline user engagement, campaign management, and data synchronization across multiple platforms. My goal is to help businesses reduce manual effort, improve accuracy, and accelerate their marketing initiatives through smart automation.

Featured*