{
  "name": "Build a complete email CRM with Google Sheets & MailerSend",
  "nodes": [
    {
      "id": "956055e1-996a-4adc-9b04-933c0f8adfac",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -200,
        160
      ]
    },
    {
      "id": "a7964cef-e8bc-4b59-8f4e-47a7396c5877",
      "name": "Setup Flow",
      "type": "n8n-nodes-base.set",
      "position": [
        20,
        160
      ]
    },
    {
      "id": "bdcdfb37-6e24-4b08-b665-570575a7770a",
      "name": "Map Data",
      "type": "n8n-nodes-base.set",
      "position": [
        -140,
        460
      ]
    },
    {
      "id": "18e97315-1c69-420a-9849-589914b40f65",
      "name": "Filter Template",
      "type": "n8n-nodes-base.filter",
      "position": [
        440,
        160
      ]
    },
    {
      "id": "c0795f4f-7588-422a-b783-f9718ac640df",
      "name": "IF Template Parameters OK",
      "type": "n8n-nodes-base.if",
      "position": [
        680,
        160
      ]
    },
    {
      "id": "7d9fa178-95e5-417d-9321-ebb6f903afaa",
      "name": "IF user_id is not empty",
      "type": "n8n-nodes-base.if",
      "position": [
        1120,
        240
      ]
    },
    {
      "id": "eea2dd6c-2cec-47a5-ba0e-e49cbeb38280",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        440,
        560
      ]
    },
    {
      "id": "a07ff8e2-b738-4e2a-9a0b-ac501d03eeda",
      "name": "Remove Duplicates",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        900,
        660
      ]
    },
    {
      "id": "3881117a-f258-4efe-9c81-ac40e9fe9b4a",
      "name": "IF Type Email",
      "type": "n8n-nodes-base.if",
      "position": [
        1980,
        460
      ]
    },
    {
      "id": "aaf86910-cbf0-4abc-9f44-e855930077fe",
      "name": "Schedule Trigger1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        1580,
        460
      ]
    },
    {
      "id": "0b5c4da8-a9eb-4b91-8b5d-abdf46553f01",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1760,
        -80
      ],
      "parameters": {
        "width": 720,
        "height": 1040,
        "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": "f9c24ac3-1218-49c3-a548-76e0d6d97523",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        820,
        880
      ],
      "parameters": {
        "width": 460,
        "height": 460,
        "content": "## transaction\n[\n  {\n    \"CreatedAt\": \"2025-10-25T13:11:41Z\",\n    \"UpdatedAt\": \"2025-10-25T13:11:41Z\",\n    \"user_id\": \"uid_0001\",\n    \"email\": \"user1@gmail.com\",\n    \"number\": \"9362000000\",\n    \"first"
      }
    },
    {
      "id": "1ed6e59c-b643-4d80-9c00-79f537d3c05a",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -40,
        880
      ],
      "parameters": {
        "width": 840,
        "height": 200,
        "content": "## template\n\n\n| ---Id--- | ---template_name---                           | ---journey--- |---type---   | ---type_template_id---   | ---discount_code--- | ---gift_code--- |\n|----|----------------------"
      }
    },
    {
      "id": "cf47bec3-465f-4d14-bbdf-683d5cb7f6c2",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        360,
        1100
      ],
      "parameters": {
        "width": 440,
        "height": 220,
        "content": "## segment1\n\n\n| user_id        | email                        | number         | first_name        |\n|----------------|------------------------------|----------------|------------------|\n| uid_0001   "
      }
    },
    {
      "id": "c74bf344-3943-4a47-941e-9aa083715cf1",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -40,
        1100
      ],
      "parameters": {
        "width": 380,
        "height": 220,
        "content": "# Example of Databases📋\n"
      }
    },
    {
      "id": "68522da8-5016-443d-9ff7-3fb5b6cb3d6b",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1020,
        -80
      ],
      "parameters": {
        "width": 720,
        "height": 1300,
        "content": "# 📌 Node-by-Node Description (MailerSend eCRM)\n\n### 🧱 Setup Flow\n• Select campaign by setting `template_id`.\n\n### 📄 Get Templates (Google Sheets)\n• Load all rows from `template` sheet.\n\n### 🎯 Filter T"
      }
    },
    {
      "id": "fd666783-f039-49cb-9158-e64f0424b0ec",
      "name": "If email is not empty",
      "type": "n8n-nodes-base.if",
      "position": [
        2240,
        380
      ]
    },
    {
      "id": "588eb175-9d20-482a-947b-d49c6b1511ef",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -280,
        20
      ],
      "parameters": {
        "width": 340,
        "height": 80,
        "content": "# 📝 Insert user_id"
      }
    },
    {
      "id": "2359c11c-fecc-4ea4-9d16-14902a3a3cf1",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1420,
        80
      ],
      "parameters": {
        "width": 340,
        "height": 80,
        "content": "# ✉️ Sending Email"
      }
    },
    {
      "id": "9d1dc07c-4f18-4524-923d-a1044bae5faa",
      "name": "Disposal Check",
      "type": "n8n-nodes-base.if",
      "position": [
        2460,
        300
      ]
    },
    {
      "id": "acbdbe02-1f83-4d34-97f1-d9fdf66c0652",
      "name": "Get user_id from cdp",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        920,
        240
      ]
    },
    {
      "id": "a3a0ce7f-466d-4f7d-a789-1c2adbf22e30",
      "name": "Add records By Status Processing",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        220,
        560
      ]
    },
    {
      "id": "7f85d42d-c21d-46d6-a61d-f021ed619153",
      "name": "Insert Data By Status Processing",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        640,
        560
      ]
    },
    {
      "id": "5232fd36-adc4-4a78-bb09-af5e880a82bf",
      "name": "Change Status to Sending",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1120,
        660
      ]
    },
    {
      "id": "d099864f-5ec0-42a3-b5c8-d443a9606a32",
      "name": "Insert Data By Status Sending",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1780,
        460
      ]
    },
    {
      "id": "af7b1c39-99db-4da7-8210-420347a57503",
      "name": "No Email Update",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2460,
        560
      ]
    },
    {
      "id": "f99dae69-12d7-48bf-acd3-4d43defa01c9",
      "name": "Disposal Email Update",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2700,
        420
      ]
    },
    {
      "id": "f0fb7eee-caee-4f5c-86b6-882b6390c9bb",
      "name": "Update Status: 2-Sent",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3140,
        220
      ]
    },
    {
      "id": "37b87499-d9d8-4274-9fc2-5a7b73384d77",
      "name": "Get all flow templates from Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        220,
        160
      ]
    },
    {
      "id": "00401910-2157-47ee-a73c-385694db6345",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        -220
      ],
      "parameters": {
        "width": 660,
        "height": 240,
        "content": "# 📄 Transaction Sheet (Copy This)\n\nAll example data for this workflow is already prepared ✅  \nOpen the Google Sheet below and copy the **Transaction** tab:\n\n🔗 Google Sheet:\nhttps://docs.google.com/spr"
      }
    },
    {
      "id": "ddcaa8e2-5fb8-4953-971c-a2d42bcbe1a0",
      "name": "Send an template HTML Mailerlite",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2760,
        220
      ]
    },
    {
      "id": "d528c926-e075-48d6-aa00-16b1720c7cac",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1540,
        140
      ],
      "parameters": {
        "width": 1780,
        "height": 660,
        "content": ""
      }
    },
    {
      "id": "be5abdba-ae74-4d43-b6f8-0bea73e1ed03",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -280,
        80
      ],
      "parameters": {
        "width": 1620,
        "height": 760,
        "content": ""
      }
    },
    {
      "id": "b5564b95-2824-4066-be2c-3bf9f815a7bf",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2600,
        -380
      ],
      "parameters": {
        "width": 460,
        "height": 780,
        "content": "# ✉️ MailerSend Send Email\n\nThis node sends the campaign email to each valid subscriber.\n\n✅ Uses MailerSend Template ID from:\n• `type_template_id` field in template sheet (string)\n\n✅ Personalization f"
      }
    }
  ],
  "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 Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF Type Email": {
      "main": [
        [
          {
            "node": "If email is not empty",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Disposal Check": {
      "main": [
        [
          {
            "node": "Send an template HTML Mailerlite",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Disposal Email Update",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Template": {
      "main": [
        [
          {
            "node": "IF Template Parameters OK",
            "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 cdp": {
      "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": "No Email Update",
            "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 cdp",
            "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
          }
        ]
      ]
    },
    "Send an template HTML Mailerlite": {
      "main": [
        [
          {
            "node": "Update Status: 2-Sent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all flow templates from Sheet": {
      "main": [
        [
          {
            "node": "Filter Template",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}