{
  "id": "kn1635PRDtERYlmb",
  "name": "Schedule posts, threads, images, and polls to X",
  "tags": [],
  "nodes": [
    {
      "id": "99c29f57-b7b3-448f-82de-31e532b1d182",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        1120
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "d607ada9-c97d-4ea9-b21d-e8169c5232b7",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        1776
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "34487f92-fb2b-46fb-aa9e-3cf3ec69938b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1248,
        576
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "a11a2811-f792-46b9-807e-f61b2328ca02",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5232,
        32
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "88b16186-9b4d-4dd8-82fe-23f71bc25a29",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5376,
        368
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "a832c8c8-deed-479f-b06a-cf2515dcbf77",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5056,
        720
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "259a66e8-bc57-4d27-9a8d-1cfa5576c418",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2064,
        1376
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "ac67ea24-9d5e-4e81-b029-c7e5714f0421",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2736,
        1168
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "c9039391-a97e-4d70-a2ff-ee83b32b3369",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3424,
        1392
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "9d0194da-92b6-4990-a0ba-2dc154160246",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4096,
        1344
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "8a633e7f-cc24-4cd2-b69f-75d0228dd098",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4544,
        1008
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "2e3078cf-e0f7-4b92-9526-7a9ff5acb53d",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5056,
        1248
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "0fb0c106-b28d-403b-93dd-a3a3f6f9a780",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4192,
        2080
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "9540fbbb-eb92-43d6-94f7-d8c17e547393",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4832,
        1952
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "cd0077d4-1fa3-4b49-8c49-3ddc034ed31d",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5296,
        2672
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "42d80ada-a151-4075-9f6e-550c186b25f5",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5072,
        3024
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "d40e3f2a-010f-4fb7-bcc1-137cd7b962ee",
      "name": "Sticky Note16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5072,
        3568
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "3b5b274e-60d2-4ce4-b46f-6a263dab215b",
      "name": "Sticky Note17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5472,
        4096
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "d4ef08f1-afab-4781-b177-e7d8e54eef7a",
      "name": "Sticky Note18",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6416,
        2016
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "403866f1-bd0c-4883-aa4e-3bb28272ee6b",
      "name": "When Webhook Received",
      "type": "n8n-nodes-base.webhook",
      "onError": "continueRegularOutput",
      "position": [
        608,
        1984
      ],
      "parameters": {},
      "typeVersion": 2.1
    },
    {
      "id": "d25a77f9-bdca-4101-b8cb-96f3e0d6d0db",
      "name": "Route by Content Type",
      "type": "n8n-nodes-base.switch",
      "position": [
        832,
        1936
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "6fe9f063-a799-42db-bb40-b9ef19e98173",
      "name": "Prepare Post Content",
      "type": "n8n-nodes-base.code",
      "position": [
        1296,
        704
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "ae0620cc-1e3c-4a4c-ba7a-6c9e9b387311",
      "name": "Delete Tweet from X",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        5120,
        3280
      ],
      "parameters": {},
      "typeVersion": 4.4
    },
    {
      "id": "08bb0900-9ab1-4260-b4d1-ece7adb8b433",
      "name": "If Tweet Deleted Successfully",
      "type": "n8n-nodes-base.if",
      "position": [
        5344,
        3280
      ],
      "parameters": {},
      "typeVersion": 2.3
    },
    {
      "id": "4c95007d-cad8-4d18-8236-3de0fc0f8b10",
      "name": "Set Delete Error Details",
      "type": "n8n-nodes-base.set",
      "position": [
        5568,
        3152
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "b6764486-330d-4e40-8ac3-eaf948bbb6cf",
      "name": "Set Delete Success Details",
      "type": "n8n-nodes-base.set",
      "position": [
        5568,
        3344
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "3ce58fbc-de82-4bea-b7c2-99315d824017",
      "name": "Fetch User Info from X",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        5120,
        3824
      ],
      "parameters": {},
      "typeVersion": 4.4
    },
    {
      "id": "5365402f-7960-4e75-8acf-bae9d3f2bfaf",
      "name": "If User Info Valid",
      "type": "n8n-nodes-base.if",
      "position": [
        5344,
        3824
      ],
      "parameters": {},
      "typeVersion": 2.3
    },
    {
      "id": "2d088c70-9f0e-42fd-a993-9cb206acd8db",
      "name": "Set User Info Error Details",
      "type": "n8n-nodes-base.set",
      "position": [
        5568,
        3696
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "dd645037-c878-432f-a919-0e63b49715cc",
      "name": "Set User Info Success Details",
      "type": "n8n-nodes-base.set",
      "position": [
        5568,
        3888
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "5bd4c2c6-b1c1-4750-8001-b937d19437a6",
      "name": "Handle Unknown Content Type",
      "type": "n8n-nodes-base.set",
      "position": [
        5552,
        4272
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "20f7f663-8abd-452f-9940-9e28e760bfeb",
      "name": "Send Response to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        6464,
        2192
      ],
      "parameters": {},
      "typeVersion": 1.5
    },
    {
      "id": "e9ebc7ba-0ed9-46f5-a771-71e26dc8e96f",
      "name": "If Post Is Simple",
      "type": "n8n-nodes-base.if",
      "position": [
        1520,
        704
      ],
      "parameters": {},
      "typeVersion": 2.3
    },
    {
      "id": "fece195d-2b36-4397-b209-2f7a8b7e37df",
      "name": "Post Simple Tweet",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        5280,
        160
      ],
      "parameters": {},
      "typeVersion": 4.4
    },
    {
      "id": "8c18cf86-1570-4a4c-aaff-cd4c23346e51",
      "name": "Set Simple Post Success Details",
      "type": "n8n-nodes-base.set",
      "position": [
        5552,
        160
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "3c118342-749b-48c0-82b7-a6aa5ff03bac",
      "name": "Prepare Thread Content",
      "type": "n8n-nodes-base.code",
      "position": [
        4240,
        2224
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "fd2b3e27-c210-49b3-85c2-bdbc2bd5ab26",
      "name": "Loop Over Thread Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        4464,
        2224
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "94adade9-49a3-4cf7-ad65-d929ccf11c72",
      "name": "If First Tweet in Thread",
      "type": "n8n-nodes-base.if",
      "position": [
        4656,
        2208
      ],
      "parameters": {},
      "typeVersion": 2.3
    },
    {
      "id": "8b446aef-c03f-4908-adbc-f777b3f3a544",
      "name": "Post Root Tweet in Thread",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        4880,
        2080
      ],
      "parameters": {},
      "typeVersion": 4.4
    },
    {
      "id": "f1fb725f-05c6-43f6-a903-6bfc3f877ae6",
      "name": "Reply to Previous Thread Tweet",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        5104,
        2272
      ],
      "parameters": {},
      "typeVersion": 4.4
    },
    {
      "id": "49470c44-b03e-4a3c-8b80-c6f888f02d20",
      "name": "Capture Thread Reply Details",
      "type": "n8n-nodes-base.code",
      "position": [
        5344,
        2192
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "497fed42-67dc-4849-87d4-ff6c92082635",
      "name": "Track Previous Tweet ID",
      "type": "n8n-nodes-base.set",
      "position": [
        5568,
        2224
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "1cf0d586-f160-4ab8-b310-188446663569",
      "name": "Compile Thread Response Data",
      "type": "n8n-nodes-base.code",
      "position": [
        5344,
        2832
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "f87daecd-6e72-41b7-87b5-ee73de352fb5",
      "name": "Set Final Thread Response",
      "type": "n8n-nodes-base.set",
      "position": [
        5568,
        2832
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "c8812df4-8555-4151-a575-875dd73dcdc6",
      "name": "If Previous Tweet Exists",
      "type": "n8n-nodes-base.if",
      "position": [
        4880,
        2304
      ],
      "parameters": {},
      "typeVersion": 2.3
    },
    {
      "id": "b5513802-4035-4157-8d1b-197f992970b5",
      "name": "Set Thread Chain Error Details",
      "type": "n8n-nodes-base.set",
      "position": [
        5104,
        2464
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "cf0b0e66-24f3-46ce-afb2-cc4c7b0e36ab",
      "name": "Wait 1 Second Before Reply",
      "type": "n8n-nodes-base.wait",
      "position": [
        5104,
        2080
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "d3bddb50-4a5d-423a-847b-3c2994f6093f",
      "name": "Prepare Media for Post",
      "type": "n8n-nodes-base.code",
      "position": [
        2112,
        1504
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "9cea78cb-23f2-4df1-981e-42d83faf8bc6",
      "name": "Init Media Upload",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        2336,
        1504
      ],
      "parameters": {},
      "typeVersion": 4.4
    },
    {
      "id": "545d4884-0039-4688-bdc3-57c10f25f175",
      "name": "Generate Media IDs",
      "type": "n8n-nodes-base.code",
      "position": [
        4592,
        1136
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "d592271d-418d-463c-bb09-b7774278d60c",
      "name": "Post Tweet with Media",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        5104,
        1424
      ],
      "parameters": {},
      "typeVersion": 4.4
    },
    {
      "id": "45caff3d-89f8-420e-b8cb-078ce4926041",
      "name": "Set Media Post Success Details",
      "type": "n8n-nodes-base.set",
      "position": [
        5552,
        1376
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "876ff555-6064-465b-af46-9bd50d615288",
      "name": "If Media Upload Success",
      "type": "n8n-nodes-base.if",
      "position": [
        2560,
        1504
      ],
      "parameters": {},
      "typeVersion": 2.3
    },
    {
      "id": "d8af4092-c2a6-4b82-9661-657b44b10023",
      "name": "Set Media Upload Error Details",
      "type": "n8n-nodes-base.set",
      "position": [
        5568,
        1728
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "87e9a29b-cf09-46ea-b5e3-85889ac10178",
      "name": "If Media IDs Valid",
      "type": "n8n-nodes-base.if",
      "position": [
        4816,
        1136
      ],
      "parameters": {},
      "typeVersion": 2.3
    },
    {
      "id": "cffd89fb-4936-4e55-b0d4-86ef625940e3",
      "name": "Append to Media Upload",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        3008,
        1296
      ],
      "parameters": {},
      "typeVersion": 4.4
    },
    {
      "id": "bdd121b6-b08b-4d30-b762-875773cc23b8",
      "name": "Finalize Media Upload",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        3696,
        1520
      ],
      "parameters": {},
      "typeVersion": 4.4
    },
    {
      "id": "b78a11b0-b78a-488e-91a3-574be8be3f46",
      "name": "Chunk Media for Upload",
      "type": "n8n-nodes-base.code",
      "position": [
        2784,
        1296
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "8d5b82e6-37f7-4e32-936e-04f73c581527",
      "name": "If Media Appended Successfully",
      "type": "n8n-nodes-base.if",
      "position": [
        3232,
        1296
      ],
      "parameters": {},
      "typeVersion": 2.3
    },
    {
      "id": "07415adf-680d-4676-b439-ffd926e1009b",
      "name": "Prepare Media Finalization",
      "type": "n8n-nodes-base.code",
      "position": [
        3472,
        1520
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "c7745632-1386-4465-b655-d1ac79046f91",
      "name": "Process Media Status",
      "type": "n8n-nodes-base.code",
      "position": [
        3920,
        1520
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "e8f27513-b9cc-43c7-82b1-32ef99aff586",
      "name": "If Media Processing Error",
      "type": "n8n-nodes-base.if",
      "position": [
        4160,
        1472
      ],
      "parameters": {},
      "typeVersion": 2.3
    },
    {
      "id": "09bd26c5-0e76-46ca-8ad3-b4eced5095fa",
      "name": "If Media Processing Complete",
      "type": "n8n-nodes-base.if",
      "position": [
        4368,
        1472
      ],
      "parameters": {},
      "typeVersion": 2.3
    },
    {
      "id": "c833c8d3-a7d4-4221-b7fb-f057afa256ed",
      "name": "Wait for Media Processing",
      "type": "n8n-nodes-base.wait",
      "position": [
        4592,
        1600
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "72bca34e-551e-4bb6-9fef-84fb64c463fd",
      "name": "Check Media Status",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        4816,
        1600
      ],
      "parameters": {},
      "typeVersion": 4.4
    },
    {
      "id": "68a148c8-ef46-4178-b6a3-aeb3ffe15f61",
      "name": "If Media Post Successful",
      "type": "n8n-nodes-base.if",
      "position": [
        5328,
        1424
      ],
      "parameters": {},
      "typeVersion": 2.3
    },
    {
      "id": "ac7ead3d-af0b-4442-bcf0-6c9885fa2b9e",
      "name": "If Invalid Post Payload",
      "type": "n8n-nodes-base.if",
      "position": [
        1712,
        752
      ],
      "parameters": {},
      "typeVersion": 2.3
    },
    {
      "id": "33987139-aad6-4e7d-a851-998712e34650",
      "name": "Set Invalid Payload Error Details",
      "type": "n8n-nodes-base.set",
      "position": [
        5472,
        496
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "2e1cde1a-30f4-41f9-b7e5-580c85db2dd8",
      "name": "If Post Contains Poll",
      "type": "n8n-nodes-base.if",
      "position": [
        1920,
        816
      ],
      "parameters": {},
      "typeVersion": 2.3
    },
    {
      "id": "08cf706a-cb97-441a-a0b4-131c51722ae2",
      "name": "Post Tweet with Poll",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        5104,
        944
      ],
      "parameters": {},
      "typeVersion": 4.4
    },
    {
      "id": "e7e55258-fed1-4a3a-8dcf-e19985186a97",
      "name": "If Poll Post Successful",
      "type": "n8n-nodes-base.if",
      "position": [
        5328,
        944
      ],
      "parameters": {},
      "typeVersion": 2.3
    },
    {
      "id": "afee7e0a-5c8d-4312-977e-196cb4e48068",
      "name": "Set Poll Post Error Details",
      "type": "n8n-nodes-base.set",
      "position": [
        5552,
        1040
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "648b6a57-5575-42b3-87f7-8ae3bcf30916",
      "name": "Set Poll Post Success Details",
      "type": "n8n-nodes-base.set",
      "position": [
        5552,
        848
      ],
      "parameters": {},
      "typeVersion": 3.4
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "bdf2f508-52e2-4eef-a39e-c46936079c9b",
  "connections": {
    "If Post Is Simple": {
      "main": [
        [
          {
            "node": "Post Simple Tweet",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If Invalid Post Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Init Media Upload": {
      "main": [
        [
          {
            "node": "If Media Upload Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post Simple Tweet": {
      "main": [
        [
          {
            "node": "Set Simple Post Success Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Media Status": {
      "main": [
        [
          {
            "node": "Process Media Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Media IDs": {
      "main": [
        [
          {
            "node": "If Media IDs Valid",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Media IDs Valid": {
      "main": [
        [
          {
            "node": "Post Tweet with Media",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set Media Upload Error Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If User Info Valid": {
      "main": [
        [
          {
            "node": "Set User Info Error Details",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set User Info Success Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete Tweet from X": {
      "main": [
        [
          {
            "node": "If Tweet Deleted Successfully",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post Tweet with Poll": {
      "main": [
        [
          {
            "node": "If Poll Post Successful",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Post Content": {
      "main": [
        [
          {
            "node": "If Post Is Simple",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Media Status": {
      "main": [
        [
          {
            "node": "If Media Processing Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Finalize Media Upload": {
      "main": [
        [
          {
            "node": "Process Media Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Post Contains Poll": {
      "main": [
        [
          {
            "node": "Post Tweet with Poll",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare Media for Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post Tweet with Media": {
      "main": [
        [
          {
            "node": "If Media Post Successful",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Content Type": {
      "main": [
        [
          {
            "node": "Prepare Post Content",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare Thread Content",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Delete Tweet from X",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Fetch User Info from X",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Handle Unknown Content Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Webhook Received": {
      "main": [
        [
          {
            "node": "Route by Content Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append to Media Upload": {
      "main": [
        [
          {
            "node": "If Media Appended Successfully",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Chunk Media for Upload": {
      "main": [
        [
          {
            "node": "Append to Media Upload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch User Info from X": {
      "main": [
        [
          {
            "node": "If User Info Valid",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Thread Items": {
      "main": [
        [
          {
            "node": "Compile Thread Response Data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If First Tweet in Thread",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Media for Post": {
      "main": [
        [
          {
            "node": "Init Media Upload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Thread Content": {
      "main": [
        [
          {
            "node": "Loop Over Thread Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Invalid Post Payload": {
      "main": [
        [
          {
            "node": "Set Invalid Payload Error Details",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If Post Contains Poll",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Media Upload Success": {
      "main": [
        [
          {
            "node": "Set Media Upload Error Details",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Chunk Media for Upload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Poll Post Successful": {
      "main": [
        [
          {
            "node": "Set Poll Post Error Details",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set Poll Post Success Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Track Previous Tweet ID": {
      "main": [
        [
          {
            "node": "Loop Over Thread Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If First Tweet in Thread": {
      "main": [
        [
          {
            "node": "Post Root Tweet in Thread",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If Previous Tweet Exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Media Post Successful": {
      "main": [
        [
          {
            "node": "Set Media Upload Error Details",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set Media Post Success Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Previous Tweet Exists": {
      "main": [
        [
          {
            "node": "Reply to Previous Thread Tweet",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set Thread Chain Error Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Delete Error Details": {
      "main": [
        [
          {
            "node": "Send Response to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Media Processing Error": {
      "main": [
        [
          {
            "node": "Set Media Upload Error Details",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If Media Processing Complete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post Root Tweet in Thread": {
      "main": [
        [
          {
            "node": "Wait 1 Second Before Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Final Thread Response": {
      "main": [
        [
          {
            "node": "Send Response to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for Media Processing": {
      "main": [
        [
          {
            "node": "Check Media Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Media Finalization": {
      "main": [
        [
          {
            "node": "Finalize Media Upload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Delete Success Details": {
      "main": [
        [
          {
            "node": "Send Response to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 1 Second Before Reply": {
      "main": [
        [
          {
            "node": "Capture Thread Reply Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Handle Unknown Content Type": {
      "main": [
        [
          {
            "node": "Send Response to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Poll Post Error Details": {
      "main": [
        [
          {
            "node": "Send Response to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set User Info Error Details": {
      "main": [
        [
          {
            "node": "Send Response to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Capture Thread Reply Details": {
      "main": [
        [
          {
            "node": "Track Previous Tweet ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compile Thread Response Data": {
      "main": [
        [
          {
            "node": "Set Final Thread Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Media Processing Complete": {
      "main": [
        [
          {
            "node": "Generate Media IDs",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait for Media Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Tweet Deleted Successfully": {
      "main": [
        [
          {
            "node": "Set Delete Error Details",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set Delete Success Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Poll Post Success Details": {
      "main": [
        [
          {
            "node": "Send Response to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set User Info Success Details": {
      "main": [
        [
          {
            "node": "Send Response to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Media Appended Successfully": {
      "main": [
        [
          {
            "node": "Set Media Upload Error Details",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare Media Finalization",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reply to Previous Thread Tweet": {
      "main": [
        [
          {
            "node": "Capture Thread Reply Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Media Post Success Details": {
      "main": [
        [
          {
            "node": "Send Response to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Media Upload Error Details": {
      "main": [
        [
          {
            "node": "Send Response to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Thread Chain Error Details": {
      "main": [
        [
          {
            "node": "Send Response to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Simple Post Success Details": {
      "main": [
        [
          {
            "node": "Send Response to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Invalid Payload Error Details": {
      "main": [
        [
          {
            "node": "Send Response to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}