{
  "name": "Host your own AI deep research agent with n8n, Apify and OpenAI o3",
  "nodes": [
    {
      "id": "a342005e-a88e-419b-b929-56ecbba4a936",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1300,
        1180
      ]
    },
    {
      "id": "126b8151-6d20-43b8-8028-8163112c4c5b",
      "name": "Set Variables",
      "type": "n8n-nodes-base.set",
      "position": [
        -1360,
        -460
      ]
    },
    {
      "id": "1d0fb87b-263d-46c2-b016-a29ba1d407ab",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1120,
        1180
      ]
    },
    {
      "id": "39b300d9-11ba-44f6-8f43-2fe256fe4856",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -860,
        1760
      ]
    },
    {
      "id": "018da029-a796-45c5-947c-791e087fe934",
      "name": "OpenAI Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1060,
        -300
      ]
    },
    {
      "id": "525da936-a9eb-4523-b27a-ff6ae7b0e5ef",
      "name": "Structured Output Parser1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -840,
        -300
      ]
    },
    {
      "id": "e6664883-cff4-4e09-881e-6b6f684f9cac",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -1760,
        -460
      ]
    },
    {
      "id": "6b8ebc08-c0b1-4af8-99cc-79d09eea7316",
      "name": "Generate SERP Queries",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -1040,
        820
      ]
    },
    {
      "id": "34e1fa5d-bc0c-4b9e-84a7-35db2b08c772",
      "name": "Structured Output Parser2",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -860,
        980
      ]
    },
    {
      "id": "be6dd6a2-aacf-4682-8f13-8ae24c4249a3",
      "name": "OpenAI Chat Model3",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1040,
        980
      ]
    },
    {
      "id": "d5ce6e21-cd07-44fa-b6d0-90bf7531ee01",
      "name": "Set Initial Query",
      "type": "n8n-nodes-base.set",
      "position": [
        -580,
        180
      ]
    },
    {
      "id": "9de6e4a1-a2b5-4a6f-948e-a0585edcae48",
      "name": "SERP to Items",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -700,
        820
      ]
    },
    {
      "id": "2c9c4cdf-942b-494c-83fb-ed5ec37385ee",
      "name": "Item Ref",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -220,
        1020
      ]
    },
    {
      "id": "703c57af-de19-4f00-b580-711a272fa5ca",
      "name": "Research Goal + Learnings",
      "type": "n8n-nodes-base.set",
      "position": [
        1460,
        1160
      ]
    },
    {
      "id": "16ed2835-3af4-45e3-b5a7-e4342d571aa0",
      "name": "Accumulate Results",
      "type": "n8n-nodes-base.set",
      "position": [
        -200,
        180
      ]
    },
    {
      "id": "0011773e-85c6-4fe1-8554-c23ce50706d0",
      "name": "DeepResearch Results",
      "type": "n8n-nodes-base.set",
      "position": [
        160,
        360
      ]
    },
    {
      "id": "c0b646d0-1246-4864-8f79-8b7a66e4e083",
      "name": "Results to Items",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        320,
        360
      ]
    },
    {
      "id": "3c52ec3e-c952-4b5f-ab12-f1b5d02aba74",
      "name": "Set Next Queries",
      "type": "n8n-nodes-base.set",
      "position": [
        480,
        360
      ]
    },
    {
      "id": "bc59dddc-2b03-481f-91c6-ea8aa378eef0",
      "name": "For Each Query...",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -420,
        860
      ]
    },
    {
      "id": "903c31c4-5fdc-4cb6-8baa-402555997266",
      "name": "Feedback to Items",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -720,
        -460
      ]
    },
    {
      "id": "59ff671d-5d4f-42ff-b94f-ed30a8531e55",
      "name": "Ask Clarity Questions",
      "type": "n8n-nodes-base.form",
      "position": [
        -360,
        -380
      ]
    },
    {
      "id": "1c2cf79b-f1a1-4ecc-bb45-3d4460c947bd",
      "name": "For Each Question...",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -540,
        -460
      ]
    },
    {
      "id": "0c9ffa99-2687-4df5-8581-0c5b0b2657a9",
      "name": "DeepResearch Subworkflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -1880,
        820
      ]
    },
    {
      "id": "127ab95d-bf89-4762-bfb5-34521e620ae2",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1140,
        -680
      ],
      "parameters": {
        "width": 1000,
        "height": 560,
        "content": "## 2. Ask Clarifying Questions\n[Read more about form nodes](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.form/)\n\nTo handle the clarification questions generated by the LLM, I use"
      }
    },
    {
      "id": "e87c0f19-6002-4aa2-931a-ca7546146a84",
      "name": "Clarifying Questions",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -1040,
        -460
      ]
    },
    {
      "id": "b84f9c4a-c1de-4288-bab2-b7f5ffb8b542",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -660,
        -60
      ],
      "parameters": {
        "width": 1360,
        "height": 640,
        "content": "## 6. Perform DeepSearch Loop\n[Learn more about the Looping in n8n](https://docs.n8n.io/flow-logic/looping/#creating-loops)\n\nThe key of the Deep Research flow is its extensive data collection capabili"
      }
    },
    {
      "id": "0a8c3a01-d4d4-4075-9521-035b7df9aa5a",
      "name": "End Form",
      "type": "n8n-nodes-base.form",
      "position": [
        960,
        -420
      ]
    },
    {
      "id": "44a3603f-a5a1-4031-8c5f-c748b1007b47",
      "name": "Initiate DeepResearch",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        600,
        -420
      ]
    },
    {
      "id": "b243eb76-9ed9-4327-968f-c21844bc9df4",
      "name": "Execution Data",
      "type": "n8n-nodes-base.executionData",
      "position": [
        -1700,
        820
      ]
    },
    {
      "id": "57ca4b22-9349-4b34-8f6b-c502905b5172",
      "name": "JobType Router",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1520,
        820
      ]
    },
    {
      "id": "1f880fbd-71ba-4e5b-8d99-9654ae0c949f",
      "name": "OpenAI Chat Model4",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -20,
        -280
      ]
    },
    {
      "id": "ea65589b-106f-4ff1-a6f2-763393c2cb07",
      "name": "Get Initial Query",
      "type": "n8n-nodes-base.set",
      "position": [
        -360,
        -540
      ]
    },
    {
      "id": "09a363f2-6300-430d-8c7e-3e1611ab8e68",
      "name": "Structured Output Parser4",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        160,
        -280
      ]
    },
    {
      "id": "9910804e-8376-4e2e-a011-7d32ca951edf",
      "name": "Create Row",
      "type": "n8n-nodes-base.notion",
      "position": [
        300,
        -420
      ]
    },
    {
      "id": "9f06d9ae-220d-4f5b-bcbf-761b88ba255c",
      "name": "Report Page Generator",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -20,
        -420
      ]
    },
    {
      "id": "5b434bdc-e1e7-4348-b03d-dcbb6a485263",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -120,
        -680
      ],
      "parameters": {
        "width": 600,
        "height": 560,
        "content": "## 3. Create Empty Report Page in Notion\n[Read more about the Notion node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.notion/)\n\nSome thought was given where to upload the final "
      }
    },
    {
      "id": "0cfb3548-14a8-4dcc-8362-a7ca1d4c328f",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        500,
        -680
      ],
      "parameters": {
        "width": 640,
        "height": 560,
        "content": "## 4. Trigger DeepResearch Asynchronously\n[Learn more about the Execute Trigger node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflow/)\n\nn8n handles asynchronous job"
      }
    },
    {
      "id": "b90456d0-fae3-4809-bc13-55649e6e919a",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1160,
        620
      ],
      "parameters": {
        "width": 620,
        "height": 540,
        "content": "## 7. Generate Search Queries\n[Learn more about the Basic LLM node](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainllm/)\n\nMuch like a human researcher, the "
      }
    },
    {
      "id": "9fd00d55-1c76-425b-8386-7bc5b2bb47ac",
      "name": "Is Depth Reached?",
      "type": "n8n-nodes-base.if",
      "position": [
        -40,
        180
      ]
    },
    {
      "id": "f658537b-4f4c-4427-a66f-56cfd950bffc",
      "name": "Get Research Results",
      "type": "n8n-nodes-base.set",
      "position": [
        160,
        180
      ]
    },
    {
      "id": "6059f3ba-e4a0-4528-894c-6080eedb91c3",
      "name": "Get Existing Row",
      "type": "n8n-nodes-base.notion",
      "position": [
        -1040,
        180
      ]
    },
    {
      "id": "100625bb-bf9a-4993-b387-1c61e486ba6d",
      "name": "Set In-Progress",
      "type": "n8n-nodes-base.notion",
      "position": [
        -840,
        180
      ]
    },
    {
      "id": "864332ea-dd25-4347-a49d-68ed6495c1a9",
      "name": "Set Done",
      "type": "n8n-nodes-base.notion",
      "position": [
        1680,
        1600
      ]
    },
    {
      "id": "6771568a-e6bd-4c89-a535-089fd1c18fc3",
      "name": "Tags to Items",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -60,
        1600
      ]
    },
    {
      "id": "47fce580-7b5b-4bc6-ba52-a8e7af6595b5",
      "name": "Convert to HTML",
      "type": "n8n-nodes-base.markdown",
      "position": [
        -380,
        1600
      ]
    },
    {
      "id": "e2fb5a31-9ca5-487b-a7f8-f020759ec53a",
      "name": "HTML to Array",
      "type": "n8n-nodes-base.set",
      "position": [
        -220,
        1600
      ]
    },
    {
      "id": "5275f9dd-5420-4c59-a330-5f2775b47e51",
      "name": "Notion Block Generator",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        100,
        1600
      ]
    },
    {
      "id": "30e73ecf-5994-4229-b7f6-01e043e0e65b",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        80,
        1760
      ]
    },
    {
      "id": "85ce9f7e-0369-41bd-8c31-c4217f400472",
      "name": "Parse JSON blocks",
      "type": "n8n-nodes-base.set",
      "position": [
        420,
        1600
      ]
    },
    {
      "id": "349f4323-d65f-4845-accc-6f51340a84c4",
      "name": "Upload to Notion Page",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1680,
        1760
      ]
    },
    {
      "id": "44c732a9-b805-432e-8e9c-ba279e4cca46",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -520,
        620
      ],
      "parameters": {
        "width": 1340,
        "height": 740,
        "content": "## 8. Web Search and Extracting Web Page Contents using [APIFY.com](https://www.apify.com?fpr=414q6)\n[Read more about the HTTP Request node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nod"
      }
    },
    {
      "id": "daf2e775-72d3-4366-882b-8c9eb65f11e8",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1140,
        60
      ],
      "parameters": {
        "width": 460,
        "height": 360,
        "content": "## 5. Set Report to In-Progress\n[Read more about the Notion node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.notion/)"
      }
    },
    {
      "id": "2d1b394d-8b9a-43fc-a646-c4e05c92da5b",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        860,
        780
      ],
      "parameters": {
        "width": 800,
        "height": 580,
        "content": "## 9. Compile Learnings with Reasoning Model\n[Read more about the Basic LLM node](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainllm/)\n\nWith our gathered so"
      }
    },
    {
      "id": "e2c29aa2-ff79-4bdd-b3c7-cf5e5866db8a",
      "name": "Get Existing Row1",
      "type": "n8n-nodes-base.notion",
      "position": [
        -1020,
        1600
      ]
    },
    {
      "id": "9dff368e-c282-4fef-8894-e218ea266695",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1140,
        1400
      ],
      "parameters": {
        "width": 660,
        "height": 540,
        "content": "## 10. Generate DeepSearch Report using Learnings\n[Read more about the Basic LLM node](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainllm/)\n\nFinally! After "
      }
    },
    {
      "id": "14bfd0fd-6bc4-4dbf-86b2-44ef1c3586f7",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -460,
        1400
      ],
      "parameters": {
        "width": 1060,
        "height": 540,
        "content": "## 11. Reformat Report as Notion Blocks\n[Learn more about the Markdown node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.markdown/)\n\nTo write our report to our Notion page, we'l"
      }
    },
    {
      "id": "a2aff56d-78b9-40a4-ac78-bd8380802ea0",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1220,
        1400
      ],
      "parameters": {
        "width": 800,
        "height": 580,
        "content": "## 13. Update Report in Notion\n[Read more about the HTTP request node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/)\n\nIn this step, we can use the Notion API to add "
      }
    },
    {
      "id": "b5beeccd-e498-48ed-b6f2-b29d4599e2c9",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1840,
        -680
      ],
      "parameters": {
        "width": 680,
        "height": 560,
        "content": "## 1. Let's Research!\n[Learn more about the form trigger node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.formtrigger)\n\nn8n forms are a really nice way to get our frontend up a"
      }
    },
    {
      "id": "533ede84-1138-426c-93df-c2b862e2d063",
      "name": "DeepResearch Report",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -860,
        1600
      ]
    },
    {
      "id": "efe47725-7fd5-45e7-97c4-d6c133745e5f",
      "name": "DeepResearch Learnings",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1120,
        1020
      ]
    },
    {
      "id": "d3b42d13-e8ca-4085-ace9-1d9fb53f5e71",
      "name": "Generate Report",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        480,
        180
      ]
    },
    {
      "id": "2b0314ff-cd82-4b3b-a4a9-5fd8067391eb",
      "name": "Generate Learnings",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        -380,
        180
      ]
    },
    {
      "id": "f4457d0b-d708-4bca-9973-46d96ed55826",
      "name": "Confirmation",
      "type": "n8n-nodes-base.form",
      "position": [
        780,
        -420
      ]
    },
    {
      "id": "af8fe17a-4314-4e92-ad8e-8be0be62984b",
      "name": "Research Request",
      "type": "n8n-nodes-base.form",
      "position": [
        -1560,
        -460
      ]
    },
    {
      "id": "c67a5e5c-f82b-4e8a-9c99-065d16dfa576",
      "name": "Valid Blocks",
      "type": "n8n-nodes-base.filter",
      "position": [
        740,
        1600
      ]
    },
    {
      "id": "b89cf700-d955-4de4-bbac-b5c55995a1ee",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        620,
        1400
      ],
      "parameters": {
        "width": 580,
        "height": 580,
        "content": "## 12. Append URL Sources List\n[Read more about the Code node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.code)\n\nFor our source URLs, we'll manually compose the Notion blocks f"
      }
    },
    {
      "id": "70c898a1-a757-452d-83ef-de1998fe13ae",
      "name": "Append Blocks",
      "type": "n8n-nodes-base.merge",
      "position": [
        1000,
        1760
      ]
    },
    {
      "id": "591a3fcd-1748-43f7-9766-bc2059c195a0",
      "name": "URL Sources to Lists",
      "type": "n8n-nodes-base.code",
      "position": [
        740,
        1760
      ]
    },
    {
      "id": "e59dbeea-ccf3-4619-9fe1-24874a91bdab",
      "name": "Empty Response",
      "type": "n8n-nodes-base.set",
      "position": [
        640,
        1160
      ]
    },
    {
      "id": "34035b2e-eee9-483e-8125-3b6f1f41cd1d",
      "name": "Has Content?",
      "type": "n8n-nodes-base.if",
      "position": [
        480,
        1020
      ]
    },
    {
      "id": "5e9f80e2-db58-4f89-8aec-a1b8e73e18eb",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1820,
        -240
      ],
      "parameters": {
        "width": 300,
        "height": 100,
        "content": "### Not using forms?\nFeel free ot swap this out for chat or even webhooks to fit your existing workflows."
      }
    },
    {
      "id": "3e513463-2f4c-4e3e-921d-e5c8ea5ec078",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1880,
        540
      ],
      "parameters": {
        "width": 460,
        "height": 240,
        "content": "### 🚏 The Subworkflow Event Pattern \nIf you're new to n8n, this advanced technique might need some explaining but in gist, we're using subworkflows to run different parts of our DeepResearcher workflo"
      }
    },
    {
      "id": "fea2568e-86c9-4663-b141-a9b2a36b84f5",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        -60
      ],
      "parameters": {
        "width": 340,
        "height": 200,
        "content": "### Recursive Looping\nThe recursive looping implemented for this workflow is an advanced item-linking technique. It works by specifically controlling which nodes \"execute once\" vs\" execute for each it"
      }
    },
    {
      "id": "fd3fec73-4b1a-4882-8c5a-d4825d9038ad",
      "name": "Combine & Send back to Loop",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -220,
        860
      ]
    },
    {
      "id": "7c183897-e2ce-46da-90bd-0a39122b85f2",
      "name": "For Each Block...",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1440,
        1600
      ]
    },
    {
      "id": "bc04462a-780c-48e9-bc38-8eaf8ac1175c",
      "name": "Sticky Note16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2420,
        -920
      ],
      "parameters": {
        "width": 520,
        "height": 1060,
        "content": "## n8n DeepResearcher\n### This template attempts to replicate OpenAI's DeepResearch feature which, at time of writing, is only available to their pro subscribers.\n\nThough the inner workings of DeepRes"
      }
    },
    {
      "id": "654362c8-bc85-47d1-b277-50630f6f3999",
      "name": "Sticky Note17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2420,
        -1180
      ],
      "parameters": {
        "width": 520,
        "height": 240,
        "content": "![](https://res.cloudinary.com/daglih2g8/image/upload/f_auto,q_auto/v1/n8n-workflows/o4wqztloz3j6okfxpeyw#full-width)"
      }
    },
    {
      "id": "c2ddbec3-4579-4d4e-81bf-293c9eee9b73",
      "name": "Sticky Note18",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        1000
      ],
      "parameters": {
        "width": 180,
        "height": 260,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n### UPDATE APIFY CREDENTIAL HERE!"
      }
    },
    {
      "id": "43461d7d-1a04-424a-b2b0-4a4cbc46f1c2",
      "name": "Sticky Note20",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1640,
        1740
      ],
      "parameters": {
        "width": 180,
        "height": 260,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n### UPDATE NOTION CREDENTIAL HERE!"
      }
    },
    {
      "id": "48b83b0f-94e7-44e2-8bd4-0addddd62264",
      "name": "Valid Results",
      "type": "n8n-nodes-base.filter",
      "position": [
        300,
        1020
      ]
    },
    {
      "id": "6124becb-2584-472d-8354-b714d9f1e858",
      "name": "RAG Web Browser",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -40,
        1020
      ]
    },
    {
      "id": "749a5d4d-85ae-4ee3-a79b-6659af666a3a",
      "name": "Get Markdown + URL",
      "type": "n8n-nodes-base.set",
      "position": [
        940,
        1020
      ]
    },
    {
      "id": "4a5ad2e4-b274-4a2f-bc0f-15d067ad469c",
      "name": "Is Apify Auth Error?",
      "type": "n8n-nodes-base.if",
      "position": [
        140,
        1020
      ]
    },
    {
      "id": "54118cbc-6466-448d-8832-91ad62a931e2",
      "name": "Stop and Error",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        300,
        860
      ]
    },
    {
      "id": "aae46fd1-70bc-4629-8a47-6ae75ce8afb1",
      "name": "Sticky Note19",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -460,
        1960
      ],
      "parameters": {
        "width": 560,
        "height": 300,
        "content": "### Self-hosting n8n? Consider using one of these to upload to Notion!\nThis template uses an LLM to convert markdown to Notion which isn't the most efficient but it's \"easier\" because doesn't require "
      }
    }
  ],
  "connections": {
    "Item Ref": {
      "main": [
        [
          {
            "node": "RAG Web Browser",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Row": {
      "main": [
        [
          {
            "node": "Initiate DeepResearch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Confirmation": {
      "main": [
        [
          {
            "node": "End Form",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has Content?": {
      "main": [
        [
          {
            "node": "Get Markdown + URL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Empty Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Valid Blocks": {
      "main": [
        [
          {
            "node": "Append Blocks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append Blocks": {
      "main": [
        [
          {
            "node": "For Each Block...",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTML to Array": {
      "main": [
        [
          {
            "node": "Tags to Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SERP to Items": {
      "main": [
        [
          {
            "node": "For Each Query...",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Variables": {
      "main": [
        [
          {
            "node": "Clarifying Questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tags to Items": {
      "main": [
        [
          {
            "node": "Notion Block Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Valid Results": {
      "main": [
        [
          {
            "node": "Has Content?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Empty Response": {
      "main": [
        [
          {
            "node": "For Each Query...",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execution Data": {
      "main": [
        [
          {
            "node": "JobType Router",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "JobType Router": {
      "main": [
        [
          {
            "node": "Get Existing Row",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Generate SERP Queries",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Existing Row1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to HTML": {
      "main": [
        [
          {
            "node": "HTML to Array",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RAG Web Browser": {
      "main": [
        [
          {
            "node": "Is Apify Auth Error?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set In-Progress": {
      "main": [
        [
          {
            "node": "Set Initial Query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Existing Row": {
      "main": [
        [
          {
            "node": "Set In-Progress",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Research Request": {
      "main": [
        [
          {
            "node": "Set Variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Results to Items": {
      "main": [
        [
          {
            "node": "Set Next Queries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Next Queries": {
      "main": [
        [
          {
            "node": "Generate Learnings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Feedback to Items": {
      "main": [
        [
          {
            "node": "For Each Question...",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "For Each Block...": {
      "main": [
        [
          {
            "node": "Set Done",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Upload to Notion Page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "For Each Query...": {
      "main": [
        [
          {
            "node": "Combine & Send back to Loop",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Item Ref",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Existing Row1": {
      "main": [
        [
          {
            "node": "DeepResearch Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Initial Query": {
      "main": [
        [
          {
            "node": "Report Page Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Depth Reached?": {
      "main": [
        [
          {
            "node": "Get Research Results",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "DeepResearch Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "DeepResearch Learnings",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Parse JSON blocks": {
      "main": [
        [
          {
            "node": "Valid Blocks",
            "type": "main",
            "index": 0
          },
          {
            "node": "URL Sources to Lists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Initial Query": {
      "main": [
        [
          {
            "node": "Generate Learnings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Accumulate Results": {
      "main": [
        [
          {
            "node": "Is Depth Reached?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Learnings": {
      "main": [
        [
          {
            "node": "Accumulate Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Markdown + URL": {
      "main": [
        [
          {
            "node": "DeepResearch Learnings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Research Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "DeepResearch Report",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Clarifying Questions",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model3": {
      "ai_languageModel": [
        [
          {
            "node": "Generate SERP Queries",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model4": {
      "ai_languageModel": [
        [
          {
            "node": "Report Page Generator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "DeepResearch Report": {
      "main": [
        [
          {
            "node": "Convert to HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clarifying Questions": {
      "main": [
        [
          {
            "node": "Feedback to Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DeepResearch Results": {
      "main": [
        [
          {
            "node": "Results to Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "For Each Question...": {
      "main": [
        [
          {
            "node": "Get Initial Query",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Ask Clarity Questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Research Results": {
      "main": [
        [
          {
            "node": "Generate Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Apify Auth Error?": {
      "main": [
        [
          {
            "node": "Stop and Error",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Valid Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "URL Sources to Lists": {
      "main": [
        [
          {
            "node": "Append Blocks",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Ask Clarity Questions": {
      "main": [
        [
          {
            "node": "For Each Question...",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate SERP Queries": {
      "main": [
        [
          {
            "node": "SERP to Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initiate DeepResearch": {
      "main": [
        [
          {
            "node": "Confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Report Page Generator": {
      "main": [
        [
          {
            "node": "Create Row",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Notion Page": {
      "main": [
        [
          {
            "node": "For Each Block...",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "DeepResearch Learnings": {
      "main": [
        [
          {
            "node": "Research Goal + Learnings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notion Block Generator": {
      "main": [
        [
          {
            "node": "Parse JSON blocks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DeepResearch Subworkflow": {
      "main": [
        [
          {
            "node": "Execution Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Notion Block Generator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "DeepResearch Learnings",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Research Goal + Learnings": {
      "main": [
        [
          {
            "node": "For Each Query...",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "Clarifying Questions",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser2": {
      "ai_outputParser": [
        [
          {
            "node": "Generate SERP Queries",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser4": {
      "ai_outputParser": [
        [
          {
            "node": "Report Page Generator",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}