{
  "id": "P2LbFvC71ZGvXGZu",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Brevo Contact Manager",
  "tags": [],
  "nodes": [
    {
      "id": "552c380b-a0f0-4b0a-a526-fe72dd09ff59",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -688,
        576
      ],
      "parameters": {
        "options": {},
        "formTitle": "Brevo n8n",
        "formFields": {
          "values": [
            {
              "fieldLabel": "first_name"
            },
            {
              "fieldLabel": "last_mail"
            },
            {
              "fieldType": "email",
              "fieldLabel": "email"
            }
          ]
        }
      },
      "typeVersion": 2.5
    },
    {
      "id": "056cc79e-795d-4a2c-854c-a3862aef143f",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -688,
        400
      ],
      "parameters": {
        "path": "f6397560-5bab-40b0-af4b-5d2ee18d260c",
        "options": {}
      },
      "typeVersion": 2.1
    },
    {
      "id": "bb194f4c-4a6d-49d2-8734-849ec5955e43",
      "name": "Upsert a contact",
      "type": "n8n-nodes-base.sendInBlue",
      "position": [
        -176,
        480
      ],
      "parameters": {
        "email": "={{ $json.email }}",
        "resource": "contact",
        "operation": "upsert",
        "requestOptions": {},
        "upsertAttributes": {
          "upsertAttributesValues": [
            {
              "fieldName": "NOME",
              "fieldValue": "={{ $json.first_name }}"
            },
            {
              "fieldName": "COGNOME",
              "fieldValue": "={{ $json.last_mail }}"
            }
          ]
        }
      },
      "credentials": {
        "sendInBlueApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "138a9f9e-0787-4aee-a754-83c8ff753571",
      "name": "Welcome email",
      "type": "n8n-nodes-base.sendInBlue",
      "position": [
        288,
        480
      ],
      "parameters": {
        "operation": "sendTemplate",
        "templateId": 1,
        "receipients": "={{ $('Set contact info').item.json.email }}",
        "requestOptions": {},
        "additionalFields": {}
      },
      "credentials": {
        "sendInBlueApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0dc1fed9-9c9b-4706-bf9f-4b5de84a2e55",
      "name": "Add contact to List",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        48,
        480
      ],
      "parameters": {
        "url": "https://api.brevo.com/v3/contacts",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"email\": \"{{ $('Set contact info').item.json.email }}\",\n  \"listIds\": [\n    3\n  ],\n  \"updateEnabled\": true\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "4f22b8f3-efc8-441f-a71a-986ebda554b6",
      "name": "Set contact info",
      "type": "n8n-nodes-base.set",
      "position": [
        -400,
        480
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "fdd9ad40-8617-4e6f-b71a-dc5a314819bd",
              "name": "first_name",
              "type": "string",
              "value": "={{ $json.first_name }}"
            },
            {
              "id": "4b00ac16-c8c8-413d-8348-0d6d63799875",
              "name": "last_name",
              "type": "string",
              "value": "={{ $json.last_mail }}"
            },
            {
              "id": "7c0b548f-e34a-4958-b98b-8f99ed8693e7",
              "name": "email",
              "type": "string",
              "value": "={{ $json.email }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "96341566-b355-4da8-b72a-ad1cc4f41fa9",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -720,
        1008
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f4251b12-7811-4725-8dde-12f5f4408882",
      "name": "Get row(s) in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -464,
        1008
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "Done"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xolrgjDUEen8bP7doUzJAdLR4698xxraxCdjWkNY_r0/edit#gid=0",
          "cachedResultName": "Foglio1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1xolrgjDUEen8bP7doUzJAdLR4698xxraxCdjWkNY_r0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xolrgjDUEen8bP7doUzJAdLR4698xxraxCdjWkNY_r0/edit?usp=drivesdk",
          "cachedResultName": "Contacts List"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "50cc53bc-f1cb-4ec6-bef0-12caf4ac9026",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -256,
        1008
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "546089a7-54c0-4c38-a155-95c5df7bb7ce",
      "name": "Upsert contacts",
      "type": "n8n-nodes-base.sendInBlue",
      "position": [
        208,
        1024
      ],
      "parameters": {
        "email": "={{ $json.email }}",
        "resource": "contact",
        "operation": "upsert",
        "requestOptions": {},
        "upsertAttributes": {
          "upsertAttributesValues": [
            {
              "fieldName": "NOME",
              "fieldValue": "={{ $json.first_name }}"
            },
            {
              "fieldName": "COGNOME",
              "fieldValue": "={{ $json.last_mail }}"
            }
          ]
        }
      },
      "credentials": {
        "sendInBlueApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c2c5f5ea-a20b-4da5-bfa9-1ccef3038e1e",
      "name": "Add contacts to List",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        432,
        1024
      ],
      "parameters": {
        "url": "https://api.brevo.com/v3/contacts",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"email\": \"{{ $('Set contacts info').item.json.email }}\",\n  \"listIds\": [\n    3\n  ],\n  \"updateEnabled\": true\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "38473307-c551-4fdc-98ce-22981319f276",
      "name": "Welcome emails",
      "type": "n8n-nodes-base.sendInBlue",
      "position": [
        672,
        1024
      ],
      "parameters": {
        "operation": "sendTemplate",
        "templateId": 1,
        "receipients": "={{ $('Set contacts info').item.json.email }}",
        "requestOptions": {},
        "additionalFields": {}
      },
      "credentials": {
        "sendInBlueApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "93c2dcd3-2c37-4da7-b19d-b334307c5c51",
      "name": "Set contacts info",
      "type": "n8n-nodes-base.set",
      "position": [
        -16,
        1024
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "fdd9ad40-8617-4e6f-b71a-dc5a314819bd",
              "name": "first_name",
              "type": "string",
              "value": "={{ $json[\"First Name\"] }}"
            },
            {
              "id": "4b00ac16-c8c8-413d-8348-0d6d63799875",
              "name": "last_name",
              "type": "string",
              "value": "={{ $json[\"Last Name\"] }}"
            },
            {
              "id": "7c0b548f-e34a-4958-b98b-8f99ed8693e7",
              "name": "email",
              "type": "string",
              "value": "={{ $json.Email }}"
            },
            {
              "id": "c45f53df-3516-464e-a217-0c41ac3f8089",
              "name": "",
              "type": "string",
              "value": ""
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "9605515f-9f2b-4af7-a977-edf1a2df3838",
      "name": "Update row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        880,
        1024
      ],
      "parameters": {
        "columns": {
          "value": {
            "Done": "x",
            "row_number": "={{ $('Loop Over Items').item.json.row_number }}"
          },
          "schema": [
            {
              "id": "First Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "First Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Last Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Done",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Done",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xolrgjDUEen8bP7doUzJAdLR4698xxraxCdjWkNY_r0/edit#gid=0",
          "cachedResultName": "Foglio1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1xolrgjDUEen8bP7doUzJAdLR4698xxraxCdjWkNY_r0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xolrgjDUEen8bP7doUzJAdLR4698xxraxCdjWkNY_r0/edit?usp=drivesdk",
          "cachedResultName": "Contacts List"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "7541cb81-70cf-4c2b-9ff3-4bf9707201ba",
      "name": "Email unsbuscribed",
      "type": "n8n-nodes-base.sendInBlueTrigger",
      "position": [
        -704,
        1408
      ],
      "parameters": {
        "events": [
          "unsubscribed"
        ]
      },
      "credentials": {
        "sendInBlueApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8b400fe7-9500-465d-a558-0307d273fd15",
      "name": "Update row in sheet1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -464,
        1408
      ],
      "parameters": {
        "columns": {
          "value": {
            "Email": "={{ $json.email }}",
            "Unsubscribe": "x"
          },
          "schema": [
            {
              "id": "First Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "First Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Last Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Done",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Done",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Unsubscribe",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Unsubscribe",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Email"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xolrgjDUEen8bP7doUzJAdLR4698xxraxCdjWkNY_r0/edit#gid=0",
          "cachedResultName": "Foglio1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1xolrgjDUEen8bP7doUzJAdLR4698xxraxCdjWkNY_r0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xolrgjDUEen8bP7doUzJAdLR4698xxraxCdjWkNY_r0/edit?usp=drivesdk",
          "cachedResultName": "Contacts List"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "06653e70-d878-44f5-841c-47988ca196c9",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        -64
      ],
      "parameters": {
        "width": 1904,
        "height": 272,
        "content": "## Brevo Contact Manager: Import, Add to List, Send Email and Track Unsubscribes \n\nThis workflow automates the process of **collecting contacts**, storing them in **Brevo**, and sending a welcome email, while also supporting bulk import from Google Sheets and unsubscribe tracking.\n\n### How it works\n\nThis workflow automates contact intake, syncing, and email onboarding across three paths: real-time form or webhook submissions, manual batch imports from Google Sheets, and Brevo unsubscribe events. For new or existing leads, it upserts contact data in Brevo, assigns the contact to a list, sends a welcome email, and writes status updates back to Google Sheets so processing, deduplication, and unsubscribe tracking stay aligned.\n\n### Setup steps\n\nAdd Brevo credentials in n8n using both the SendInBlue API and HTTP Header Auth with the same API key, then configure Google Sheets OAuth2 access for the target spreadsheet. Make sure the sheet contains the expected columns, set the correct Brevo template ID and list ID, verify the form/webhook fields and endpoint, then activate the workflow for live events or run it manually to process bulk imports from Google Sheets.\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "da6df3ef-1dcd-4d48-be89-93ef165ea267",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        256
      ],
      "parameters": {
        "color": 7,
        "width": 1904,
        "height": 528,
        "content": "## 1. Form submission or webhook trigger\n\nRegister and Create an API key in [Brevo for FREE](https://get.brevo.com/ntbswjrcxch3-5bwioc).\n\nWhen a user submits a form or hits a webhook, their contact info (first name, last name, email) is upserted into Brevo, added to a specific list, and a welcome email is sent."
      },
      "typeVersion": 1
    },
    {
      "id": "f7bd48d5-b394-44fe-a9d6-8b00fe4bd30f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        832
      ],
      "parameters": {
        "color": 7,
        "width": 1904,
        "height": 416,
        "content": "## 2. Batch import from Google Sheets\n\n[Clone this Sheet](https://docs.google.com/spreadsheets/d/1xolrgjDUEen8bP7doUzJAdLR4698xxraxCdjWkNY_r0/edit?usp=sharing).\n\nWhen manually executed, the workflow reads rows from a Google Sheet, loops through each row, upserts the contact into Brevo, adds them to a list, sends a welcome email, and marks the row as done in the sheet."
      },
      "typeVersion": 1
    },
    {
      "id": "ab51b5b0-09fc-406a-804f-1fabf3437ca0",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        1280
      ],
      "parameters": {
        "color": 7,
        "width": 1904,
        "height": 304,
        "content": "## 3. Unsubscribe tracking\n\nWhen Brevo detects an unsubscribe event, the workflow updates the corresponding row in Google Sheets to mark the contact as unsubscribed."
      },
      "typeVersion": 1
    },
    {
      "id": "63fa9ed0-7f48-4271-8740-78ebc81890a8",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1536,
        -64
      ],
      "parameters": {
        "color": 7,
        "width": 736,
        "height": 736,
        "content": "## MY NEW YOUTUBE CHANNEL\n\ud83d\udc49 [Subscribe to my new **YouTube channel**](https://youtube.com/@n3witalia). Here I\u2019ll share videos and Shorts with practical tutorials and **FREE templates for n8n**.\n\n[![image](https://n3wstorage.b-cdn.net/n3witalia/youtube-n8n-cover.jpg)](https://youtube.com/@n3witalia)"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "d741a385-4bdc-4469-bb79-1b56677c6334",
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Set contact info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Welcome emails": {
      "main": [
        [
          {
            "node": "Update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Set contacts info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upsert contacts": {
      "main": [
        [
          {
            "node": "Add contacts to List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set contact info": {
      "main": [
        [
          {
            "node": "Upsert a contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upsert a contact": {
      "main": [
        [
          {
            "node": "Add contact to List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set contacts info": {
      "main": [
        [
          {
            "node": "Upsert contacts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email unsbuscribed": {
      "main": [
        [
          {
            "node": "Update row in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Set contact info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add contact to List": {
      "main": [
        [
          {
            "node": "Welcome email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add contacts to List": {
      "main": [
        [
          {
            "node": "Welcome emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}