{
  "name": "Sync Ghost members with MailerLite subscribers in real time",
  "nodes": [
    {
      "id": "7b0ca6c0-c156-4031-8b05-30da71580472",
      "name": "Sticky Note - Configuration",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        544,
        -96
      ],
      "parameters": {
        "width": 1084,
        "height": 632,
        "content": "## 📋 Configure Sync Settings\n\nBefore starting, make sure to populate the following nodes with your credentials:\n➡️  MailerLite (update/create subscriber)\n➡️  Ghost (add/delete webhook)\n➡️  n8n (get/up"
      }
    },
    {
      "id": "95b10da8-329e-4dfc-8130-5a274aedd13d",
      "name": "Sticky Note - Webhook Management",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1648,
        -96
      ],
      "parameters": {
        "width": 914,
        "height": 636,
        "content": "## 🔗 Webhook Management\n\nThis section automatically manages Ghost webhooks based on your form settings:\n\nWhen **enabled**: Creates webhook in Ghost → Stores webhook ID in data table\nWhen **disabled**:"
      }
    },
    {
      "id": "66e51880-d110-4afc-9ef8-5bcaf63f10b6",
      "name": "Sticky Note - Sync Listener",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        544,
        576
      ],
      "parameters": {
        "width": 1084,
        "height": 612,
        "content": "## 🎯 Webhook Listener to Sync in Real-Time\n\nThis webhook receives events from Ghost when members are added or deleted.\n\n**Member Added** → Creates subscriber in MailerLite\n**Member Deleted** → Unsubsc"
      }
    },
    {
      "id": "8763a85c-77a7-46d2-93f3-23e42917b4d5",
      "name": "Sticky Note - State Persistence",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2592,
        -96
      ],
      "parameters": {
        "width": 612,
        "height": 644,
        "content": "## 💾 Keep Track of Current Sync Status\n\nAfter webhook changes, the workflow updates itself to remember your configuration:\n\n1️⃣ Fetches current workflow\n2️⃣ Updates form default values with your setti"
      }
    },
    {
      "id": "0ab70058-853c-4ddd-b3c7-242d231302aa",
      "name": "Create ghost_webhooks table",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1072,
        368
      ]
    },
    {
      "id": "aa87b500-55b0-4e35-ae94-978ed7c2349a",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        768,
        800
      ]
    },
    {
      "id": "55e28835-aedc-4bdd-b062-63e1001ebfe6",
      "name": "Sync Settings Form",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        592,
        256
      ]
    },
    {
      "id": "c2d2e2c7-b263-41b4-8ba4-5b330a41739b",
      "name": "List data tables",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        752,
        256
      ]
    },
    {
      "id": "d1e366f5-a757-4fb8-bfe7-ab63f131ac7c",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1200,
        256
      ]
    },
    {
      "id": "25c7087b-9aa2-4044-a2a5-95a8e98aaf50",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1488,
        256
      ]
    },
    {
      "id": "3cb3c30b-6ead-40cc-9ef0-adc1f92273d8",
      "name": "Check if member deleted",
      "type": "n8n-nodes-base.if",
      "position": [
        992,
        800
      ]
    },
    {
      "id": "cc4eb62e-e2bd-483c-88c4-c1f9409a9837",
      "name": "Update a subscriber",
      "type": "n8n-nodes-base.mailerLite",
      "position": [
        1216,
        704
      ]
    },
    {
      "id": "ceb33f96-1095-4145-8e53-86f7354e97a0",
      "name": "Create a subscriber",
      "type": "n8n-nodes-base.mailerLite",
      "position": [
        1216,
        896
      ]
    },
    {
      "id": "bf2dc904-e74b-41c7-9ea3-e5c8ea6171c4",
      "name": "Get webhook ID to delete",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1904,
        320
      ]
    },
    {
      "id": "37f73744-fcb0-4407-bbbb-1aaf8f7aa171",
      "name": "Delete webhook in Ghost",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2128,
        320
      ]
    },
    {
      "id": "d863ba71-9101-414a-948f-78bb101164a7",
      "name": "Add webhook in Ghost",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1904,
        176
      ]
    },
    {
      "id": "174371ed-2bfb-4e78-8f8e-871a2e075298",
      "name": "Store Ghost webhook ID",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        2128,
        176
      ]
    },
    {
      "id": "4f04a59a-8236-4cf3-8eda-ba23a51a268c",
      "name": "Forget Ghost webhook ID",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        2368,
        320
      ]
    },
    {
      "id": "a6fc18ff-276b-4ea7-b3f5-11a7c4fa62fa",
      "name": "Update default form values to remember webhook status",
      "type": "n8n-nodes-base.code",
      "position": [
        2832,
        240
      ]
    },
    {
      "id": "4fbf0f71-25b4-4d25-9a84-f64cafc06270",
      "name": "Get current workflow",
      "type": "n8n-nodes-base.n8n",
      "position": [
        2656,
        240
      ]
    },
    {
      "id": "20316cd7-df3d-4641-9d82-920deef000a4",
      "name": "Update current workflow with sync status",
      "type": "n8n-nodes-base.n8n",
      "position": [
        3024,
        240
      ]
    },
    {
      "id": "01b26057-8667-4c26-98bf-01dda6ccbf6d",
      "name": "Check if ghost_webhooks table exists",
      "type": "n8n-nodes-base.if",
      "position": [
        912,
        256
      ]
    },
    {
      "id": "ed2f1b35-df02-45c8-a878-5332cc19cb91",
      "name": "If sync enabled",
      "type": "n8n-nodes-base.if",
      "position": [
        1680,
        256
      ]
    },
    {
      "id": "5093cb47-9c5f-470e-86c5-7c39ad0d0307",
      "name": "Identity syncs to be enabled/disabled",
      "type": "n8n-nodes-base.code",
      "position": [
        1344,
        256
      ]
    },
    {
      "id": "0199ef3d-c57c-442d-867f-6224fca7b447",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        544,
        -256
      ],
      "parameters": {
        "width": 928,
        "height": 144,
        "content": "## Sync Ghost Members with MailerLite Subscribers in Real-Time\nThis n8n workflow automatically syncs your Ghost CMS members with MailerLite subscribers in real-time using webhooks. When members join o"
      }
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Identity syncs to be enabled/disabled",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Check if member deleted",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "If sync enabled",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If sync enabled": {
      "main": [
        [
          {
            "node": "Add webhook in Ghost",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get webhook ID to delete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List data tables": {
      "main": [
        [
          {
            "node": "Check if ghost_webhooks table exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sync Settings Form": {
      "main": [
        [
          {
            "node": "List data tables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add webhook in Ghost": {
      "main": [
        [
          {
            "node": "Store Ghost webhook ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get current workflow": {
      "main": [
        [
          {
            "node": "Update default form values to remember webhook status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store Ghost webhook ID": {
      "main": [
        [
          {
            "node": "Get current workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if member deleted": {
      "main": [
        [
          {
            "node": "Update a subscriber",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create a subscriber",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete webhook in Ghost": {
      "main": [
        [
          {
            "node": "Forget Ghost webhook ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Forget Ghost webhook ID": {
      "main": [
        [
          {
            "node": "Get current workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get webhook ID to delete": {
      "main": [
        [
          {
            "node": "Delete webhook in Ghost",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create ghost_webhooks table": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Check if ghost_webhooks table exists": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create ghost_webhooks table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Identity syncs to be enabled/disabled": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update default form values to remember webhook status": {
      "main": [
        [
          {
            "node": "Update current workflow with sync status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}