{
  "name": "Sync tasks between Notion and Todoist in both directions with Redis",
  "nodes": [
    {
      "id": "6d2c347e-0f99-46ca-814d-41591d67b339",
      "name": "Has been completed?2",
      "type": "n8n-nodes-base.if",
      "position": [
        3760,
        16256
      ]
    },
    {
      "id": "03358d46-ee0c-4ab9-a71b-63e4fd448986",
      "name": "Only continue if not locked3",
      "type": "n8n-nodes-base.filter",
      "position": [
        976,
        16752
      ]
    },
    {
      "id": "edb0e1aa-dd1c-4489-be9d-76c7132ad269",
      "name": "Check if Notion ID is locked2",
      "type": "n8n-nodes-base.redis",
      "position": [
        752,
        16752
      ]
    },
    {
      "id": "436f3883-48f7-4d05-9894-ca039a2df11c",
      "name": "Get Notion task2",
      "type": "n8n-nodes-base.notion",
      "position": [
        1200,
        16752
      ]
    },
    {
      "id": "e45cc5b7-8502-4a36-8ccf-7ca803ad0a12",
      "name": "Check if creating flag exists3",
      "type": "n8n-nodes-base.redis",
      "position": [
        3920,
        16880
      ]
    },
    {
      "id": "a32c470d-fcc9-4cc1-920e-b4f421cbe0cd",
      "name": "Only continue if flag does not exist3",
      "type": "n8n-nodes-base.filter",
      "position": [
        4128,
        16880
      ]
    },
    {
      "id": "aa1b4d65-7ce7-4608-9743-f7acd5c5a91d",
      "name": "Set creating flag3",
      "type": "n8n-nodes-base.redis",
      "position": [
        4320,
        16880
      ]
    },
    {
      "id": "4a804851-f3e0-4b3c-8b1a-e601f62e074e",
      "name": "Todoist ID exists?2",
      "type": "n8n-nodes-base.if",
      "position": [
        2096,
        16752
      ]
    },
    {
      "id": "443d12b9-e6f1-42b3-8eaa-b45a066e0902",
      "name": "Get todoist ID4",
      "type": "n8n-nodes-base.set",
      "position": [
        4288,
        16256
      ]
    },
    {
      "id": "22f4d0cc-d538-4957-9890-c4da4aad1c66",
      "name": "Todoist ID exists2",
      "type": "n8n-nodes-base.filter",
      "position": [
        3648,
        15744
      ]
    },
    {
      "id": "9f49048e-5122-4c59-b309-5300cec6fd90",
      "name": "Get todoist ID5",
      "type": "n8n-nodes-base.set",
      "position": [
        4288,
        15744
      ]
    },
    {
      "id": "775827ef-151d-4987-9617-7d7726e6865e",
      "name": "Status is not Done2",
      "type": "n8n-nodes-base.filter",
      "position": [
        3664,
        16720
      ]
    },
    {
      "id": "b54b3195-c9eb-4822-b396-abebff98fa16",
      "name": "Mark as Completed in Todoist2",
      "type": "n8n-nodes-base.todoist",
      "position": [
        3904,
        16160
      ]
    },
    {
      "id": "bc05aaf9-0d16-4d54-9b40-2bdd00aa7558",
      "name": "Update task in Todoist2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3904,
        15984
      ]
    },
    {
      "id": "33e1d27d-1da7-4484-a118-a2f8080ee642",
      "name": "Mark as Incomplete in Todoist2",
      "type": "n8n-nodes-base.todoist",
      "position": [
        3904,
        16320
      ]
    },
    {
      "id": "69aa7795-12ce-4282-99f3-794eeb95712a",
      "name": "Lock Todoist ID5",
      "type": "n8n-nodes-base.redis",
      "position": [
        5488,
        16128
      ]
    },
    {
      "id": "ce543935-618f-48df-b766-9d15c5d9c196",
      "name": "Delete Task in Todoist3",
      "type": "n8n-nodes-base.todoist",
      "position": [
        3904,
        15744
      ]
    },
    {
      "id": "31f15117-77e5-4d7f-a6c6-c49fe2c3ee7e",
      "name": "Create task in Todoist2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4544,
        16880
      ]
    },
    {
      "id": "c9aaa540-b1b3-4884-9f81-447be03c6f1f",
      "name": "Execution Data10",
      "type": "n8n-nodes-base.executionData",
      "position": [
        1648,
        16752
      ]
    },
    {
      "id": "b7aec9bb-e88c-493a-b780-a5a42aad43b4",
      "name": "Sticky Note77",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3584,
        15616
      ],
      "parameters": {
        "width": 852,
        "height": 300,
        "content": "**Delete the task** if it does not fit into the filter anymore"
      }
    },
    {
      "id": "d2cdbd35-b726-47c9-a708-e82f375fdf6d",
      "name": "Sticky Note78",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3584,
        15936
      ],
      "parameters": {
        "width": 852,
        "height": 624,
        "content": "**Update the task** if it needs to be changed   "
      }
    },
    {
      "id": "5d28c45b-a753-4daf-9bb0-96232606e8c3",
      "name": "Sticky Note79",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1136,
        16656
      ],
      "parameters": {
        "width": 220,
        "height": 280,
        "content": "Notion tries to deliver webhooks again. To ensure the data is up to date, the payload must be retrieved again."
      }
    },
    {
      "id": "cb5d267d-23e3-455a-99f7-5043fd0ee799",
      "name": "Sticky Note81",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3776,
        15664
      ],
      "parameters": {
        "width": 220,
        "height": 240,
        "content": "Continues on error, so it is not necessary to retrieve task beforehand"
      }
    },
    {
      "id": "604e77ba-9183-4bff-8800-510a93244ec8",
      "name": "Sticky Note82",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        16656
      ],
      "parameters": {
        "width": 220,
        "height": 280,
        "content": "Following nodes reference to this node, so the trigger can easily be replaced"
      }
    },
    {
      "id": "349a1b02-bb45-439d-bb18-8e0eaee45d78",
      "name": "Sticky Note83",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        464,
        16656
      ],
      "parameters": {
        "width": 220,
        "height": 280,
        "content": "Store relevant information in highlighted execution data, in case of debugging"
      }
    },
    {
      "id": "f7edc270-27f6-49f6-bff2-3145b1169f71",
      "name": "Sticky Note84",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1584,
        16656
      ],
      "parameters": {
        "width": 220,
        "height": 280,
        "content": "Store more information, which was not available earlier"
      }
    },
    {
      "id": "49c45513-ab8a-4bb9-8655-2d5827d395d7",
      "name": "Sticky Note85",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1808,
        16656
      ],
      "parameters": {
        "width": 220,
        "height": 280,
        "content": ""
      }
    },
    {
      "id": "a47983a7-680a-4789-8f4d-3a5c8ab096f7",
      "name": "Sticky Note86",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3856,
        16800
      ],
      "parameters": {
        "width": 612,
        "height": 260,
        "content": "In rare cases Notion fires multiple webhooks within a short period of time, when creating a new task. This prevents the creation of duplicates in Todoist."
      }
    },
    {
      "id": "c0650569-87bd-4c1b-a08a-cc4356b7e8b5",
      "name": "Sticky Note87",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1360,
        16656
      ],
      "parameters": {
        "width": 220,
        "height": 280,
        "content": "The mapping is more advanced and also includes fall-back values for edge-cases"
      }
    },
    {
      "id": "2ab9d46c-0e93-457b-bfb8-a8499a235536",
      "name": "Sticky Note89",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2032,
        16656
      ],
      "parameters": {
        "width": 220,
        "height": 280,
        "content": "The mapping between the Notion and Todoist tasks is stored in Notion"
      }
    },
    {
      "id": "cd45982f-d32f-4ea1-aaf8-19ae0076e8fa",
      "name": "Sticky Note16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5424,
        16000
      ],
      "parameters": {
        "width": 220,
        "height": 280,
        "content": "The Todoist ID is being cached in Redis for 15 seconds, so the other Diff sync does not get triggered."
      }
    },
    {
      "id": "4c2ad6e3-4384-4965-84cc-3a9514309c6e",
      "name": "Sticky Note17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3584,
        16576
      ],
      "parameters": {
        "width": 1308,
        "height": 516,
        "content": "**Create task** if it does not exist (anymore)"
      }
    },
    {
      "id": "99d3ad62-c2bc-4b2d-9ab9-182fe88d2be4",
      "name": "Sticky Note91",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2256,
        16656
      ],
      "parameters": {
        "width": 1320,
        "height": 432,
        "content": "Retrieve Todoist task, which can be completed or deleted at this point.\nUsing advanced retry logic, since the \"Get many tasks\" endpoint does not return completed tasks."
      }
    },
    {
      "id": "f8cb5557-0afd-44d1-aafa-6dd7dd2f1272",
      "name": "Retry limit reached3",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        2752,
        16896
      ]
    },
    {
      "id": "5ffc5e8f-9248-47a8-8b21-4c36e503d029",
      "name": "Wait3",
      "type": "n8n-nodes-base.wait",
      "position": [
        3184,
        16896
      ]
    },
    {
      "id": "88ac8aec-58de-4d1c-b698-568ade2b2616",
      "name": "Catch known error3",
      "type": "n8n-nodes-base.if",
      "position": [
        2960,
        16768
      ]
    },
    {
      "id": "58dbc51f-95dc-42a9-ba11-6a646953ce1b",
      "name": "If tries left3",
      "type": "n8n-nodes-base.if",
      "position": [
        2560,
        16896
      ]
    },
    {
      "id": "1c205719-92a8-4c4c-8d5d-10521f2080a6",
      "name": "Is Deleted?1",
      "type": "n8n-nodes-base.if",
      "position": [
        1872,
        16752
      ]
    },
    {
      "id": "7d973e36-0d2c-4347-b780-ad70c1a4eee0",
      "name": "Sticky Note92",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        688,
        16656
      ],
      "parameters": {
        "width": 440,
        "height": 280,
        "content": "Checking for a cached flag in Redis, to prevent overrides and endless loops."
      }
    },
    {
      "id": "ba5efa65-fbb7-440a-b78d-cc846dfaeb50",
      "name": "Sticky Note93",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3600,
        16640
      ],
      "parameters": {
        "width": 220,
        "height": 240,
        "content": "Edge case: the task has been moved from Obsolete to Done"
      }
    },
    {
      "id": "c3b7de05-17d1-4db6-9933-32bfc2b1eda1",
      "name": "Sticky Note88",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        16592
      ],
      "parameters": {
        "width": 220,
        "height": 344,
        "content": "## Notion Webhook\nGrab the webhook URL and use it in the Notion automation. If using the NotionWebhookEmulator instead, replace this node with the nodes shown below."
      }
    },
    {
      "id": "2dd58deb-8bd0-4d53-b004-ad49b695d056",
      "name": "Sticky Note90",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        16592
      ],
      "parameters": {
        "width": 220,
        "height": 344,
        "content": "## Set Globals\nUse Sync Setup Helper Workflow to generate the JSON and paste it in every Globals Nodes"
      }
    },
    {
      "id": "fbaaf1c5-3f61-40d7-8d96-ea258cacdb6a",
      "name": "Notion Trigger",
      "type": "n8n-nodes-base.noOp",
      "position": [
        64,
        16752
      ]
    },
    {
      "id": "a0b7210b-de27-4970-a6ae-3d53d1ea03ff",
      "name": "Lock Todoist ID6",
      "type": "n8n-nodes-base.redis",
      "position": [
        5488,
        16448
      ]
    },
    {
      "id": "9b5e889d-0516-42f1-a6a0-126763f77354",
      "name": "Sticky Note80",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5424,
        16320
      ],
      "parameters": {
        "width": 220,
        "height": 280,
        "content": "The Todoist ID is being cached in Redis for 15 seconds, so the other Diff sync does not get triggered."
      }
    },
    {
      "id": "c84ded26-3d53-49e9-a469-6bac0ae15a07",
      "name": "Map Notion to Todoist",
      "type": "n8n-nodes-base.code",
      "position": [
        1424,
        16752
      ]
    },
    {
      "id": "22698f2d-bea4-457c-b92c-607efa97f30d",
      "name": "GlobalsN",
      "type": "n8n-nodes-base.set",
      "position": [
        304,
        16752
      ]
    },
    {
      "id": "e0b218ce-b531-4a1e-8b62-9eae4f47a6b7",
      "name": "Notion Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -144,
        16752
      ]
    },
    {
      "id": "9084a0c6-cff4-4177-8b25-7dd221dcac5a",
      "name": "Update tries2",
      "type": "n8n-nodes-base.set",
      "position": [
        3376,
        16896
      ]
    },
    {
      "id": "e9449def-7b96-49da-80d2-b63ec651784c",
      "name": "Set tries2",
      "type": "n8n-nodes-base.set",
      "position": [
        2432,
        16736
      ]
    },
    {
      "id": "ef147fb7-a567-464c-a05e-3e0e45414222",
      "name": "Store Todoist ID",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4752,
        16960
      ]
    },
    {
      "id": "40908513-6458-45b5-8f47-405e6e915771",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        3648,
        16144
      ]
    },
    {
      "id": "e4bd5848-ad4c-431f-9220-6870441d256f",
      "name": "Get Todoist Task3",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2736,
        16736
      ]
    },
    {
      "id": "37929dcd-48a9-48b6-94a6-50366f5f203a",
      "name": "Filter",
      "type": "n8n-nodes-base.filter",
      "position": [
        4096,
        16080
      ]
    },
    {
      "id": "1aec0326-8386-47d8-8f6b-bf74bdeff741",
      "name": "Update Notion",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4288,
        16080
      ]
    },
    {
      "id": "cbb737af-7c08-4573-8fa5-f5b0f29cbcc7",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3168,
        16160
      ],
      "parameters": {
        "width": 2752,
        "height": 320,
        "content": "# 1. Generate config JSON for Globals Nodes"
      }
    },
    {
      "id": "6e0619d7-8e33-44d1-8937-aae13bf84cd0",
      "name": "Verify security token1",
      "type": "n8n-nodes-base.if",
      "position": [
        -2640,
        16944
      ]
    },
    {
      "id": "b6f610ec-09a8-41ad-98f8-e55c770a3380",
      "name": "Get variables1",
      "type": "n8n-nodes-base.code",
      "position": [
        -2864,
        16944
      ]
    },
    {
      "id": "e31415ea-7178-4749-959e-9818f74d1ae4",
      "name": "Exchange Tokens1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2416,
        16880
      ]
    },
    {
      "id": "72db1e28-786f-41b9-8e80-283c370a7cf1",
      "name": "Respond with success1",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -2192,
        16832
      ]
    },
    {
      "id": "ea1c1a3c-ce9a-45ed-9aa9-7e862d3715ae",
      "name": "Respond with error1",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -2192,
        17040
      ]
    },
    {
      "id": "3a7e36ea-9ef9-43ef-bd6b-dc44fc86a679",
      "name": "OAuth redirect1",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -3088,
        16944
      ]
    },
    {
      "id": "fe59fc24-94e4-423f-9773-bab2afefdaa2",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3168,
        16480
      ],
      "parameters": {
        "width": 1152,
        "height": 720,
        "content": "\n# 2. Activate Todoist Webhook"
      }
    },
    {
      "id": "06079fb9-79af-495a-a3b7-b04025cae0c0",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3168,
        15600
      ],
      "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": "2b70e5db-7e05-4bb9-a4a2-2c2bb9d8b7c1",
      "name": "Get projects1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2032,
        16272
      ]
    },
    {
      "id": "f6530df3-ceba-41e9-a104-6da568400a95",
      "name": "Get sections1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1152,
        16272
      ]
    },
    {
      "id": "399ae7e3-1c2b-43e2-86a2-b9c8ed86df7f",
      "name": "Get Notion Databases1",
      "type": "n8n-nodes-base.notion",
      "position": [
        -2896,
        16272
      ]
    },
    {
      "id": "6a3c3cf0-dcc4-496a-945c-cd920086471b",
      "name": "Prep Dropdown2",
      "type": "n8n-nodes-base.code",
      "position": [
        -2672,
        16272
      ]
    },
    {
      "id": "ed95d163-1af6-4024-b06a-da62e8d67d29",
      "name": "Prep Dropdown3",
      "type": "n8n-nodes-base.code",
      "position": [
        -1824,
        16272
      ]
    },
    {
      "id": "7fa03e90-2c15-47ff-89dc-bd9577fc1b63",
      "name": "Generate config1",
      "type": "n8n-nodes-base.code",
      "position": [
        -736,
        16272
      ]
    },
    {
      "id": "338b22c9-2a20-421d-8bb1-748fe5c42f44",
      "name": "Choose Notion Database1",
      "type": "n8n-nodes-base.form",
      "position": [
        -2448,
        16272
      ]
    },
    {
      "id": "9978b743-370b-4c3e-a082-c7e6a860d53b",
      "name": "Choose Todoist Project1",
      "type": "n8n-nodes-base.form",
      "position": [
        -1600,
        16272
      ]
    },
    {
      "id": "e6679b9f-afb9-4435-bae7-4ef8bc4fcae1",
      "name": "Get Notion Database ID1",
      "type": "n8n-nodes-base.code",
      "position": [
        -2240,
        16272
      ]
    },
    {
      "id": "17d80134-7345-4866-b1ab-b4e89206fa1a",
      "name": "Get Todoist Project ID1",
      "type": "n8n-nodes-base.code",
      "position": [
        -1376,
        16272
      ]
    },
    {
      "id": "460fe318-2928-41fb-982b-f61fdf3bc504",
      "name": "On form submission1",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -3120,
        16272
      ]
    },
    {
      "id": "c9814fc9-5ada-42af-a466-003e3ec89549",
      "name": "Form1",
      "type": "n8n-nodes-base.form",
      "position": [
        -528,
        16272
      ]
    },
    {
      "id": "18a67ea2-9dd5-4878-8d8c-f6879312e4e3",
      "name": "Generate security token1",
      "type": "n8n-nodes-base.crypto",
      "position": [
        -2864,
        16608
      ]
    },
    {
      "id": "29576f4d-c051-47d3-889d-32eacd4fb152",
      "name": "Store variables1",
      "type": "n8n-nodes-base.code",
      "position": [
        -2640,
        16608
      ]
    },
    {
      "id": "5074b2e3-e9b5-45e2-9143-36d9c870e724",
      "name": "Redirect to Auth Page1",
      "type": "n8n-nodes-base.form",
      "position": [
        -2416,
        16608
      ]
    },
    {
      "id": "b199da1c-cfd0-41da-8a1f-fd2cc7e92b09",
      "name": "Todoist Webhook Setup Helper1",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -3088,
        16608
      ]
    },
    {
      "id": "9897d60f-ef22-4fd1-b4b4-e4db80d351ca",
      "name": "Execution Data",
      "type": "n8n-nodes-base.executionData",
      "position": [
        528,
        16752
      ]
    },
    {
      "id": "8d44d5ea-88cd-4380-a627-cf442204785b",
      "name": "Differences exist",
      "type": "n8n-nodes-base.filter",
      "position": [
        3760,
        15984
      ]
    },
    {
      "id": "a8bbeb7e-9046-45cd-a42f-0ab4436e418e",
      "name": "Choose Timezone1",
      "type": "n8n-nodes-base.form",
      "position": [
        -944,
        16272
      ]
    },
    {
      "id": "cc3654e1-d9fa-43f9-91a2-9e33e2c3a554",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2240,
        16544
      ],
      "parameters": {
        "width": 1344,
        "height": 592,
        "content": "## Todoist Task Checker"
      }
    },
    {
      "id": "25bab817-3f49-4c48-9738-a0c7dbfd3653",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        16544
      ],
      "parameters": {
        "width": 1744,
        "height": 560,
        "content": "#Processing Data Coming from webhooks"
      }
    }
  ],
  "connections": {
    "Wait3": {
      "main": [
        [
          {
            "node": "Update tries2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter": {
      "main": [
        [
          {
            "node": "Update Notion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Differences exist",
            "type": "main",
            "index": 0
          },
          {
            "node": "Has been completed?2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GlobalsN": {
      "main": [
        [
          {
            "node": "Execution Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set tries2": {
      "main": [
        [
          {
            "node": "Get Todoist Task3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Deleted?1": {
      "main": [
        [
          {
            "node": "Todoist ID exists2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Todoist ID exists?2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get projects1": {
      "main": [
        [
          {
            "node": "Prep Dropdown3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get sections1": {
      "main": [
        [
          {
            "node": "Choose Timezone1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update tries2": {
      "main": [
        [
          {
            "node": "If tries left3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execution Data": {
      "main": [
        [
          {
            "node": "Check if Notion ID is locked2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get variables1": {
      "main": [
        [
          {
            "node": "Verify security token1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If tries left3": {
      "main": [
        [
          {
            "node": "Set tries2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Retry limit reached3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notion Trigger": {
      "main": [
        [
          {
            "node": "GlobalsN",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notion Webhook": {
      "main": [
        [
          {
            "node": "Notion Trigger",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prep Dropdown2": {
      "main": [
        [
          {
            "node": "Choose Notion Database1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prep Dropdown3": {
      "main": [
        [
          {
            "node": "Choose Todoist Project1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get todoist ID4": {
      "main": [
        [
          {
            "node": "Lock Todoist ID5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get todoist ID5": {
      "main": [
        [
          {
            "node": "Lock Todoist ID5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OAuth redirect1": {
      "main": [
        [
          {
            "node": "Get variables1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Choose Timezone1": {
      "main": [
        [
          {
            "node": "Generate config1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Exchange Tokens1": {
      "main": [
        [
          {
            "node": "Respond with success1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Respond with error1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execution Data10": {
      "main": [
        [
          {
            "node": "Is Deleted?1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate config1": {
      "main": [
        [
          {
            "node": "Form1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Notion task2": {
      "main": [
        [
          {
            "node": "Map Notion to Todoist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store Todoist ID": {
      "main": [
        [
          {
            "node": "Lock Todoist ID6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store variables1": {
      "main": [
        [
          {
            "node": "Redirect to Auth Page1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Differences exist": {
      "main": [
        [
          {
            "node": "Update task in Todoist2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Todoist Task3": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Catch known error3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Catch known error3": {
      "main": [
        [
          {
            "node": "Status is not Done2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set creating flag3": {
      "main": [
        [
          {
            "node": "Create task in Todoist2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Todoist ID exists2": {
      "main": [
        [
          {
            "node": "Delete Task in Todoist3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission1": {
      "main": [
        [
          {
            "node": "Get Notion Databases1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Status is not Done2": {
      "main": [
        [
          {
            "node": "Check if creating flag exists3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Todoist ID exists?2": {
      "main": [
        [
          {
            "node": "Set tries2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Check if creating flag exists3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has been completed?2": {
      "main": [
        [
          {
            "node": "Mark as Completed in Todoist2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Mark as Incomplete in Todoist2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Notion Databases1": {
      "main": [
        [
          {
            "node": "Prep Dropdown2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Map Notion to Todoist": {
      "main": [
        [
          {
            "node": "Execution Data10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Verify security token1": {
      "main": [
        [
          {
            "node": "Exchange Tokens1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Respond with error1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Choose Notion Database1": {
      "main": [
        [
          {
            "node": "Get Notion Database ID1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Choose Todoist Project1": {
      "main": [
        [
          {
            "node": "Get Todoist Project ID1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create task in Todoist2": {
      "main": [
        [
          {
            "node": "Lock Todoist ID5",
            "type": "main",
            "index": 0
          },
          {
            "node": "Store Todoist ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete Task in Todoist3": {
      "main": [
        [
          {
            "node": "Get todoist ID5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Notion Database ID1": {
      "main": [
        [
          {
            "node": "Get projects1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Todoist Project ID1": {
      "main": [
        [
          {
            "node": "Get sections1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update task in Todoist2": {
      "main": [
        [
          {
            "node": "Get todoist ID4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate security token1": {
      "main": [
        [
          {
            "node": "Store variables1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Only continue if not locked3": {
      "main": [
        [
          {
            "node": "Get Notion task2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if Notion ID is locked2": {
      "main": [
        [
          {
            "node": "Only continue if not locked3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark as Completed in Todoist2": {
      "main": [
        [
          {
            "node": "Get todoist ID4",
            "type": "main",
            "index": 0
          },
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Todoist Webhook Setup Helper1": {
      "main": [
        [
          {
            "node": "Generate security token1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if creating flag exists3": {
      "main": [
        [
          {
            "node": "Only continue if flag does not exist3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark as Incomplete in Todoist2": {
      "main": [
        [
          {
            "node": "Get todoist ID4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Only continue if flag does not exist3": {
      "main": [
        [
          {
            "node": "Set creating flag3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}