{
  "name": "Automate email marketing campaigns with NocoDB & Brevo",
  "nodes": [
    {
      "id": "56476cf7-b1d2-43d7-9b68-80dcc9d580e0",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2240,
        620
      ]
    },
    {
      "id": "06ba0ef4-7b4a-4251-b370-320e71d02037",
      "name": "Setup Flow",
      "type": "n8n-nodes-base.set",
      "position": [
        -2000,
        620
      ]
    },
    {
      "id": "fb8730fc-f2c0-4426-9781-d865ec0c773b",
      "name": "Map Data",
      "type": "n8n-nodes-base.set",
      "position": [
        -2180,
        920
      ]
    },
    {
      "id": "5515a0dc-6ef7-4325-a48c-067663d9d531",
      "name": "Filter Template",
      "type": "n8n-nodes-base.filter",
      "position": [
        -1600,
        620
      ]
    },
    {
      "id": "d79c4618-ea24-4140-b797-88e81ee810dc",
      "name": "IF Template Parameters OK",
      "type": "n8n-nodes-base.if",
      "position": [
        -1380,
        620
      ]
    },
    {
      "id": "06ee76ce-47aa-4cdc-9d24-6440d7da2508",
      "name": "IF user_id is not empty",
      "type": "n8n-nodes-base.if",
      "position": [
        -940,
        700
      ]
    },
    {
      "id": "28db049c-fb73-4379-bc14-05660e3902dc",
      "name": "Change Status to Sending",
      "type": "n8n-nodes-base.nocoDb",
      "position": [
        -1140,
        1120
      ]
    },
    {
      "id": "345014cf-1bfa-43aa-8649-6a7068926183",
      "name": "Get all flow templates from NocoDB",
      "type": "n8n-nodes-base.nocoDb",
      "position": [
        -1800,
        620
      ]
    },
    {
      "id": "758693db-b596-4592-9e28-61dd85c823a1",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        -1780,
        1020
      ]
    },
    {
      "id": "d88b03fc-58c6-4b75-9b98-5ee5dae89b22",
      "name": "Remove Duplicates",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        -1360,
        1120
      ]
    },
    {
      "id": "4d661409-9944-4df1-9cb3-9f49e1fa063f",
      "name": "Add records By Status Processing",
      "type": "n8n-nodes-base.nocoDb",
      "position": [
        -1980,
        920
      ]
    },
    {
      "id": "8bca3194-be35-462e-a25f-45b01a1f69bd",
      "name": "Insert Data By Status Processing",
      "type": "n8n-nodes-base.nocoDb",
      "position": [
        -1600,
        1020
      ]
    },
    {
      "id": "71e1bc5d-c96a-441f-b71d-d875b4665737",
      "name": "IF Type Email",
      "type": "n8n-nodes-base.if",
      "position": [
        -1860,
        1660
      ]
    },
    {
      "id": "429a0c25-6687-486e-9355-c950a98f29a6",
      "name": "Brevo Send Email",
      "type": "n8n-nodes-base.sendInBlue",
      "position": [
        -1120,
        1400
      ]
    },
    {
      "id": "ca39dc6c-0cdf-450b-95cd-6d28f1b21490",
      "name": "Update Data",
      "type": "n8n-nodes-base.nocoDb",
      "position": [
        -920,
        1400
      ]
    },
    {
      "id": "9b9d7339-622f-4f35-9482-ef672b99bcb2",
      "name": "Status-no-email",
      "type": "n8n-nodes-base.nocoDb",
      "position": [
        -1400,
        1720
      ]
    },
    {
      "id": "6e107d84-c06d-496d-a67f-089c942d96a6",
      "name": "Schedule Trigger1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2260,
        1660
      ]
    },
    {
      "id": "2fc8d6dd-29f0-47ef-81ac-f3c7c8c49a56",
      "name": "Insert Data By Status Sending",
      "type": "n8n-nodes-base.nocoDb",
      "position": [
        -2060,
        1660
      ]
    },
    {
      "id": "799746be-1a81-4ff9-93a0-7db87ae22215",
      "name": "Status-disposal-email",
      "type": "n8n-nodes-base.nocoDb",
      "position": [
        -1120,
        1620
      ]
    },
    {
      "id": "07d0a337-00fb-41c6-a4a3-23e593a744d9",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3800,
        380
      ],
      "parameters": {
        "width": 720,
        "height": 1000,
        "content": "# Description\n\n## ✅ Workflow Overview Summary (Based on Your Description)\n\n### 🔁 **Flow 1: \"Insert user_id\"**\n\n- Triggered manually or on schedule.\n    \n- You **choose a flow** via `Setup Flow` node b"
      }
    },
    {
      "id": "76c26fff-c938-49c4-81ea-983fa1951f77",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -660,
        540
      ],
      "parameters": {
        "width": 620,
        "height": 460,
        "content": "## n8n-transaction-ecrm\n[\n  {\n    \"id\": 1,\n    \"user_id\": \"u123\",\n    \"phone_number\": \"09120000000\",\n    \"email\": \"john@example.com\",\n    \"first_name\": \"John\",\n    \"flow_id\": \"1\",\n    \"flow_name\": \"re"
      }
    },
    {
      "id": "3e77a4a6-b4a8-4087-b57c-1346c1281513",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -660,
        1040
      ],
      "parameters": {
        "width": 620,
        "height": 280,
        "content": "## n8n-templates-ecrm\n[\n  {\n    \"Id\": 1,\n    \"flow_name\": \"register2verify-1day-ago\",\n    \"journey_name\": \"register2verify\",\n    \"question_id\": \"7002\",\n    \"type\": \"email\",\n    \"type_template_id\": 201"
      }
    },
    {
      "id": "fc561bb6-bdc7-4ad3-9bda-f548eb8aa29f",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -660,
        1360
      ],
      "parameters": {
        "width": 620,
        "height": 320,
        "content": "## n8n-templates-ecrm\n[\n  {\n    \"user_id\": \"u123\",\n    \"phone_number\": \"09120000000\",\n    \"email\": \"john@example.com\",\n    \"first_name\": \"John\"\n  },\n  {\n    \"user_id\": \"u124\",\n    \"phone_number\": \"091"
      }
    },
    {
      "id": "a40743bd-6fb0-4fdb-8381-226c9f9518d5",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -660,
        440
      ],
      "parameters": {
        "width": 460,
        "height": 80,
        "content": "# Example of Databases📋\n"
      }
    },
    {
      "id": "4d24e31c-196a-437e-bb9a-d3dc0b842439",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3060,
        380
      ],
      "parameters": {
        "width": 720,
        "height": 1600,
        "content": "# Every Node Description\n\n### Setup Flow:\nThis node selects which flow (campaign/journey) to run by setting the flow_id.\nYou can change the flow_id here to control which flow from the n8n-templates ta"
      }
    },
    {
      "id": "2997ce01-33dc-4f1f-a4a7-fe23e42dcbd2",
      "name": "Get user_id from dcp",
      "type": "n8n-nodes-base.nocoDb",
      "position": [
        -1140,
        680
      ]
    },
    {
      "id": "187c2a84-04f6-4c70-9126-2208c253d4f4",
      "name": "If email is not empty",
      "type": "n8n-nodes-base.if",
      "position": [
        -1600,
        1580
      ]
    },
    {
      "id": "3e84e316-51a3-4b33-a98d-7783ab27c4f0",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2220,
        400
      ],
      "parameters": {
        "width": 340,
        "height": 80,
        "content": "# 📝 Insert user_id"
      }
    },
    {
      "id": "e5235b08-960c-464b-8357-34b16db89604",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2240,
        1260
      ],
      "parameters": {
        "width": 340,
        "height": 80,
        "content": "# ✉️ Sending Email"
      }
    },
    {
      "id": "18f7658f-2f59-498d-9434-5d795d256d7d",
      "name": "Disposal Check",
      "type": "n8n-nodes-base.if",
      "position": [
        -1380,
        1500
      ]
    }
  ],
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Insert Data By Status Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Map Data": {
      "main": [
        [
          {
            "node": "Add records By Status Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Setup Flow": {
      "main": [
        [
          {
            "node": "Get all flow templates from NocoDB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF Type Email": {
      "main": [
        [
          {
            "node": "If email is not empty",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Disposal Check": {
      "main": [
        [
          {
            "node": "Brevo Send Email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Status-disposal-email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Template": {
      "main": [
        [
          {
            "node": "IF Template Parameters OK",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Brevo Send Email": {
      "main": [
        [
          {
            "node": "Update Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Setup Flow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicates": {
      "main": [
        [
          {
            "node": "Change Status to Sending",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger1": {
      "main": [
        [
          {
            "node": "Insert Data By Status Sending",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get user_id from dcp": {
      "main": [
        [
          {
            "node": "IF user_id is not empty",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If email is not empty": {
      "main": [
        [
          {
            "node": "Disposal Check",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Status-no-email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF user_id is not empty": {
      "main": [
        [
          {
            "node": "Map Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF Template Parameters OK": {
      "main": [
        [
          {
            "node": "Get user_id from dcp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert Data By Status Sending": {
      "main": [
        [
          {
            "node": "IF Type Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add records By Status Processing": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert Data By Status Processing": {
      "main": [
        [
          {
            "node": "Remove Duplicates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all flow templates from NocoDB": {
      "main": [
        [
          {
            "node": "Filter Template",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}