{
"meta": {
"instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "645ae2b1-799e-49be-8bdf-12cd1bb739e6",
"name": "Structured Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
1680,
1140
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"learnings\": {\n \"type\": \"array\",\n \"description\": \"List of learnings, max of 3.\",\n \"items\": { \"type\": \"string\" }\n },\n \"followUpQuestions\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"description\": \"List of follow-up questions to research the topic further, max of 3.\"\n }\n }\n }\n}"
},
"typeVersion": 1.2
},
{
"id": "cbdb4e98-eeba-4609-91de-394c416b7904",
"name": "Set Variables",
"type": "n8n-nodes-base.set",
"position": [
-1360,
-460
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "df28b12e-7c20-4ff5-b5b8-dc773aa14d4b",
"name": "request_id",
"type": "string",
"value": "={{ $execution.id }}"
},
{
"id": "9362c1e7-717d-444a-8ea2-6b5f958c9f3f",
"name": "prompt",
"type": "string",
"value": "={{ $json['What would you like to research?'] }}"
},
{
"id": "09094be4-7844-4a9e-af82-cc8e39322398",
"name": "depth",
"type": "number",
"value": "={{ $json['Enter research depth (recommended 1-5, default 2)'] || 2 }}"
},
{
"id": "3fc30a30-7806-4013-835d-97e27ddd7ae1",
"name": "breadth",
"type": "number",
"value": "={{ $json['Enter research breadth (recommended 2-10, default 4)'] || 4 }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "c7096ab9-0b10-45b0-b178-a049bf57830b",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1500,
1140
],
"parameters": {
"model": {
"__rl": true,
"mode": "id",
"value": "o3-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "d0f1bc2f-6a10-4ac7-8d35-34f48f14fad5",
"name": "OpenAI Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-860,
1760
],
"parameters": {
"model": {
"__rl": true,
"mode": "id",
"value": "o3-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "bba3278c-0336-4305-887d-56515dfd87db",
"name": "OpenAI Chat Model2",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-1060,
-300
],
"parameters": {
"model": {
"__rl": true,
"mode": "id",
"value": "o3-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "f31f2fc7-0bec-4105-9d83-5f4f9a0eb35d",
"name": "Structured Output Parser1",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
-840,
-300
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"questions\": {\n \"type\": \"array\",\n \"description\": \"Follow up questions to clarify the research direction, max of 3.\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n}"
},
"typeVersion": 1.2
},
{
"id": "ea59c5ab-fa05-4c68-bc60-3f56e240478b",
"name": "On form submission",
"type": "n8n-nodes-base.formTrigger",
"position": [
-1760,
-460
],
"webhookId": "7ddfaa7c-a523-4d92-b033-d76cd5a313e9",
"parameters": {
"options": {
"path": "deep_research",
"ignoreBots": true,
"buttonLabel": "Next"
},
"formTitle": " DeepResearcher",
"formFields": {
"values": [
{
"fieldType": "html",
"fieldLabel": "placeholder"
}
]
},
"formDescription": "=DeepResearcher is a multi-step, recursive approach using the internet to solve complex research tasks, accomplishing in tens of minutes what a human would take many hours.\n\nTo use, provide a short summary of what the research and how \"deep\" you'd like the workflow to investigate. Note, the higher the numbers the more time and cost will occur for the research.\n\nThe workflow is designed to complete independently and when finished, a report will be saved in a designated Notion Database."
},
"typeVersion": 2.2
},
{
"id": "a8262288-a8c1-4967-9870-f728fa08b579",
"name": "Generate SERP Queries",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
-1040,
820
],
"parameters": {
"text": "=Given the following prompt from the user, generate a list of SERP queries to research the topic. Return a maximum of {{ $('JobType Router').first().json.data.breadth }} queries, but feel free to return less if the original prompt is clear. Make sure each query is unique and not similar to each other: \n
\nAnswer the following clarification questions to assist the DeepResearcher better under the research topic.\n
\n\nTotal {{ $('Feedback to Items').all().length }} questions.\n
" }, "formFields": { "values": [ { "fieldType": "textarea", "fieldLabel": "={{ $json[\"output.questions\"] }}", "placeholder": "=", "requiredField": true } ] } }, "typeVersion": 1 }, { "id": "e07d8c3e-8bcd-4393-9892-f825433ab58d", "name": "For Each Question...", "type": "n8n-nodes-base.splitInBatches", "position": [ -540, -460 ], "parameters": { "options": {} }, "typeVersion": 3 }, { "id": "e8d26351-52f4-40a6-ba5b-fb6bc816b734", "name": "DeepResearch Subworkflow", "type": "n8n-nodes-base.executeWorkflowTrigger", "position": [ -1880, 820 ], "parameters": { "workflowInputs": { "values": [ { "name": "requestId", "type": "any" }, { "name": "jobType" }, { "name": "data", "type": "object" } ] } }, "typeVersion": 1.1 }, { "id": "25a8055a-27aa-414f-856b-25a2e2f31974", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -1140, -680 ], "parameters": { "color": 7, "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 used the same technique found in my \"AI Interviewer\" template ([link](https://n8n.io/workflows/2566-conversational-interviews-with-ai-agents-and-n8n-forms/)).\nThis involves a looping of dynamically generated forms to collect answers from the user." }, "typeVersion": 1 }, { "id": "68398b92-eb35-48bf-885e-540074531cc4", "name": "Clarifying Questions", "type": "@n8n/n8n-nodes-langchain.chainLlm", "position": [ -1040, -460 ], "parameters": { "text": "=Given the following query from the user, ask some follow up questions to clarify the research direction. Return a maximum of 3 questions, but feel free to return less if the original query is clear:Technology | Potential Impact |
---|---|
5G Connectivity | Enables faster data speeds and advanced apps | \n
\nYour Report Is On Its Way!\n
\nDeepResearcher will now work independently to conduct the research and the compiled report will be uploaded to the following Notion page below when finished.\n
\nPlease click the \"Done\" button to complete the form.\n
\n This value determines how many sub-queries to generate.\n
\n \n \n\n This value determines how many sources to explore.\n
\n \n \n\nAnswer the following clarification questions to assist the DeepResearcher better under the research topic.\n
\n\nTotal {{ $('Feedback to Items').all().length }} questions.\n
" }, "formFields": { "values": [ { "fieldType": "textarea", "fieldLabel": "={{ $json[\"output.questions\"] }}", "placeholder": "=", "requiredField": true } ] } }, "typeVersion": 1 }, { "id": "e07d8c3e-8bcd-4393-9892-f825433ab58d", "name": "For Each Question...", "type": "n8n-nodes-base.splitInBatches", "position": [ -540, -460 ], "parameters": { "options": {} }, "typeVersion": 3 }, { "id": "e8d26351-52f4-40a6-ba5b-fb6bc816b734", "name": "DeepResearch Subworkflow", "type": "n8n-nodes-base.executeWorkflowTrigger", "position": [ -1880, 820 ], "parameters": { "workflowInputs": { "values": [ { "name": "requestId", "type": "any" }, { "name": "jobType" }, { "name": "data", "type": "object" } ] } }, "typeVersion": 1.1 }, { "id": "25a8055a-27aa-414f-856b-25a2e2f31974", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -1140, -680 ], "parameters": { "color": 7, "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 used the same technique found in my \"AI Interviewer\" template ([link](https://n8n.io/workflows/2566-conversational-interviews-with-ai-agents-and-n8n-forms/)).\nThis involves a looping of dynamically generated forms to collect answers from the user." }, "typeVersion": 1 }, { "id": "68398b92-eb35-48bf-885e-540074531cc4", "name": "Clarifying Questions", "type": "@n8n/n8n-nodes-langchain.chainLlm", "position": [ -1040, -460 ], "parameters": { "text": "=Given the following query from the user, ask some follow up questions to clarify the research direction. Return a maximum of 3 questions, but feel free to return less if the original query is clear:Technology | Potential Impact |
---|---|
5G Connectivity | Enables faster data speeds and advanced apps | \n
\nYour Report Is On Its Way!\n
\nDeepResearcher will now work independently to conduct the research and the compiled report will be uploaded to the following Notion page below when finished.\n
\nPlease click the \"Done\" button to complete the form.\n
\n This value determines how many sub-queries to generate.\n
\n \n \n\n This value determines how many sources to explore.\n
\n \n \n