{
  "name": "Sync tasks between Todoist and Notion with Redis-powered 2-way logic",
  "nodes": [
    {
      "id": "b526db31-7760-4613-90fd-334b81929281",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6912,
        1872
      ],
      "parameters": {
        "width": 336,
        "height": 384,
        "content": "## Task"
      }
    },
    {
      "id": "1d540d5b-0313-424d-82b5-14ccd393b270",
      "name": "SwitchT",
      "type": "n8n-nodes-base.switch",
      "position": [
        6928,
        2416
      ]
    },
    {
      "id": "2d7a0c01-9b27-4418-a255-74b93809a1b5",
      "name": "Create task in NotionT4",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        7104,
        2544
      ]
    },
    {
      "id": "6f982d2c-b073-405e-a1d6-75858813646a",
      "name": "Create task in NotionT5",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        7104,
        2432
      ]
    },
    {
      "id": "fdc202d0-229a-4d70-ad23-392219eb569c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6912,
        2288
      ],
      "parameters": {
        "width": 336,
        "height": 384,
        "content": "## Sub Task"
      }
    },
    {
      "id": "c443abb7-b099-4b86-8870-f281134ce8fe",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        6576,
        2208
      ]
    },
    {
      "id": "ab4a7cb7-cf33-4815-8db6-1c41663cabf0",
      "name": "Todoist Webhook1",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -272,
        4640
      ]
    },
    {
      "id": "4b3346d2-106b-495d-ac4e-97922ebd0381",
      "name": "Mark as Done in Notion1",
      "type": "n8n-nodes-base.notion",
      "position": [
        7184,
        4592
      ]
    },
    {
      "id": "af868353-86e8-441e-81d7-2286b35e3e0d",
      "name": "Mark as Obsolete in Notion1",
      "type": "n8n-nodes-base.notion",
      "position": [
        6608,
        6352
      ]
    },
    {
      "id": "7558a068-bd64-4b6d-862f-781cbca8e8fd",
      "name": "Only continue if not locked1",
      "type": "n8n-nodes-base.filter",
      "position": [
        832,
        4640
      ]
    },
    {
      "id": "453c11c8-c938-44e2-af68-b316796c225a",
      "name": "Check if Todoist ID is locked1",
      "type": "n8n-nodes-base.redis",
      "position": [
        608,
        4640
      ]
    },
    {
      "id": "948602fd-5d30-4671-90ab-7ba2fa4169e8",
      "name": "Check if creating flag exists",
      "type": "n8n-nodes-base.redis",
      "position": [
        5936,
        2384
      ]
    },
    {
      "id": "51ba746e-4b48-4bac-968e-f1272f5f4376",
      "name": "Only continue if flag does not exist",
      "type": "n8n-nodes-base.filter",
      "position": [
        6160,
        2384
      ]
    },
    {
      "id": "cdc93992-e768-451d-b7d5-4d9fb3841e00",
      "name": "Set creating flag",
      "type": "n8n-nodes-base.redis",
      "position": [
        6384,
        2384
      ]
    },
    {
      "id": "76345f5a-1f6f-4cc7-a154-6d46a1b685b6",
      "name": "Get Notion Task",
      "type": "n8n-nodes-base.notion",
      "position": [
        5936,
        6352
      ]
    },
    {
      "id": "6d0ad2a0-5be9-4998-a8d3-5fdc84cfdadd",
      "name": "Notion Task found",
      "type": "n8n-nodes-base.filter",
      "position": [
        6160,
        6352
      ]
    },
    {
      "id": "ae69ff78-00a6-4dd4-8033-0fe1b4fa3902",
      "name": "Switch by Event1",
      "type": "n8n-nodes-base.switch",
      "position": [
        6208,
        4464
      ]
    },
    {
      "id": "d6d8067d-4c99-4a7c-a655-253a212ee883",
      "name": "Execution Data5",
      "type": "n8n-nodes-base.executionData",
      "position": [
        4448,
        4608
      ]
    },
    {
      "id": "cc9d6c3a-cd77-42e5-a49a-c4b73706c117",
      "name": "Execution Data6",
      "type": "n8n-nodes-base.executionData",
      "position": [
        7728,
        2384
      ]
    },
    {
      "id": "4b47993a-e9ac-4ad3-9007-24e5d49ccde8",
      "name": "Execution Data7",
      "type": "n8n-nodes-base.executionData",
      "position": [
        5968,
        4480
      ]
    },
    {
      "id": "c2e49cfd-384f-43a5-a5f9-8f6eb712a4d1",
      "name": "Execution Data8",
      "type": "n8n-nodes-base.executionData",
      "position": [
        6400,
        6352
      ]
    },
    {
      "id": "a0db317f-4a83-493d-b13e-af0269171abd",
      "name": "Sticky Note24",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4384,
        4496
      ],
      "parameters": {
        "width": 220,
        "height": 280,
        "content": "Store more information, which was not available earlier"
      }
    },
    {
      "id": "d0493464-c46f-4fa8-aa05-9dfa76141c85",
      "name": "Sticky Note33",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        7424,
        2304
      ],
      "parameters": {
        "width": 220,
        "height": 240,
        "content": "Set focussed flag, so it remains in Todoist even after updating in Notion"
      }
    },
    {
      "id": "1fead4b5-3100-44f3-a320-26b06fccf32d",
      "name": "Sticky Note38",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5840,
        1856
      ],
      "parameters": {
        "width": 2520,
        "height": 840,
        "content": "**Create Notion page** if it does not exist"
      }
    },
    {
      "id": "75ac90e4-735f-4751-8800-acf588cc2f5f",
      "name": "Sticky Note39",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5888,
        3840
      ],
      "parameters": {
        "width": 1612,
        "height": 1060,
        "content": "**Update Notion page** if it needs to be changed"
      }
    },
    {
      "id": "ea371181-1a82-46bc-9bcb-84d4ebdcbfe7",
      "name": "Sticky Note40",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        544,
        4528
      ],
      "parameters": {
        "width": 440,
        "height": 280,
        "content": "Checking for a cached flag in Redis, to prevent overrides and endless loops."
      }
    },
    {
      "id": "524f0c35-0160-44ea-88c4-5c66eaf4293d",
      "name": "Sticky Note41",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4608,
        4496
      ],
      "parameters": {
        "width": 220,
        "height": 280,
        "content": "Retrieve Notion page, so it can be compared against"
      }
    },
    {
      "id": "dffbaa62-3e70-4277-a1ad-a8816fc636f2",
      "name": "Sticky Note42",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5904,
        4368
      ],
      "parameters": {
        "width": 236,
        "height": 280,
        "content": "Store more information, which was not available earlier"
      }
    },
    {
      "id": "a8bea9ce-60af-46d1-886b-c2d8f95f878e",
      "name": "Sticky Note43",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        4528
      ],
      "parameters": {
        "width": 204,
        "height": 280,
        "content": "Following nodes reference to this node, so the trigger can easily be replaced\n\n"
      }
    },
    {
      "id": "3bdb6122-92bd-49b0-87b6-136a2388d6ff",
      "name": "Sticky Note44",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5888,
        2304
      ],
      "parameters": {
        "width": 660,
        "height": 240,
        "content": "This prevents the creation of duplicates in Notion, by storing a special flag in Redis containing the Todoist ID"
      }
    },
    {
      "id": "9ed4ce34-b4c0-4803-9c4a-74ec6dc062a1",
      "name": "Sticky Note54",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        992,
        4528
      ],
      "parameters": {
        "width": 188,
        "height": 280,
        "content": "Using the event type from Todoist is the only option to actually recognize, if a task was deleted"
      }
    },
    {
      "id": "01ffa6f9-3403-4971-bd16-ebc5c5371771",
      "name": "Sticky Note55",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4160,
        4496
      ],
      "parameters": {
        "width": 220,
        "height": 280,
        "content": "The mapping is more advanced and also includes fall-back values for edge-cases"
      }
    },
    {
      "id": "80caae41-5897-4dc9-9057-c84b00db76ce",
      "name": "Sticky Note60",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4832,
        4496
      ],
      "parameters": {
        "width": 220,
        "height": 280,
        "content": "Previous node always returns output data, since it uses a filter to retrieve a matching item"
      }
    },
    {
      "id": "8e4cdbc4-817d-4975-9cac-8060ebe2bd28",
      "name": "Sticky Note61",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        7664,
        2304
      ],
      "parameters": {
        "width": 220,
        "height": 240,
        "content": "Store more information, which was not available earlier"
      }
    },
    {
      "id": "8f0df50d-950b-4251-b326-24950a49c7a2",
      "name": "Sticky Note62",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        9984,
        4304
      ],
      "parameters": {
        "width": 220,
        "height": 280,
        "content": "The Notion ID is being cached in Redis for 15 seconds, so the other Diff sync does not get triggered."
      }
    },
    {
      "id": "8959fafd-ee6d-4cd0-9798-7d0d596f4c96",
      "name": "Sticky Note63",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5872,
        6240
      ],
      "parameters": {
        "width": 940,
        "height": 304,
        "content": "**Delete Notion page** if Todoist task has been deleted"
      }
    },
    {
      "id": "c17dc3e0-4688-4454-a8b7-f525bc531456",
      "name": "Sticky Note64",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6336,
        6256
      ],
      "parameters": {
        "width": 220,
        "height": 260,
        "content": "Store more information, which was not available earlier"
      }
    },
    {
      "id": "ba9aa684-e05d-4118-aee6-2a43a6725f9d",
      "name": "End here1",
      "type": "n8n-nodes-base.noOp",
      "position": [
        3280,
        4592
      ]
    },
    {
      "id": "8386b48c-ee02-42af-abf8-257ad7d9501a",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        3152,
        4704
      ]
    },
    {
      "id": "2432b777-8af8-474e-af98-254fe56a5e83",
      "name": "Catch known error",
      "type": "n8n-nodes-base.if",
      "position": [
        2880,
        4608
      ]
    },
    {
      "id": "2e5a3809-8c87-498e-80be-d939e726e8b6",
      "name": "If tries left",
      "type": "n8n-nodes-base.if",
      "position": [
        2176,
        4672
      ]
    },
    {
      "id": "2ac68b41-e5e5-4417-bd5c-62ee415ced4d",
      "name": "Retry limit reached",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        2384,
        4688
      ]
    },
    {
      "id": "06d394c0-5d7d-4798-a0ca-09ffedcca2f8",
      "name": "Sticky Note45",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        8112,
        2304
      ],
      "parameters": {
        "width": 220,
        "height": 240,
        "content": "Overwrite description with Notion URL"
      }
    },
    {
      "id": "93b63943-00e6-44e2-b721-5cafc5039acd",
      "name": "Turn Markdown into Notion Blocks2",
      "type": "n8n-nodes-base.code",
      "position": [
        7728,
        2128
      ]
    },
    {
      "id": "01150a0b-77f1-4c01-a78c-cd1862f4f16f",
      "name": "Handle each block separately2",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        7952,
        2128
      ]
    },
    {
      "id": "839841e2-40d6-4f32-a62c-ad3e6e7434a9",
      "name": "Append Notion Block2",
      "type": "n8n-nodes-base.notion",
      "position": [
        8176,
        2128
      ]
    },
    {
      "id": "eeea44d4-135d-4a27-9969-3d54a570a765",
      "name": "Sticky Note46",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        7664,
        2048
      ],
      "parameters": {
        "width": 660,
        "height": 240,
        "content": "Copy task description initially to Notion, before it get's replaced in Todoist by the Notion URL"
      }
    },
    {
      "id": "9e181778-5ff9-483f-8ee3-debc6efe6b74",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        7888,
        2304
      ],
      "parameters": {
        "width": 220,
        "height": 240,
        "content": "Store more information, which was not available earlier"
      }
    },
    {
      "id": "372c9011-dc53-4a5a-94d3-be63e4e9eb8d",
      "name": "Update task in Notion",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        7088,
        3904
      ]
    },
    {
      "id": "22828897-2217-4ddc-8c4a-6941519ecd44",
      "name": "Create task in Notion1",
      "type": "n8n-nodes-base.noOp",
      "position": [
        7488,
        2384
      ]
    },
    {
      "id": "491ae343-55bb-4b36-bb8b-75bcadca46c4",
      "name": "Update task in Notion4",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        7088,
        4032
      ]
    },
    {
      "id": "c79ed5df-eb12-44f8-88c3-a9d287f86113",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2112,
        4448
      ],
      "parameters": {
        "width": 1496,
        "height": 456,
        "content": "Todoist webhooks can arrive late. To ensure the data is up to date, the payload must be retrieved again. Triggers on deletion can overlap, thus try 3 times, then just stop.\nUsing advanced retry logic,"
      }
    },
    {
      "id": "52aa03c3-d146-450a-befe-ba16bdef27c0",
      "name": "Execution Data9",
      "type": "n8n-nodes-base.executionData",
      "position": [
        384,
        4640
      ]
    },
    {
      "id": "c7e1befb-f6b1-45dc-a6d1-ee20bcf12dea",
      "name": "Sticky Note65",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        4528
      ],
      "parameters": {
        "width": 220,
        "height": 280,
        "content": "Store relevant information in highlighted execution data, in case of debugging"
      }
    },
    {
      "id": "494bacd3-c7d7-444d-a738-83c85f191ffe",
      "name": "If event is not deleted1",
      "type": "n8n-nodes-base.if",
      "position": [
        1040,
        4640
      ]
    },
    {
      "id": "d7da5574-5ad5-42c0-a3fa-afe08351a5bf",
      "name": "Sticky Note66",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        96,
        4448
      ],
      "parameters": {
        "width": 220,
        "height": 360,
        "content": "## Set Globals\nUse Sync Setup Helper Workflow to generate the JSON and paste it in every Globals Nodes\n"
      }
    },
    {
      "id": "0604da8f-a4e0-44f8-b20a-525695c4e4ee",
      "name": "Sticky Note68",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -336,
        4448
      ],
      "parameters": {
        "width": 220,
        "height": 360,
        "content": "## Register Webhook in Todoist App\nGrab the URL from here and add it to the Todosit developer app as described in the setup instructions\n"
      }
    },
    {
      "id": "f0800a46-41e6-4856-87b5-3d65130e86d8",
      "name": "Get many database pages1",
      "type": "n8n-nodes-base.notion",
      "position": [
        4672,
        4608
      ]
    },
    {
      "id": "b4ce7da3-5bc3-446f-838d-032a326f2ee2",
      "name": "Sticky Note69",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        9984,
        4032
      ],
      "parameters": {
        "width": 220,
        "height": 280,
        "content": "The Notion ID is being cached in Redis for 15 seconds, so the other Diff sync does not get triggered."
      }
    },
    {
      "id": "29f83518-853d-4adc-80e1-72d72fd80b85",
      "name": "Url",
      "type": "n8n-nodes-base.code",
      "position": [
        7952,
        2384
      ]
    },
    {
      "id": "a4e33fa0-3683-4898-b920-00c7f6ffd274",
      "name": "Todoist Trigger1",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -64,
        4640
      ]
    },
    {
      "id": "c39919c4-4c03-4b45-8378-4d30037a0c53",
      "name": "Update task in Notion5",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        7088,
        4160
      ]
    },
    {
      "id": "8e9fc76f-5315-473d-bbb4-b1a790c4ebfe",
      "name": "Create task in Notion Refference1",
      "type": "n8n-nodes-base.noOp",
      "position": [
        7344,
        4032
      ]
    },
    {
      "id": "23332f6f-1349-40ac-9d4d-10beb69d20ae",
      "name": "Differences exist3",
      "type": "n8n-nodes-base.filter",
      "position": [
        6832,
        4032
      ]
    },
    {
      "id": "a2edaac9-05f9-4a8a-8bf1-3aab7f06015e",
      "name": "Turn Markdown into Notion Blocks3",
      "type": "n8n-nodes-base.code",
      "position": [
        6832,
        4432
      ]
    },
    {
      "id": "1a9a3208-3a1c-4f2d-a480-b23fb88dc444",
      "name": "Handle each block separately3",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        7008,
        4432
      ]
    },
    {
      "id": "2318938a-1a46-4a03-8d7d-1db5290ea01e",
      "name": "Append Notion Block3",
      "type": "n8n-nodes-base.notion",
      "position": [
        7184,
        4432
      ]
    },
    {
      "id": "9357b310-34fb-4e37-88c7-a55ef964781b",
      "name": "Sticky Note47",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6800,
        4384
      ],
      "parameters": {
        "width": 676,
        "height": 208,
        "content": "Copy task description initially to Notion, before it get's replaced in Todoist by the Notion URL"
      }
    },
    {
      "id": "2027fbec-d843-4977-a5f9-7b19a5677b17",
      "name": "Link or Content?1",
      "type": "n8n-nodes-base.switch",
      "position": [
        6528,
        4432
      ]
    },
    {
      "id": "fce780cc-8fd9-4ad7-92fc-553c0a4f969e",
      "name": "Differences exist4",
      "type": "n8n-nodes-base.filter",
      "position": [
        6832,
        4160
      ]
    },
    {
      "id": "db751bf9-8488-497f-bb9f-61e227e2063c",
      "name": "Differences exist5",
      "type": "n8n-nodes-base.filter",
      "position": [
        6832,
        3904
      ]
    },
    {
      "id": "56d5ae7a-bd4f-487a-b5fa-54dd2ffa2dee",
      "name": "Update Description in Todoist6",
      "type": "n8n-nodes-base.todoist",
      "position": [
        7344,
        4432
      ]
    },
    {
      "id": "28f2965b-65c7-4154-943a-1ce3892e94e5",
      "name": "Map Todoist to Notion1",
      "type": "n8n-nodes-base.code",
      "position": [
        4224,
        4608
      ]
    },
    {
      "id": "f739ac58-5985-4e59-90a2-626503e5b9d9",
      "name": "GlobalsT1",
      "type": "n8n-nodes-base.set",
      "position": [
        160,
        4640
      ]
    },
    {
      "id": "11a78427-de87-446d-9482-769db8c57fc8",
      "name": "SwitchT3",
      "type": "n8n-nodes-base.switch",
      "position": [
        6928,
        2000
      ]
    },
    {
      "id": "942b9bc3-5eae-41ab-85e7-18b1ec2e3a5b",
      "name": "SwitchT4",
      "type": "n8n-nodes-base.switch",
      "position": [
        6528,
        4016
      ]
    },
    {
      "id": "6394f95b-98db-4258-9fdf-3765d40f11c4",
      "name": "Create task in NotionT6",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        7104,
        2128
      ]
    },
    {
      "id": "6abf5d79-06a5-4177-bc7e-e6e467d893b3",
      "name": "Create task in NotionT7",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        7104,
        2016
      ]
    },
    {
      "id": "6ba43f1c-0ce5-4e05-b45d-afe35e11d508",
      "name": "Create task in NotionT8",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        7104,
        1888
      ]
    },
    {
      "id": "8fd9fd90-5f92-45bf-a186-0bb4d1980dae",
      "name": "Update tries",
      "type": "n8n-nodes-base.set",
      "position": [
        3440,
        4704
      ]
    },
    {
      "id": "a6e77fa6-4205-49a4-b863-e65e464e416a",
      "name": "Set tries",
      "type": "n8n-nodes-base.set",
      "position": [
        2304,
        4544
      ]
    },
    {
      "id": "eeaf4eaf-f404-464f-9095-f09974b4818a",
      "name": "Get Todoist Task",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2624,
        4544
      ]
    },
    {
      "id": "00a7011c-4fb0-490b-a02d-8891fe1d0221",
      "name": "Update Description in Todoist1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        8176,
        2384
      ]
    },
    {
      "id": "91fa2527-2ba1-418a-a2cb-6dbbc2af68c1",
      "name": "Notion Task not found1",
      "type": "n8n-nodes-base.if",
      "position": [
        4880,
        4608
      ]
    },
    {
      "id": "b083e902-a107-4a9e-af2c-20a17ea7d539",
      "name": "Mark as not Done in Notion1",
      "type": "n8n-nodes-base.notion",
      "position": [
        7184,
        4752
      ]
    },
    {
      "id": "71769c9a-df79-4518-9616-3ad8e41fef1b",
      "name": "Has not been completed?1",
      "type": "n8n-nodes-base.if",
      "position": [
        6816,
        4640
      ]
    },
    {
      "id": "8c2c7faa-a9ca-476a-9351-903b09249b08",
      "name": "Require Completion?1",
      "type": "n8n-nodes-base.switch",
      "position": [
        6528,
        4688
      ]
    },
    {
      "id": "ab30e1b4-0e02-45b6-bc46-b31105e0d929",
      "name": "Update Due in Notion when recurring1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        6816,
        4784
      ]
    },
    {
      "id": "a983cbf0-3c09-41ce-b622-86e07ec20b67",
      "name": "Lock Todoist ID",
      "type": "n8n-nodes-base.redis",
      "position": [
        10048,
        4144
      ]
    },
    {
      "id": "7332fa1d-df28-4dd5-94de-3a3f090b758d",
      "name": "Lock Notion ID",
      "type": "n8n-nodes-base.redis",
      "position": [
        10048,
        4416
      ]
    },
    {
      "id": "a24125db-6911-448a-8c70-5e947535cebb",
      "name": "Get many database pages",
      "type": "n8n-nodes-base.notion",
      "position": [
        6720,
        2432
      ]
    },
    {
      "id": "7285b10e-61e7-4760-9ea7-02293cee49e7",
      "name": "Create task in NotionT",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        7104,
        2304
      ]
    },
    {
      "id": "10914044-3e2b-47a1-a678-cf235f076a82",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        4336
      ],
      "parameters": {
        "width": 1536,
        "height": 560,
        "content": "#Processing Data Coming from webhooks"
      }
    },
    {
      "id": "ba8011a5-578d-47bd-b8fb-9609ffe377d3",
      "name": "Verify security token",
      "type": "n8n-nodes-base.if",
      "position": [
        288,
        1392
      ]
    },
    {
      "id": "09f60d21-882c-4ea6-81c9-1909e35f23d9",
      "name": "Get variables",
      "type": "n8n-nodes-base.code",
      "position": [
        64,
        1392
      ]
    },
    {
      "id": "c054dbc4-d903-4f3f-90f2-088f2f994ba1",
      "name": "Exchange Tokens",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        512,
        1328
      ]
    },
    {
      "id": "8d5603e7-0e26-456c-afdc-58867b03c713",
      "name": "Respond with success",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        736,
        1280
      ]
    },
    {
      "id": "c1a9abba-8326-495c-9ea7-c77cddc26d37",
      "name": "Respond with error",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        736,
        1488
      ]
    },
    {
      "id": "ef97d01c-722b-4ae8-a49b-d47558c64a3c",
      "name": "OAuth redirect",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -160,
        1392
      ]
    },
    {
      "id": "798918a0-a485-4e54-b205-c5d2aacf5c83",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        -96
      ],
      "parameters": {
        "width": 1008,
        "height": 560,
        "content": "# 0. Start here\n### Notion\n- A database must already exist (get a basic template [here](https://steadfast-banjo-d1f.notion.site/17682b476c848086b002de766879aa71)) with the following properties (case m"
      }
    },
    {
      "id": "43b7d610-0f77-4dba-ab02-01cebfc77877",
      "name": "Get projects",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        896,
        656
      ]
    },
    {
      "id": "4a493a61-4c49-4b9f-9bd7-5dc957f5e4ee",
      "name": "Get sections",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1776,
        656
      ]
    },
    {
      "id": "721d9599-ce3e-47a5-ad2c-6ef5cfa764ca",
      "name": "Get Notion Databases",
      "type": "n8n-nodes-base.notion",
      "position": [
        32,
        656
      ]
    },
    {
      "id": "2a42b5b6-f035-40d2-b391-9e1b9c271542",
      "name": "Prep Dropdown",
      "type": "n8n-nodes-base.code",
      "position": [
        256,
        656
      ]
    },
    {
      "id": "34f792b0-8c06-4eec-87b0-350408b46851",
      "name": "Prep Dropdown1",
      "type": "n8n-nodes-base.code",
      "position": [
        1104,
        656
      ]
    },
    {
      "id": "c92a0468-e02b-4fd4-a589-4d40baba3d04",
      "name": "Generate config",
      "type": "n8n-nodes-base.code",
      "position": [
        2192,
        656
      ]
    },
    {
      "id": "0f6566fb-8d92-45fc-9347-826ea125db5e",
      "name": "Choose Notion Database",
      "type": "n8n-nodes-base.form",
      "position": [
        480,
        656
      ]
    },
    {
      "id": "6bec9d32-c1d4-4f3c-99c2-b81afb2e6f2e",
      "name": "Choose Todoist Project",
      "type": "n8n-nodes-base.form",
      "position": [
        1328,
        656
      ]
    },
    {
      "id": "03fc4820-6708-460d-9fc8-3b011c156d76",
      "name": "Get Notion Database ID",
      "type": "n8n-nodes-base.code",
      "position": [
        688,
        656
      ]
    },
    {
      "id": "86632401-df19-4262-b1e3-a340ee58123a",
      "name": "Get Todoist Project ID",
      "type": "n8n-nodes-base.code",
      "position": [
        1552,
        656
      ]
    },
    {
      "id": "c9ea15c9-35fb-485f-9041-b35f38b0345a",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -192,
        656
      ]
    },
    {
      "id": "2cb99bb9-03cd-4ee5-9af7-809326a96823",
      "name": "Form",
      "type": "n8n-nodes-base.form",
      "position": [
        2400,
        656
      ]
    },
    {
      "id": "1a451ac6-f37c-45d5-a78c-6f5cc31bca49",
      "name": "Generate security token",
      "type": "n8n-nodes-base.crypto",
      "position": [
        64,
        1056
      ]
    },
    {
      "id": "aec2d265-781e-4334-bfd3-22702bd9a655",
      "name": "Store variables",
      "type": "n8n-nodes-base.code",
      "position": [
        288,
        1056
      ]
    },
    {
      "id": "f6435ad8-95dd-49f9-8d79-e9d41b1f23be",
      "name": "Redirect to Auth Page",
      "type": "n8n-nodes-base.form",
      "position": [
        512,
        1056
      ]
    },
    {
      "id": "a9315bc1-c278-478a-8a89-5b0265d7d2f0",
      "name": "Todoist Webhook Setup Helper",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -160,
        1056
      ]
    },
    {
      "id": "1c2c7b83-5469-4b7c-b65d-55fc507f253e",
      "name": "Choose Timezone",
      "type": "n8n-nodes-base.form",
      "position": [
        1984,
        656
      ]
    },
    {
      "id": "7f743ebd-5a89-43f3-895e-edb75c159298",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        544
      ],
      "parameters": {
        "width": 2832,
        "height": 320,
        "content": "# 1. Generate config JSON for Globals Nodes"
      }
    },
    {
      "id": "b739ff69-fd6c-46d7-ab71-1bf249d7c6af",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        928
      ],
      "parameters": {
        "width": 1152,
        "height": 720,
        "content": "\n# 2. Activate Todoist Webhook"
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "SwitchT3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get many database pages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Url": {
      "main": [
        [
          {
            "node": "Update Description in Todoist1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Update tries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SwitchT": {
      "main": [
        [
          {
            "node": "Create task in NotionT",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create task in NotionT5",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create task in NotionT4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SwitchT3": {
      "main": [
        [
          {
            "node": "Create task in NotionT8",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create task in NotionT7",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create task in NotionT6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SwitchT4": {
      "main": [
        [
          {
            "node": "Differences exist5",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Differences exist3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Differences exist4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GlobalsT1": {
      "main": [
        [
          {
            "node": "Execution Data9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set tries": {
      "main": [
        [
          {
            "node": "Get Todoist Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get projects": {
      "main": [
        [
          {
            "node": "Prep Dropdown1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get sections": {
      "main": [
        [
          {
            "node": "Choose Timezone",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update tries": {
      "main": [
        [
          {
            "node": "If tries left",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get variables": {
      "main": [
        [
          {
            "node": "Verify security token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If tries left": {
      "main": [
        [
          {
            "node": "Set tries",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Retry limit reached",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prep Dropdown": {
      "main": [
        [
          {
            "node": "Choose Notion Database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OAuth redirect": {
      "main": [
        [
          {
            "node": "Get variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prep Dropdown1": {
      "main": [
        [
          {
            "node": "Choose Todoist Project",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Choose Timezone": {
      "main": [
        [
          {
            "node": "Generate config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Exchange Tokens": {
      "main": [
        [
          {
            "node": "Respond with success",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Respond with error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execution Data5": {
      "main": [
        [
          {
            "node": "Get many database pages1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execution Data6": {
      "main": [
        [
          {
            "node": "Url",
            "type": "main",
            "index": 0
          },
          {
            "node": "Lock Notion ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execution Data7": {
      "main": [
        [
          {
            "node": "Switch by Event1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execution Data8": {
      "main": [
        [
          {
            "node": "Mark as Obsolete in Notion1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execution Data9": {
      "main": [
        [
          {
            "node": "Check if Todoist ID is locked1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate config": {
      "main": [
        [
          {
            "node": "Form",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Notion Task": {
      "main": [
        [
          {
            "node": "Notion Task found",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store variables": {
      "main": [
        [
          {
            "node": "Redirect to Auth Page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Todoist Task": {
      "main": [
        [
          {
            "node": "Map Todoist to Notion1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Catch known error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch by Event1": {
      "main": [
        [
          {
            "node": "Link or Content?1",
            "type": "main",
            "index": 0
          },
          {
            "node": "SwitchT4",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Require Completion?1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Require Completion?1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Todoist Trigger1": {
      "main": [
        [
          {
            "node": "GlobalsT1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Todoist Webhook1": {
      "main": [
        [
          {
            "node": "Todoist Trigger1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Catch known error": {
      "main": [
        [
          {
            "node": "End here1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Link or Content?1": {
      "main": [
        [
          {
            "node": "Turn Markdown into Notion Blocks3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notion Task found": {
      "main": [
        [
          {
            "node": "Execution Data8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set creating flag": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Differences exist3": {
      "main": [
        [
          {
            "node": "Update task in Notion4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Differences exist4": {
      "main": [
        [
          {
            "node": "Update task in Notion5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Differences exist5": {
      "main": [
        [
          {
            "node": "Update task in Notion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Get Notion Databases",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append Notion Block2": {
      "main": [
        [
          {
            "node": "Lock Notion ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append Notion Block3": {
      "main": [
        [
          {
            "node": "Update Description in Todoist6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Notion Databases": {
      "main": [
        [
          {
            "node": "Prep Dropdown",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Require Completion?1": {
      "main": [
        [
          {
            "node": "Has not been completed?1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update Due in Notion when recurring1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update task in Notion": {
      "main": [
        [
          {
            "node": "Create task in Notion Refference1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Verify security token": {
      "main": [
        [
          {
            "node": "Exchange Tokens",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Respond with error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Choose Notion Database": {
      "main": [
        [
          {
            "node": "Get Notion Database ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Choose Todoist Project": {
      "main": [
        [
          {
            "node": "Get Todoist Project ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create task in Notion1": {
      "main": [
        [
          {
            "node": "Execution Data6",
            "type": "main",
            "index": 0
          },
          {
            "node": "Turn Markdown into Notion Blocks2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create task in NotionT": {
      "main": [
        [
          {
            "node": "Create task in Notion1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Notion Database ID": {
      "main": [
        [
          {
            "node": "Get projects",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Todoist Project ID": {
      "main": [
        [
          {
            "node": "Get sections",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Map Todoist to Notion1": {
      "main": [
        [
          {
            "node": "Execution Data5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notion Task not found1": {
      "main": [
        [
          {
            "node": "Check if creating flag exists",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Execution Data7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update task in Notion4": {
      "main": [
        [
          {
            "node": "Create task in Notion Refference1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update task in Notion5": {
      "main": [
        [
          {
            "node": "Create task in Notion Refference1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create task in NotionT4": {
      "main": [
        [
          {
            "node": "Create task in Notion1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create task in NotionT5": {
      "main": [
        [
          {
            "node": "Create task in Notion1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create task in NotionT6": {
      "main": [
        [
          {
            "node": "Create task in Notion1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create task in NotionT7": {
      "main": [
        [
          {
            "node": "Create task in Notion1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create task in NotionT8": {
      "main": [
        [
          {
            "node": "Create task in Notion1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate security token": {
      "main": [
        [
          {
            "node": "Store variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many database pages": {
      "main": [
        [
          {
            "node": "SwitchT",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark as Done in Notion1": {
      "main": [
        [
          {
            "node": "Lock Notion ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many database pages1": {
      "main": [
        [
          {
            "node": "Notion Task not found1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has not been completed?1": {
      "main": [
        [
          {
            "node": "Mark as Done in Notion1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Mark as not Done in Notion1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If event is not deleted1": {
      "main": [
        [
          {
            "node": "Set tries",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Notion Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark as Obsolete in Notion1": {
      "main": [
        [
          {
            "node": "Lock Notion ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Only continue if not locked1": {
      "main": [
        [
          {
            "node": "If event is not deleted1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Todoist Webhook Setup Helper": {
      "main": [
        [
          {
            "node": "Generate security token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if creating flag exists": {
      "main": [
        [
          {
            "node": "Only continue if flag does not exist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Handle each block separately2": {
      "main": [
        [
          {
            "node": "Append Notion Block2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Handle each block separately3": {
      "main": [
        [
          {
            "node": "Append Notion Block3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if Todoist ID is locked1": {
      "main": [
        [
          {
            "node": "Only continue if not locked1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Description in Todoist1": {
      "main": [
        [
          {
            "node": "Lock Todoist ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Description in Todoist6": {
      "main": [
        [
          {
            "node": "Lock Todoist ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create task in Notion Refference1": {
      "main": [
        [
          {
            "node": "Lock Notion ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Turn Markdown into Notion Blocks2": {
      "main": [
        [
          {
            "node": "Handle each block separately2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Turn Markdown into Notion Blocks3": {
      "main": [
        [
          {
            "node": "Handle each block separately3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Only continue if flag does not exist": {
      "main": [
        [
          {
            "node": "Set creating flag",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Due in Notion when recurring1": {
      "main": [
        [
          {
            "node": "Lock Notion ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}