{
  "name": "Daily import validated contacts from NocoDB to Brevo",
  "nodes": [
    {
      "id": "b5f8e6d7-960f-45d6-a15d-9161200b3993",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -280,
        0
      ]
    },
    {
      "id": "f4f5e8bd-0e28-41c2-b0dd-342f68e4a74c",
      "name": "Check if parameters are not empty",
      "type": "n8n-nodes-base.if",
      "position": [
        340,
        0
      ]
    },
    {
      "id": "2a684591-5c13-42c2-a826-12c0305d3525",
      "name": "Check if email is Disposal",
      "type": "n8n-nodes-base.if",
      "position": [
        700,
        0
      ]
    },
    {
      "id": "dba5e2e9-17d3-4a3f-b0c2-fc23b68b0fa5",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1020,
        -200
      ]
    },
    {
      "id": "0f6142d4-8aa1-4e2e-82a5-7adb0a89ba72",
      "name": "Brevo: Create Contact",
      "type": "n8n-nodes-base.sendInBlue",
      "position": [
        1320,
        -200
      ]
    },
    {
      "id": "0e6921d1-3131-4ae9-ac50-783c57e61582",
      "name": "NocoDB: Get new users list",
      "type": "n8n-nodes-base.nocoDb",
      "position": [
        40,
        0
      ]
    },
    {
      "id": "ec5753b4-d6fb-4444-b53d-1e6506c875bd",
      "name": "NocoDB: change status to 1-empty-fields",
      "type": "n8n-nodes-base.nocoDb",
      "position": [
        340,
        260
      ]
    },
    {
      "id": "90227f77-8840-41ae-aaa9-fac355463c1f",
      "name": "NocoDB: change status to 2-disposal-email",
      "type": "n8n-nodes-base.nocoDb",
      "position": [
        700,
        260
      ]
    },
    {
      "id": "3a539eb1-732a-4133-ac57-2760da656b5e",
      "name": "NocoDB: change status to 3-contact-created",
      "type": "n8n-nodes-base.nocoDb",
      "position": [
        1620,
        -200
      ]
    },
    {
      "id": "de4b9326-03cc-4f33-b244-63de98fbbabc",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -340,
        -160
      ],
      "parameters": {
        "width": null,
        "height": 340,
        "content": "Runs the workflow automatically once a day at the scheduled time."
      }
    },
    {
      "id": "a56f0f46-8c7a-4895-b42f-175636ed7853",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -40,
        -160
      ],
      "parameters": {
        "width": null,
        "height": 340,
        "content": "Fetches all new user records from the NocoDB table where the status is 0-not-imported.\n\nThis status marks records that have not yet been processed by the flow (new users)."
      }
    },
    {
      "id": "11d68333-74ff-4b32-8a1d-ffa918743a4d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        260,
        -160
      ],
      "parameters": {
        "width": 280,
        "height": 740,
        "content": "Verifies that the required fields: first_name, last_name & email are all filled in before continuing.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nUpdates the record’s status to 1-empty-fields in NocoDB "
      }
    },
    {
      "id": "2e1d7c71-d8ef-43e0-b601-ce5a5f8d3d60",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        600,
        -160
      ],
      "parameters": {
        "width": 280,
        "height": 740,
        "content": "Verifies that the email address is not from a known disposable or temporary email provider before continuing.\nWe don't want to send email to disposal email addresses.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
      }
    },
    {
      "id": "f818f406-b2c8-487e-8bb2-bf02b57d3c3b",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        940,
        -340
      ],
      "parameters": {
        "width": null,
        "height": 360,
        "content": "Runs one record at a time to avoid heavy load from creating contacts in bulk."
      }
    },
    {
      "id": "ac098881-8bb3-4214-8502-bba7f92c3bed",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1240,
        -340
      ],
      "parameters": {
        "width": null,
        "height": 360,
        "content": "Creates a new contact in Brevo using the provided first_name, last_name, and email."
      }
    },
    {
      "id": "ac752d01-6d5c-44e0-abe0-b065a1d4bd40",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1540,
        -340
      ],
      "parameters": {
        "width": null,
        "height": 360,
        "content": "Updates the record’s status to 3-contact-created in NocoDB after the contact is successfully added to Brevo."
      }
    }
  ],
  "connections": {
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Brevo: Create Contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "NocoDB: Get new users list",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Brevo: Create Contact": {
      "main": [
        [
          {
            "node": "NocoDB: change status to 3-contact-created",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if email is Disposal": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "NocoDB: change status to 2-disposal-email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "NocoDB: Get new users list": {
      "main": [
        [
          {
            "node": "Check if parameters are not empty",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if parameters are not empty": {
      "main": [
        [
          {
            "node": "Check if email is Disposal",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "NocoDB: change status to 1-empty-fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "NocoDB: change status to 3-contact-created": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}