{
  "name": "Manage Patreon and Ko-fi leads with Gmail, OpenAI and Google Sheets",
  "nodes": [
    {
      "id": "156504d4-d521-4e12-9062-096ac1ef6078",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -288,
        1320
      ]
    },
    {
      "id": "a28d3e11-e26b-4fa9-913d-6b461809b95f",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        -64,
        1320
      ]
    },
    {
      "id": "70f7cdb3-acf6-4f15-92df-afb98700658c",
      "name": "Set Token",
      "type": "n8n-nodes-base.set",
      "position": [
        160,
        1800
      ]
    },
    {
      "id": "1e25c67b-0f3f-44c7-9afc-e99618be9bd1",
      "name": "Parse Kofi Payload",
      "type": "n8n-nodes-base.code",
      "position": [
        384,
        1800
      ]
    },
    {
      "id": "035c60bb-c8a7-4795-9820-ea548a78b957",
      "name": "Switch1",
      "type": "n8n-nodes-base.switch",
      "position": [
        1856,
        1688
      ]
    },
    {
      "id": "de2be0e3-b586-45a6-87f9-cb12b6b83c25",
      "name": "Token Validation",
      "type": "n8n-nodes-base.if",
      "position": [
        608,
        1800
      ]
    },
    {
      "id": "f05fdc67-54e6-4836-88a8-e3341cb039c9",
      "name": "Fake Payload Alert",
      "type": "n8n-nodes-base.gmail",
      "position": [
        832,
        1896
      ]
    },
    {
      "id": "38ef2260-d4fc-44ac-9ed4-9e8919f84dde",
      "name": "Thank you Letter",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2080,
        1512
      ]
    },
    {
      "id": "0705c1aa-a3f4-4422-a405-052ccc42d7d6",
      "name": "Thank you Letter1",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2080,
        1704
      ]
    },
    {
      "id": "d89e18e9-8406-4ca4-a0be-2ff47e928761",
      "name": "Thank you Letter2",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2080,
        1896
      ]
    },
    {
      "id": "e5f4cf22-e035-40ed-9786-c6f82c33345e",
      "name": "Merge1",
      "type": "n8n-nodes-base.merge",
      "position": [
        1632,
        1704
      ]
    },
    {
      "id": "a0f542ef-9dce-4c07-9d75-a11891e90cc5",
      "name": "Get Newsletter Subs1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        832,
        1704
      ]
    },
    {
      "id": "c0231a04-0da6-4773-b178-379070d89589",
      "name": "Person Exists on the List?1",
      "type": "n8n-nodes-base.if",
      "position": [
        1120,
        1704
      ]
    },
    {
      "id": "93650e4a-bbb3-4c20-adc3-156d8ccdf540",
      "name": "Add New Sub to Newsletter1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1408,
        1632
      ]
    },
    {
      "id": "6b89b036-8a7e-4c58-914e-f4daf78110eb",
      "name": "Switch2",
      "type": "n8n-nodes-base.switch",
      "position": [
        1440,
        576
      ]
    },
    {
      "id": "68db8766-0dd3-4e09-8392-28a34c18c51d",
      "name": "Message a model",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1056,
        672
      ]
    },
    {
      "id": "ab8acaeb-ebb6-4761-a094-c63ea6d2b637",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        832,
        672
      ]
    },
    {
      "id": "1f388f14-3b64-4bdc-91b4-3a62b4060685",
      "name": "Get Newsletter Subs",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        160,
        672
      ]
    },
    {
      "id": "9604ff3c-3f46-4f1e-b411-cb7d9721f9a1",
      "name": "Person Exists on the List?",
      "type": "n8n-nodes-base.if",
      "position": [
        384,
        672
      ]
    },
    {
      "id": "ccfec126-ec11-4710-a023-241e87a05d9b",
      "name": "Add New Sub to Newsletter",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        608,
        608
      ]
    },
    {
      "id": "471eb7ee-ca1f-4a4a-b5a6-2adb0d49869f",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1664,
        0
      ]
    },
    {
      "id": "fc089d56-268f-4a53-968b-f2f836d07ad5",
      "name": "Send a message1",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1664,
        192
      ]
    },
    {
      "id": "29521d5f-974c-4a4a-a986-620398782bf6",
      "name": "Send a message2",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1664,
        384
      ]
    },
    {
      "id": "23f7e83f-107a-4dbb-9d96-ec5b689a3a2a",
      "name": "Send a message3",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1664,
        768
      ]
    },
    {
      "id": "8117b97d-384e-4862-812f-664f07c03116",
      "name": "Send a message4",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1664,
        960
      ]
    },
    {
      "id": "c2c39b8c-5217-4f42-8469-bda9d6abdc13",
      "name": "Send a message5",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1664,
        1152
      ]
    },
    {
      "id": "470a5590-889b-4ee0-81ab-3b2fcb1af8a8",
      "name": "Send a message6",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1664,
        1344
      ]
    },
    {
      "id": "7f619e67-2afe-4744-9593-8c373d6ee240",
      "name": "Send a message7",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1664,
        576
      ]
    },
    {
      "id": "ef9296e0-c8dc-4ad4-a2d5-f27f2b5e6fd1",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -672,
        272
      ],
      "parameters": {
        "width": 500,
        "height": 894,
        "content": "## Patreon & Ko-fi Webhook Processor\n\n### About\nThis system is listening for webhooks from patreon and kofi.\nOnce received, it detects the service by looking at headers. \n\nFor Kofi it parses and valid"
      }
    },
    {
      "id": "fe6bf38d-e74d-4d4a-9457-c5a9b97bdb8c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        112,
        1680
      ],
      "parameters": {
        "width": 192,
        "height": 288,
        "content": "## Set Token\nGet an auth token from Kofi to validate your payloads."
      }
    },
    {
      "id": "da980daf-09d1-412a-80e6-e129a674c935",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        784,
        1520
      ],
      "parameters": {
        "width": 1024,
        "height": 352,
        "content": "## Newsletter\nWe check whether person is on our newsletter list or not. If not, we add him. If not, skip.\nCreate a \"Newsletter\" spreadsheet with columns \"email\" and \"name\". Set up the node and feel fr"
      }
    },
    {
      "id": "644975a7-20c3-44be-bf56-384b66076095",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1824,
        1392
      ],
      "parameters": {
        "width": 528,
        "height": 688,
        "content": "## Letters\nSet up letters that you're gonna send to members."
      }
    },
    {
      "id": "78442062-d6cc-4654-877c-b94dbfd41791",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        480
      ],
      "parameters": {
        "width": 912,
        "height": 352,
        "content": "## Newsletter\nWe check whether person is on our newsletter list or not. If not, we add him. If not, skip.\nCreate a \"Newsletter\" spreadsheet with columns \"email\" and \"name\". Set up the node and feel fr"
      }
    },
    {
      "id": "d5d54e94-2377-4222-ac0e-cac5ad3673b6",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1008,
        528
      ],
      "parameters": {
        "width": 368,
        "height": 304,
        "content": "## Status Validation\nWe use OpenAI to determine the status of operations"
      }
    },
    {
      "id": "ff263dd8-bbdc-4877-8e3e-dd035fed1333",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1392,
        -112
      ],
      "parameters": {
        "width": 528,
        "height": 1616,
        "content": "## Letters\nSet up letters that you're gonna send to members."
      }
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Message a model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "Switch1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Get Newsletter Subs",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set Token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch1": {
      "main": [
        [
          {
            "node": "Thank you Letter",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Thank you Letter1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Thank you Letter2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch2": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a message1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a message2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a message7",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a message3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a message4",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a message5",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a message6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Token": {
      "main": [
        [
          {
            "node": "Parse Kofi Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message a model": {
      "main": [
        [
          {
            "node": "Switch2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Token Validation": {
      "main": [
        [
          {
            "node": "Get Newsletter Subs1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Fake Payload Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Kofi Payload": {
      "main": [
        [
          {
            "node": "Token Validation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Newsletter Subs": {
      "main": [
        [
          {
            "node": "Person Exists on the List?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Newsletter Subs1": {
      "main": [
        [
          {
            "node": "Person Exists on the List?1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add New Sub to Newsletter": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add New Sub to Newsletter1": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Person Exists on the List?": {
      "main": [
        [
          {
            "node": "Add New Sub to Newsletter",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Person Exists on the List?1": {
      "main": [
        [
          {
            "node": "Add New Sub to Newsletter1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}