Deep Research
AI-powered research automation system that generates comprehensive PDF reports from user-submitted topics. Uses multi-agent AI architecture to decompose topics into five research areas, conducts advanced web searches via Tavily API, and synthesizes findings into professionally formatted HTML chapters with inline citations. Orchestrates parallel research workflows, aggregates content in Google Sheets, generates table of contents and sources list, and delivers branded PDF reports via automated email with custom headers/footers.
Shared 12/2/2025
2 views
Visual Workflow
JSON Code
{
"meta": {
"instanceId": "125637e355429ab06f8886794f7df9252a3e338f92a1957141a8989e48f2b612",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "7eae2ba2-043a-43e1-81f0-c0f2ae01c7a2",
"name": "On form submission",
"type": "n8n-nodes-base.formTrigger",
"position": [
-1648,
1136
],
"webhookId": "ba86447b-5cda-48ab-a4d6-1e1a07bad686",
"parameters": {
"options": {},
"formTitle": "The Deepest Research",
"formFields": {
"values": [
{
"fieldLabel": "Search Topic",
"placeholder": "Search Topic",
"requiredField": true
},
{
"fieldLabel": "Email",
"placeholder": "name@example.com",
"requiredField": true
}
]
},
"formDescription": "Enter a search topic then sit back and relax."
},
"typeVersion": 2.2
},
{
"id": "0a907ed5-64e0-4736-911f-00743549ec6e",
"name": "Plan Topics",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-1424,
1136
],
"parameters": {
"text": "=Search Topic: {{ $json['Search Topic'] }}",
"options": {
"systemMessage": "=# Overview\nYou are a research assistant AI designed to generate five highly relevant and in-depth search topics based on a given search topic. Your goal is to break down the provided search topic into five key subtopics that will enable deep research and comprehensive understanding.\n\n## Instructions:\n1) Break Down the Topic: Identify five distinct yet interconnected subtopics that, when researched, will provide a well-rounded understanding of the main search topic.\n2) Ensure Depth and Relevance: Each search topic should be specific enough to allow deep exploration but broad enough to provide meaningful insights.\n3) Avoid Redundancy: The five search topics should be unique and cover different facets of the main topic.\n\n## Output Format (JSON):\n{\n \"topic_1\": \"<First in-depth search topic>\",\n \"topic_2\": \"<Second in-depth search topic>\",\n \"topic_3\": \"<Third in-depth search topic>\",\n \"topic_4\": \"<Fourth in-depth search topic>\",\n \"topic_5\": \"<Fifth in-depth search topic>\"\n}\n\n## Example Input & Output:\nInput:\n\"AI-Powered Business Automation\"\n\nOutput\n{\n \"topic_1\": \"The Role of AI in Automating Business Processes\",\n \"topic_2\": \"AI-Driven Workflow Automation: Tools and Technologies\",\n \"topic_3\": \"Challenges and Ethical Considerations in AI Automation\",\n \"topic_4\": \"Case Studies: Successful AI Implementations in Business Automation\",\n \"topic_5\": \"The Future of AI Automation: Trends and Emerging Innovations\"\n}\n\n## Final Notes\nYour responses should be concise, relevant, and well-structured to guide in-depth research effectively."
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.8
},
{
"id": "e0d34e03-7c15-4b99-b9e2-57f1cb7039c4",
"name": "OpenRouter Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
-1424,
1376
],
"parameters": {
"model": "anthropic/claude-sonnet-4.5",
"options": {}
},
"credentials": {
"openRouterApi": {
"id": "mTN0GOF1NYXFOPKG",
"name": "OpenRouter account"
}
},
"typeVersion": 1
},
{
"id": "5083a004-acc7-4152-9f92-fcfaa37387b4",
"name": "5 Topics",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
-1248,
1376
],
"parameters": {
"jsonSchemaExample": "{\n \"topic_1\": \"Understanding AI Agents\",\n \"topic_2\": \"Building AI Agents with n8n\",\n \"topic_3\": \"Optimizing Prompt Engineering\",\n \"topic_4\": \"Storing and Retrieving AI Knowledge\",\n \"topic_5\": \"Scaling AI Automation for Businesses\"\n}\n"
},
"typeVersion": 1.2
},
{
"id": "8d2c6a71-424c-409f-8d5c-0cdc20967cef",
"name": "Intro",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-896,
1136
],
"parameters": {
"text": "=Search Topic: {{ $('On form submission').item.json['Search Topic'] }}\n\nTopics: \n1) {{ $('Plan Topics').item.json.output.topic_1 }}\n2) {{ $('Plan Topics').item.json.output.topic_2 }}\n3) {{ $('Plan Topics').item.json.output.topic_3 }}\n4) {{ $('Plan Topics').item.json.output.topic_4 }}\n5) {{ $('Plan Topics').item.json.output.topic_5 }}",
"options": {
"systemMessage": "=# Overview\nYou are a report title and introduction generator AI. Your task is to create a compelling title, a concise introduction, and five clear chapter headings for a research report based on a given main search topic and five subtopics.\n\n**IMPORTANT**: You are NOT being asked to conduct research or verify information. You are ONLY creating the structural elements (title, introduction, chapter headings) based on the topic names provided to you. The actual research content will be added later by other systems.\n\n## Instructions:\n1) **Title**: Generate a clear and engaging title that reflects the overall theme based on the main topic provided.\n2) **Introduction**: Write a short introduction (2 paragraphs) that:\n - Provides general context about why this topic matters\n - Explains what the report will cover based on the subtopics provided\n - Sets an engaging tone for the report\n - This section should start with a header called \"Introduction\"\n - Do NOT include specific facts, statistics, or claims that would require research\n3) **Table of Contents**: At the end of the introduction, list the five sections of the report, each represented as a clearly formatted chapter title in <h2> headers.\n4) **Chapter Titles**: Transform each of the five subtopics into engaging chapter titles formatted as <h2> headers.\n\n## Styling:\n- Title: <h1> element, centered, styled with a professional dark blue color.\n- Introduction: Wrapped in a <div> with a light gray background (#f4f4f4) for contrast.\n- Paragraphs: Readable font size (16px), appropriate line height (1.6), and neutral text color (#333).\n- Horizontal Line (<hr>) should be used to separate the two introduction paragraphs.\n- Chapter Titles: Clearly formatted as <h2> elements with centered text and dark blue color (#00366D).\n\n## Output Format (JSON):\n{\n \"title\": \"<Generated Report Title>\",\n \"introduction\": \"<Generated Introduction>\",\n \"chapter_1\": \"<h2>Chapter 1: [Title]</h2>\",\n \"chapter_2\": \"<h2>Chapter 2: [Title]</h2>\",\n \"chapter_3\": \"<h2>Chapter 3: [Title]</h2>\",\n \"chapter_4\": \"<h2>Chapter 4: [Title]</h2>\",\n \"chapter_5\": \"<h2>Chapter 5: [Title]</h2>\"\n}\n\n## Example Output:\n{\n \"title\": \"<h1 style='text-align: center; color: #00366D;'>Vision and Vegetables: A Comprehensive Analysis of Carrots' Impact on Eye Health</h1>\",\n \"introduction\": \"<div style='background-color: #f4f4f4; padding: 20px; font-size: 16px; line-height: 1.6; color: #333;'><h2>Introduction</h2><p>The relationship between carrots and vision has been a topic of both scientific interest and cultural folklore for generations. While the common parental advice 'eat your carrots, they're good for your eyes' has become deeply embedded in popular consciousness, the scientific reality behind this widely-held belief merits thorough investigation. This comprehensive report examines the multifaceted connection between carrot consumption and ocular health, exploring both the scientific evidence and historical perspectives that have shaped our understanding of this remarkable root vegetable's role in vision care.</p><hr><p>Through this analysis, we will explore the biochemical properties of carrots, the role of beta-carotene in eye health, and the scientific consensus on their effectiveness. Additionally, we will discuss historical influences and modern dietary recommendations. By the end of this report, readers will have a well-rounded understanding of the true impact of carrots on visual function.</p></div>\",\n \"chapter_1\": \"<h2 style='text-align: center; color: #00366D;'>Chapter 1: The Biochemical Properties of Carrots</h2>\",\n \"chapter_2\": \"<h2 style='text-align: center; color: #00366D;'>Chapter 2: The Role of Beta-Carotene in Eye Health</h2>\",\n \"chapter_3\": \"<h2 style='text-align: center; color: #00366D;'>Chapter 3: Carrots and Night Vision: Myth or Reality?</h2>\",\n \"chapter_4\": \"<h2 style='text-align: center; color: #00366D;'>Chapter 4: Historical Perspectives on Carrots and Vision</h2>\",\n \"chapter_5\": \"<h2 style='text-align: center; color: #00366D;'>Chapter 5: Modern Dietary Recommendations for Eye Health</h2>\"\n}\n\n## Final Notes\n- Your role is ONLY to create the report structure - you are not researching or verifying any claims\n- Base your titles and introduction on the topic names provided, without making specific factual claims\n- Keep the introduction engaging but general enough that it doesn't require current knowledge\n- Ensure the title is professional, the introduction is engaging, and that each chapter title is formatted as an <h2> header for clarity and emphasis"
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.8
},
{
"id": "d3ee5cd3-04ec-4083-917a-b818127af577",
"name": "OpenRouter Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
-912,
1376
],
"parameters": {
"model": "anthropic/claude-sonnet-4.5",
"options": {}
},
"credentials": {
"openRouterApi": {
"id": "mTN0GOF1NYXFOPKG",
"name": "OpenRouter account"
}
},
"typeVersion": 1
},
{
"id": "44663d03-b50c-414e-8377-31e47883b055",
"name": "Split Out",
"type": "n8n-nodes-base.splitOut",
"position": [
-896,
976
],
"parameters": {
"options": {},
"fieldToSplitOut": "output"
},
"typeVersion": 1
},
{
"id": "2bb6f6fe-6796-4c4c-b9c1-157307c4c33e",
"name": "Merge",
"type": "n8n-nodes-base.merge",
"position": [
-256,
1120
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineAll"
},
"typeVersion": 3
},
{
"id": "25cac54d-0b36-4ca3-bf69-a100b89d654a",
"name": "Set Topics",
"type": "n8n-nodes-base.set",
"position": [
-896,
800
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "3da6558a-6372-44f9-8d5a-f18bfe6e1c16",
"name": "topics",
"type": "array",
"value": "['topic_1','topic_2','topic_3','topic_4','topic_5']"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "a1fd6843-8245-43c4-b507-a8c1404a09d3",
"name": "Merge1",
"type": "n8n-nodes-base.merge",
"position": [
-432,
960
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineByPosition"
},
"typeVersion": 3
},
{
"id": "412aca0f-7e56-4690-9ed3-3a5a76490a41",
"name": "Split Out1",
"type": "n8n-nodes-base.splitOut",
"position": [
-672,
800
],
"parameters": {
"options": {},
"fieldToSplitOut": "topics"
},
"typeVersion": 1
},
{
"id": "92250292-5ff6-4394-9036-db6fd55a58bb",
"name": "Switch",
"type": "n8n-nodes-base.switch",
"position": [
-96,
1088
],
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "7081a8b9-aa72-4841-8392-908e2387acf9",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.topics }}",
"rightValue": "topic_1"
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "1b2472f8-0fb4-4812-bfd8-3a9417fab4a8",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.topics }}",
"rightValue": "topic_2"
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "6d0dad77-6120-441a-ae74-55c18a550a8a",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.topics }}",
"rightValue": "topic_3"
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "5aff824d-531d-4134-b2a6-f694e1c1f8bf",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.topics }}",
"rightValue": "topic_4"
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "c80cc85a-2e2e-4cb2-9e62-dd8c4a48248d",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.topics }}",
"rightValue": "topic_5"
}
]
}
}
]
},
"options": {}
},
"typeVersion": 3.2
},
{
"id": "d861a935-87b0-4a43-baad-bc79e3a6af86",
"name": "OpenRouter Chat Model2",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
800,
1024
],
"parameters": {
"model": "google/gemini-3-pro-preview",
"options": {}
},
"credentials": {
"openRouterApi": {
"id": "mTN0GOF1NYXFOPKG",
"name": "OpenRouter account"
}
},
"typeVersion": 1
},
{
"id": "5b8c86fd-94b4-4816-bfa8-558a4eef3847",
"name": "Tavily",
"type": "n8n-nodes-base.httpRequest",
"position": [
384,
768
],
"parameters": {
"url": "https://api.tavily.com/search",
"method": "POST",
"options": {},
"jsonBody": "={\n \"query\": \"{{ $json.output }}\",\n \"topic\": \"general\",\n \"search_depth\": \"advanced\",\n \"chunks_per_source\": 3,\n \"max_results\": 5\n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpBearerAuth"
},
"credentials": {
"tavilyApi": {
"id": "GsoWv8ijASHYumaZ",
"name": "Tavily account"
},
"httpBearerAuth": {
"id": "yIRLEMTLlP5vUNSx",
"name": "Tavily Token"
},
"httpHeaderAuth": {
"id": "bU5Qf0UOdsicB1SX",
"name": "Unipile"
}
},
"typeVersion": 4.2
},
{
"id": "be000457-70f8-4e70-923e-b3539b9c33e6",
"name": "Split Out2",
"type": "n8n-nodes-base.splitOut",
"position": [
576,
768
],
"parameters": {
"options": {},
"fieldToSplitOut": "results"
},
"typeVersion": 1
},
{
"id": "fbbcfe6d-10a0-4bfd-ab0a-fc5f47c26e24",
"name": "Code",
"type": "n8n-nodes-base.code",
"position": [
752,
768
],
"parameters": {
"jsCode": "// Create separate items for each URL with a number\n\n// Transform the input items to create numbered URLs\nreturn items.map((item, index) => {\n return {\n json: {\n number: index + 1,\n url: item.json.url,\n // Optional: include a formatted numbered URL if needed\n numberedUrl: `${index + 1}. ${item.json.url}`\n }\n };\n});"
},
"typeVersion": 2
},
{
"id": "4bc3cd2c-a249-4026-95a4-e7abad23f835",
"name": "Aggregate",
"type": "n8n-nodes-base.aggregate",
"position": [
1296,
896
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "output"
}
]
}
},
"typeVersion": 1
},
{
"id": "ec49fe29-38c8-43d0-8264-f978c9050d90",
"name": "Writer",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
976,
896
],
"parameters": {
"text": "=Title: {{ $('Split Out2').item.json.title }}\n\nResearch: \n{{ $('Split Out2').item.json.content }}\n\nSource:\n{{ $json.numberedUrl }}\n\nStyle Guide Example:\n{{ $('Switch').first().json.Introduction }}",
"options": {
"systemMessage": "=# Overview\nYou are an advanced AI research assistant specializing in writing professional HTML reports based on a provided title, research, source, and a given style guide. Your task is to generate a fully formatted HTML report that is both visually appealing and structured according to professional writing standards.\n\n## Report Generation Guidelines\n1. Adherence to Style Guide\n- The report must strictly follow the provided HTML style guide, ensuring consistent styling, colors, fonts, padding, and layout.\n\n2. Structure & Formatting\n- The report should be well-structured and formatted in professional HTML.\n- Title (<h1>) – Provided as \"Title\"\n- Content Body – Fully formatted research content with proper sectioning (<h2>, <h3>, <p>).\n- Each section should be wrapped in a div styled according to the provided guide to ensure consistency.\n- Use <p> for paragraphs, <ul>/<ol> for lists, and <hr> to separate sections when necessary.\n- No Overview or Conclusion headers are necessary, just output a full report.\n- Horizontal Line (<hr>) should be used to separate sections for better visual clarity.\n\n3. Research-Based Content\n- Synthesize information logically and ensure the report is well-researched, factual, and professionally written.\n- Use informative writing. Provide as much detail as possible.\n- Maintain a logical progression of ideas, summarizing key points effectively.\n\n4. Source Attribution & Clickable Links\n- Use the number given in front of the source as the clickable attribute in the report.\n- Source links must be inline within the text using: <a href=\"SOURCE_URL\" target=\"_blank\">[1]</a>\n- Do not include a \"References\" section—instead, all sources should be embedded within the content.\n\n## Example Output Structure (Applying Style Guide)\n<!DOCTYPE html>\n<html>\n<head>\n <title>Research Report: [Title]</title>\n <style>\n body { font-family: Arial, sans-serif; line-height: 1.6; margin: 20px; }\n h1, h2, h3 { color: #333; }\n .report-section { background-color: #f4f4f4; padding: 20px; font-size: 16px; line-height: 1.6; color: #333; margin-bottom: 10px; }\n </style>\n</head>\n<body>\n\n <div class=\"report-section\">\n <h1>Research Report: [Title]</h1>\n </div>\n\n <div class=\"report-section\">\n <h2>Introduction</h2>\n <p>The connection between carrots and vision health has long been a subject of both scientific inquiry and popular wisdom. \n From wartime propaganda to modern nutritional science, these vibrant orange vegetables have maintained their reputation as \n nature's answer to eye health maintenance.</p>\n <hr>\n <p>This report systematically explores five key aspects of the carrot-vision relationship, including their nutritional profile, \n beta-carotene's role, scientific studies, and comparative benefits with other eye-healthy vegetables.</p>\n </div>\n\n <div class=\"report-section\">\n <h2>Key Findings</h2>\n <h3>Nutritional Composition</h3>\n <p>Carrots contain high levels of vitamin A, antioxidants, and beta-carotene, which play a significant role in vision health \n <a href=\"https://example.com\" target=\"_blank\">[1]</a>.</p>\n\n <h3>Scientific Studies on Vision Benefits</h3>\n <p>Recent studies have examined the link between carrot consumption and reduced risk of age-related eye diseases \n <a href=\"https://example.com\" target=\"_blank\">[2]</a>.</p>\n </div>\n\n <div class=\"report-section\">\n <h2>Conclusion</h2>\n <p>Based on extensive research, carrots do contribute positively to vision health due to their high beta-carotene content. \n However, their benefits should be seen as part of a balanced diet rather than a standalone solution.</p>\n </div>\n\n</body>\n</html>"
},
"promptType": "define"
},
"typeVersion": 1.8
},
{
"id": "a275a780-b8ab-4c44-9473-3f2f66f1d1e1",
"name": "Aggregate1",
"type": "n8n-nodes-base.aggregate",
"position": [
1296,
768
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "numberedUrl"
}
]
}
},
"typeVersion": 1
},
{
"id": "5c8f4199-cd32-485b-9b57-ca57d41e33f3",
"name": "Merge3",
"type": "n8n-nodes-base.merge",
"position": [
1472,
784
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineByPosition"
},
"typeVersion": 3
},
{
"id": "caa52d9f-9bcb-48af-a60a-e92ac9d3999f",
"name": "OpenRouter Chat Model3",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
800,
1520
],
"parameters": {
"model": "google/gemini-3-pro-preview",
"options": {}
},
"credentials": {
"openRouterApi": {
"id": "mTN0GOF1NYXFOPKG",
"name": "OpenRouter account"
}
},
"typeVersion": 1
},
{
"id": "561aa974-0c5e-4c97-bea7-01a80c5e36c7",
"name": "Google Sheets2",
"type": "n8n-nodes-base.googleSheets",
"position": [
1952,
1280
],
"parameters": {
"columns": {
"value": {
"Search Topic": "={{ $('On form submission').first().json['Search Topic'] }}",
"Topic 2 Content": "={{ $('Merge4').first().json.output.join(\"\\n \\n\") }}",
"Topic 2 Sources": "={{ $('Merge4').first().json.numberedUrl.join(\"\\n\") }}",
"Topic 2 Sections": "={{ $json.sections.join(\"\\n\") }}"
},
"schema": [
{
"id": "Search Topic",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Search Topic",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Title",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Introduction",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Introduction",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 1",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 1",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 2",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 2",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 3",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 3",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 4",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 4",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 5",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 5",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 1 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 1 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 1 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Sources",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Topic 2 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Sections",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Topic 2 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Content",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Topic 2 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 3 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 3 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 3 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 4 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 4 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 4 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 5 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 5 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 5 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ToC",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "ToC",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "number",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Search Topic"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw/edit?usp=drivesdk",
"cachedResultName": "Copy of Deep Research Template (file -> make a copy)"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "qVntjW61XxH91qGU",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5,
"alwaysOutputData": true
},
{
"id": "c8c54fec-d8a7-458e-b473-fd2b5a38b471",
"name": "Tavily1",
"type": "n8n-nodes-base.httpRequest",
"position": [
384,
1264
],
"parameters": {
"url": "https://api.tavily.com/search",
"method": "POST",
"options": {},
"jsonBody": "={\n \"query\": \"{{ $json.output }}\",\n \"topic\": \"general\",\n \"search_depth\": \"advanced\",\n \"chunks_per_source\": 3,\n \"max_results\": 5\n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpBearerAuth"
},
"credentials": {
"tavilyApi": {
"id": "GsoWv8ijASHYumaZ",
"name": "Tavily account"
},
"httpBearerAuth": {
"id": "yIRLEMTLlP5vUNSx",
"name": "Tavily Token"
},
"httpHeaderAuth": {
"id": "bU5Qf0UOdsicB1SX",
"name": "Unipile"
}
},
"typeVersion": 4.2
},
{
"id": "68dbc3b1-ccc8-4c8e-b928-a8ec065573b0",
"name": "Split Out3",
"type": "n8n-nodes-base.splitOut",
"position": [
576,
1264
],
"parameters": {
"options": {},
"fieldToSplitOut": "results"
},
"typeVersion": 1
},
{
"id": "35436fb4-0d47-4bcb-8509-bbc461a9c2a0",
"name": "Code1",
"type": "n8n-nodes-base.code",
"position": [
784,
1264
],
"parameters": {
"jsCode": "// Create separate items for each URL starting from number 6\n\n// Transform the input items to create numbered URLs\n// Start counting from 6 and increment by 1\nreturn items.map((item, index) => {\n const number = index + 6; // Start at 6 instead of 1\n \n return {\n json: {\n number: number,\n url: item.json.url,\n numberedUrl: `${number}. ${item.json.url}`\n }\n };\n});"
},
"typeVersion": 2
},
{
"id": "ed3f03e8-aee5-4b17-b29a-d509f15b8b49",
"name": "Aggregate2",
"type": "n8n-nodes-base.aggregate",
"position": [
1296,
1408
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "output"
}
]
}
},
"typeVersion": 1
},
{
"id": "ab0931bf-2691-4add-8ec4-aff87a6a9383",
"name": "Writer1",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
976,
1408
],
"parameters": {
"text": "=Title: {{ $('Split Out3').item.json.title }}\n\nResearch: \n{{ $('Split Out3').item.json.content }}\n\nSource:\n{{ $json.numberedUrl }}\n\nStyle Guide Example:\n{{ $('Switch').first().json.Introduction }}",
"options": {
"systemMessage": "=# Overview\nYou are an advanced AI research assistant specializing in writing professional HTML reports based on a provided title, research, source, and a given style guide. Your task is to generate a fully formatted HTML report that is both visually appealing and structured according to professional writing standards.\n\n## Report Generation Guidelines\n1. Adherence to Style Guide\n- The report must strictly follow the provided HTML style guide, ensuring consistent styling, colors, fonts, padding, and layout.\n\n2. Structure & Formatting\n- The report should be well-structured and formatted in professional HTML.\n- Title (<h1>) – Provided as \"Title\"\n- Content Body – Fully formatted research content with proper sectioning (<h2>, <h3>, <p>).\n- Each section should be wrapped in a div styled according to the provided guide to ensure consistency.\n- Use <p> for paragraphs, <ul>/<ol> for lists, and <hr> to separate sections when necessary.\n- No Overview or Conclusion headers are necessary, just output a full report.\n- Horizontal Line (<hr>) should be used to separate sections for better visual clarity.\n\n3. Research-Based Content\n- Synthesize information logically and ensure the report is well-researched, factual, and professionally written.\n- Use informative writing. Provide as much detail as possible.\n- Maintain a logical progression of ideas, summarizing key points effectively.\n\n4. Source Attribution & Clickable Links\n- Use the number given in front of the source as the clickable attribute in the report.\n- Source links must be inline within the text using: <a href=\"SOURCE_URL\" target=\"_blank\">[1]</a>\n- Do not include a \"References\" section—instead, all sources should be embedded within the content.\n\n## Example Output Structure (Applying Style Guide)\n<!DOCTYPE html>\n<html>\n<head>\n <title>Research Report: [Title]</title>\n <style>\n body { font-family: Arial, sans-serif; line-height: 1.6; margin: 20px; }\n h1, h2, h3 { color: #333; }\n .report-section { background-color: #f4f4f4; padding: 20px; font-size: 16px; line-height: 1.6; color: #333; margin-bottom: 10px; }\n </style>\n</head>\n<body>\n\n <div class=\"report-section\">\n <h1>Research Report: [Title]</h1>\n </div>\n\n <div class=\"report-section\">\n <h2>Introduction</h2>\n <p>The connection between carrots and vision health has long been a subject of both scientific inquiry and popular wisdom. \n From wartime propaganda to modern nutritional science, these vibrant orange vegetables have maintained their reputation as \n nature's answer to eye health maintenance.</p>\n <hr>\n <p>This report systematically explores five key aspects of the carrot-vision relationship, including their nutritional profile, \n beta-carotene's role, scientific studies, and comparative benefits with other eye-healthy vegetables.</p>\n </div>\n\n <div class=\"report-section\">\n <h2>Key Findings</h2>\n <h3>Nutritional Composition</h3>\n <p>Carrots contain high levels of vitamin A, antioxidants, and beta-carotene, which play a significant role in vision health \n <a href=\"https://example.com\" target=\"_blank\">[1]</a>.</p>\n\n <h3>Scientific Studies on Vision Benefits</h3>\n <p>Recent studies have examined the link between carrot consumption and reduced risk of age-related eye diseases \n <a href=\"https://example.com\" target=\"_blank\">[2]</a>.</p>\n </div>\n\n <div class=\"report-section\">\n <h2>Conclusion</h2>\n <p>Based on extensive research, carrots do contribute positively to vision health due to their high beta-carotene content. \n However, their benefits should be seen as part of a balanced diet rather than a standalone solution.</p>\n </div>\n\n</body>\n</html>"
},
"promptType": "define"
},
"typeVersion": 1.8
},
{
"id": "5b4f8b6e-4c57-45ca-a687-ae0ce35ddfc7",
"name": "Aggregate3",
"type": "n8n-nodes-base.aggregate",
"position": [
1296,
1264
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "numberedUrl"
}
]
}
},
"typeVersion": 1
},
{
"id": "e235bc54-c247-4fc3-a875-f3d0eabb39ce",
"name": "Merge4",
"type": "n8n-nodes-base.merge",
"position": [
1472,
1280
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineByPosition"
},
"typeVersion": 3
},
{
"id": "8160e5da-8104-4916-b4dc-fad9283fd831",
"name": "OpenRouter Chat Model4",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
800,
2048
],
"parameters": {
"model": "google/gemini-3-pro-preview",
"options": {}
},
"credentials": {
"openRouterApi": {
"id": "mTN0GOF1NYXFOPKG",
"name": "OpenRouter account"
}
},
"typeVersion": 1
},
{
"id": "c294b670-7b4b-4344-b7a6-dc518b70437f",
"name": "Google Sheets3",
"type": "n8n-nodes-base.googleSheets",
"position": [
1952,
1808
],
"parameters": {
"columns": {
"value": {
"Search Topic": "={{ $('On form submission').first().json['Search Topic'] }}",
"Topic 3 Content": "={{ $('Merge5').first().json.output.join(\"\\n \\n\") }}",
"Topic 3 Sources": "={{ $('Merge5').first().json.numberedUrl.join(\"\\n\") }}",
"Topic 3 Sections": "={{ $json.sections.join(\"\\n\") }}"
},
"schema": [
{
"id": "Search Topic",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Search Topic",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Title",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Introduction",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Introduction",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 1",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 1",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 2",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 2",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 3",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 3",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 4",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 4",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 5",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 5",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 1 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 1 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 1 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 2 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 2 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 2 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Sources",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Topic 3 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Sections",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Topic 3 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Content",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Topic 3 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 4 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 4 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 4 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 5 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 5 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 5 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ToC",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "ToC",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "number",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Search Topic"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw/edit?usp=drivesdk",
"cachedResultName": "Copy of Deep Research Template (file -> make a copy)"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "qVntjW61XxH91qGU",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5,
"alwaysOutputData": true
},
{
"id": "b8827e20-3970-4b04-928b-9c0ee2ee61a5",
"name": "Tavily2",
"type": "n8n-nodes-base.httpRequest",
"position": [
384,
1776
],
"parameters": {
"url": "https://api.tavily.com/search",
"method": "POST",
"options": {},
"jsonBody": "={\n \"query\": \"{{ $json.output }}\",\n \"topic\": \"general\",\n \"search_depth\": \"advanced\",\n \"chunks_per_source\": 3,\n \"max_results\": 5\n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpBearerAuth"
},
"credentials": {
"tavilyApi": {
"id": "GsoWv8ijASHYumaZ",
"name": "Tavily account"
},
"httpBearerAuth": {
"id": "yIRLEMTLlP5vUNSx",
"name": "Tavily Token"
},
"httpHeaderAuth": {
"id": "bU5Qf0UOdsicB1SX",
"name": "Unipile"
}
},
"typeVersion": 4.2
},
{
"id": "ddc86c43-ba85-4165-a7d7-13f523307480",
"name": "Split Out4",
"type": "n8n-nodes-base.splitOut",
"position": [
576,
1776
],
"parameters": {
"options": {},
"fieldToSplitOut": "results"
},
"typeVersion": 1
},
{
"id": "16b86ab4-0a2a-4045-ab21-1b32bf494e6d",
"name": "Code2",
"type": "n8n-nodes-base.code",
"position": [
784,
1776
],
"parameters": {
"jsCode": "// Create separate items for each URL starting from number 6\n\n// Transform the input items to create numbered URLs\n// Start counting from 6 and increment by 1\nreturn items.map((item, index) => {\n const number = index + 11; // Start at 6 instead of 1\n \n return {\n json: {\n number: number,\n url: item.json.url,\n numberedUrl: `${number}. ${item.json.url}`\n }\n };\n});"
},
"typeVersion": 2
},
{
"id": "adb4d7c1-2137-4e00-bfc9-f556371417b7",
"name": "Aggregate4",
"type": "n8n-nodes-base.aggregate",
"position": [
1296,
1920
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "output"
}
]
}
},
"typeVersion": 1
},
{
"id": "d224b372-04e0-41f7-8d70-17c7c996c768",
"name": "Writer2",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
960,
1920
],
"parameters": {
"text": "=Title: {{ $('Split Out4').item.json.title }}\n\nResearch: \n{{ $('Split Out4').item.json.content }}\n\nSource:\n{{ $json.numberedUrl }}\n\nStyle Guide Example:\n{{ $('Switch').first().json.Introduction }}",
"options": {
"systemMessage": "=# Overview\nYou are an advanced AI research assistant specializing in writing professional HTML reports based on a provided title, research, source, and a given style guide. Your task is to generate a fully formatted HTML report that is both visually appealing and structured according to professional writing standards.\n\n## Report Generation Guidelines\n1. Adherence to Style Guide\n- The report must strictly follow the provided HTML style guide, ensuring consistent styling, colors, fonts, padding, and layout.\n\n2. Structure & Formatting\n- The report should be well-structured and formatted in professional HTML.\n- Title (<h1>) – Provided as \"Title\"\n- Content Body – Fully formatted research content with proper sectioning (<h2>, <h3>, <p>).\n- Each section should be wrapped in a div styled according to the provided guide to ensure consistency.\n- Use <p> for paragraphs, <ul>/<ol> for lists, and <hr> to separate sections when necessary.\n- No Overview or Conclusion headers are necessary, just output a full report.\n- Horizontal Line (<hr>) should be used to separate sections for better visual clarity.\n\n3. Research-Based Content\n- Synthesize information logically and ensure the report is well-researched, factual, and professionally written.\n- Use informative writing. Provide as much detail as possible.\n- Maintain a logical progression of ideas, summarizing key points effectively.\n\n4. Source Attribution & Clickable Links\n- Use the number given in front of the source as the clickable attribute in the report.\n- Source links must be inline within the text using: <a href=\"SOURCE_URL\" target=\"_blank\">[1]</a>\n- Do not include a \"References\" section—instead, all sources should be embedded within the content.\n\n## Example Output Structure (Applying Style Guide)\n<!DOCTYPE html>\n<html>\n<head>\n <title>Research Report: [Title]</title>\n <style>\n body { font-family: Arial, sans-serif; line-height: 1.6; margin: 20px; }\n h1, h2, h3 { color: #333; }\n .report-section { background-color: #f4f4f4; padding: 20px; font-size: 16px; line-height: 1.6; color: #333; margin-bottom: 10px; }\n </style>\n</head>\n<body>\n\n <div class=\"report-section\">\n <h1>Research Report: [Title]</h1>\n </div>\n\n <div class=\"report-section\">\n <h2>Introduction</h2>\n <p>The connection between carrots and vision health has long been a subject of both scientific inquiry and popular wisdom. \n From wartime propaganda to modern nutritional science, these vibrant orange vegetables have maintained their reputation as \n nature's answer to eye health maintenance.</p>\n <hr>\n <p>This report systematically explores five key aspects of the carrot-vision relationship, including their nutritional profile, \n beta-carotene's role, scientific studies, and comparative benefits with other eye-healthy vegetables.</p>\n </div>\n\n <div class=\"report-section\">\n <h2>Key Findings</h2>\n <h3>Nutritional Composition</h3>\n <p>Carrots contain high levels of vitamin A, antioxidants, and beta-carotene, which play a significant role in vision health \n <a href=\"https://example.com\" target=\"_blank\">[1]</a>.</p>\n\n <h3>Scientific Studies on Vision Benefits</h3>\n <p>Recent studies have examined the link between carrot consumption and reduced risk of age-related eye diseases \n <a href=\"https://example.com\" target=\"_blank\">[2]</a>.</p>\n </div>\n\n <div class=\"report-section\">\n <h2>Conclusion</h2>\n <p>Based on extensive research, carrots do contribute positively to vision health due to their high beta-carotene content. \n However, their benefits should be seen as part of a balanced diet rather than a standalone solution.</p>\n </div>\n\n</body>\n</html>"
},
"promptType": "define"
},
"typeVersion": 1.8
},
{
"id": "0c38e881-c018-4d54-9e84-e460c26aeb7e",
"name": "Aggregate5",
"type": "n8n-nodes-base.aggregate",
"position": [
1296,
1776
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "numberedUrl"
}
]
}
},
"typeVersion": 1
},
{
"id": "ab24aaf1-4f0f-4da4-9283-936fde4a4384",
"name": "Merge5",
"type": "n8n-nodes-base.merge",
"position": [
1472,
1808
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineByPosition"
},
"typeVersion": 3
},
{
"id": "a5ebf10d-1bbb-450a-bb35-9b19b823f4da",
"name": "OpenRouter Chat Model5",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
816,
2544
],
"parameters": {
"model": "google/gemini-3-pro-preview",
"options": {}
},
"credentials": {
"openRouterApi": {
"id": "mTN0GOF1NYXFOPKG",
"name": "OpenRouter account"
}
},
"typeVersion": 1
},
{
"id": "8bfb9631-1a5e-4472-9bec-6d15677c7913",
"name": "Google Sheets4",
"type": "n8n-nodes-base.googleSheets",
"position": [
1952,
2304
],
"parameters": {
"columns": {
"value": {
"Search Topic": "={{ $('On form submission').first().json['Search Topic'] }}",
"Topic 4 Content": "={{ $('Merge6').first().json.output.join(\"\\n \\n\") }}",
"Topic 4 Sources": "={{ $('Merge6').first().json.numberedUrl.join(\"\\n\") }}",
"Topic 4 Sections": "={{ $json.sections.join(\"\\n\") }}"
},
"schema": [
{
"id": "Search Topic",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Search Topic",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Title",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Introduction",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Introduction",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 1 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 1 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 1 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 2 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 2 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 2 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 3 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 3 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 3 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Sources",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Topic 4 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Sections",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Topic 4 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Content",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Topic 4 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 5 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 5 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 5 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "string",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Search Topic"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw/edit?usp=drivesdk",
"cachedResultName": "Copy of Deep Research Template (file -> make a copy)"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "qVntjW61XxH91qGU",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5,
"alwaysOutputData": true
},
{
"id": "67cd4899-ceb1-4db0-99b9-8b61502f3aa4",
"name": "Tavily3",
"type": "n8n-nodes-base.httpRequest",
"position": [
384,
2288
],
"parameters": {
"url": "https://api.tavily.com/search",
"method": "POST",
"options": {},
"jsonBody": "={\n \"query\": \"{{ $json.output }}\",\n \"topic\": \"general\",\n \"search_depth\": \"advanced\",\n \"chunks_per_source\": 3,\n \"max_results\": 5\n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpBearerAuth"
},
"credentials": {
"tavilyApi": {
"id": "GsoWv8ijASHYumaZ",
"name": "Tavily account"
},
"httpBearerAuth": {
"id": "yIRLEMTLlP5vUNSx",
"name": "Tavily Token"
},
"httpHeaderAuth": {
"id": "bU5Qf0UOdsicB1SX",
"name": "Unipile"
}
},
"typeVersion": 4.2
},
{
"id": "943cf455-c6c6-458c-9901-3d272bb4cbb2",
"name": "Split Out5",
"type": "n8n-nodes-base.splitOut",
"position": [
576,
2288
],
"parameters": {
"options": {},
"fieldToSplitOut": "results"
},
"typeVersion": 1
},
{
"id": "84730184-8bdc-40a9-9744-48d0d2bedf05",
"name": "Code3",
"type": "n8n-nodes-base.code",
"position": [
784,
2288
],
"parameters": {
"jsCode": "// Create separate items for each URL starting from number 6\n\n// Transform the input items to create numbered URLs\n// Start counting from 6 and increment by 1\nreturn items.map((item, index) => {\n const number = index + 16; // Start at 6 instead of 1\n \n return {\n json: {\n number: number,\n url: item.json.url,\n numberedUrl: `${number}. ${item.json.url}`\n }\n };\n});"
},
"typeVersion": 2
},
{
"id": "bdec7fac-0af0-4a78-947d-b3c5a0abe1f4",
"name": "Aggregate6",
"type": "n8n-nodes-base.aggregate",
"position": [
1296,
2416
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "output"
}
]
}
},
"typeVersion": 1
},
{
"id": "65cf2049-f78a-4dd1-9eac-ab000d4e6559",
"name": "Writer3",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
976,
2416
],
"parameters": {
"text": "=Title: {{ $('Split Out5').item.json.title }}\n\nResearch: \n{{ $('Split Out5').item.json.content }}\n\nSource:\n{{ $json.numberedUrl }}\n\nStyle Guide Example:\n{{ $('Switch').first().json.Introduction }}",
"options": {
"systemMessage": "=# Overview\nYou are an advanced AI research assistant specializing in writing professional HTML reports based on a provided title, research, source, and a given style guide. Your task is to generate a fully formatted HTML report that is both visually appealing and structured according to professional writing standards.\n\n## Report Generation Guidelines\n1. Adherence to Style Guide\n- The report must strictly follow the provided HTML style guide, ensuring consistent styling, colors, fonts, padding, and layout.\n\n2. Structure & Formatting\n- The report should be well-structured and formatted in professional HTML.\n- Title (<h1>) – Provided as \"Title\"\n- Content Body – Fully formatted research content with proper sectioning (<h2>, <h3>, <p>).\n- Each section should be wrapped in a div styled according to the provided guide to ensure consistency.\n- Use <p> for paragraphs, <ul>/<ol> for lists, and <hr> to separate sections when necessary.\n- No Overview or Conclusion headers are necessary, just output a full report.\n- Horizontal Line (<hr>) should be used to separate sections for better visual clarity.\n\n3. Research-Based Content\n- Synthesize information logically and ensure the report is well-researched, factual, and professionally written.\n- Use informative writing. Provide as much detail as possible.\n- Maintain a logical progression of ideas, summarizing key points effectively.\n\n4. Source Attribution & Clickable Links\n- Use the number given in front of the source as the clickable attribute in the report.\n- Source links must be inline within the text using: <a href=\"SOURCE_URL\" target=\"_blank\">[1]</a>\n- Do not include a \"References\" section—instead, all sources should be embedded within the content.\n\n## Example Output Structure (Applying Style Guide)\n<!DOCTYPE html>\n<html>\n<head>\n <title>Research Report: [Title]</title>\n <style>\n body { font-family: Arial, sans-serif; line-height: 1.6; margin: 20px; }\n h1, h2, h3 { color: #333; }\n .report-section { background-color: #f4f4f4; padding: 20px; font-size: 16px; line-height: 1.6; color: #333; margin-bottom: 10px; }\n </style>\n</head>\n<body>\n\n <div class=\"report-section\">\n <h1>Research Report: [Title]</h1>\n </div>\n\n <div class=\"report-section\">\n <h2>Introduction</h2>\n <p>The connection between carrots and vision health has long been a subject of both scientific inquiry and popular wisdom. \n From wartime propaganda to modern nutritional science, these vibrant orange vegetables have maintained their reputation as \n nature's answer to eye health maintenance.</p>\n <hr>\n <p>This report systematically explores five key aspects of the carrot-vision relationship, including their nutritional profile, \n beta-carotene's role, scientific studies, and comparative benefits with other eye-healthy vegetables.</p>\n </div>\n\n <div class=\"report-section\">\n <h2>Key Findings</h2>\n <h3>Nutritional Composition</h3>\n <p>Carrots contain high levels of vitamin A, antioxidants, and beta-carotene, which play a significant role in vision health \n <a href=\"https://example.com\" target=\"_blank\">[1]</a>.</p>\n\n <h3>Scientific Studies on Vision Benefits</h3>\n <p>Recent studies have examined the link between carrot consumption and reduced risk of age-related eye diseases \n <a href=\"https://example.com\" target=\"_blank\">[2]</a>.</p>\n </div>\n\n <div class=\"report-section\">\n <h2>Conclusion</h2>\n <p>Based on extensive research, carrots do contribute positively to vision health due to their high beta-carotene content. \n However, their benefits should be seen as part of a balanced diet rather than a standalone solution.</p>\n </div>\n\n</body>\n</html>"
},
"promptType": "define"
},
"typeVersion": 1.8
},
{
"id": "1ab62eb7-cda3-4588-9e5d-85e3d4c41626",
"name": "Aggregate7",
"type": "n8n-nodes-base.aggregate",
"position": [
1296,
2288
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "numberedUrl"
}
]
}
},
"typeVersion": 1
},
{
"id": "7a40f142-4426-492a-8ffe-a83b73d9aca3",
"name": "Merge6",
"type": "n8n-nodes-base.merge",
"position": [
1472,
2304
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineByPosition"
},
"typeVersion": 3
},
{
"id": "abfe7885-b278-4b6a-9b69-4f693bf26b11",
"name": "OpenRouter Chat Model6",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
816,
3040
],
"parameters": {
"model": "google/gemini-3-pro-preview",
"options": {}
},
"credentials": {
"openRouterApi": {
"id": "mTN0GOF1NYXFOPKG",
"name": "OpenRouter account"
}
},
"typeVersion": 1
},
{
"id": "a4c2d5ad-5ab8-4d7b-8a2c-7f36c1fab399",
"name": "Google Sheets5",
"type": "n8n-nodes-base.googleSheets",
"position": [
1952,
2800
],
"parameters": {
"columns": {
"value": {
"Search Topic": "={{ $('On form submission').first().json['Search Topic'] }}",
"Topic 5 Content": "={{ $('Merge7').first().json.output.join(\"\\n \\n\") }}",
"Topic 5 Sources": "={{ $('Merge7').first().json.numberedUrl.join(\"\\n\") }}",
"Topic 5 Sections": "={{ $json.sections.join(\"\\n\") }}"
},
"schema": [
{
"id": "Search Topic",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Search Topic",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Title",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Introduction",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Introduction",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 1",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 1",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 2",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 2",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 3",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 3",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 4",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 4",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 5",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 5",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 1 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 1 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 1 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 2 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 2 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 2 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 3 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 3 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 3 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 4 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 4 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 4 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Sources",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Topic 5 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Sections",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Topic 5 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Content",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Topic 5 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ToC",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "ToC",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "number",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Search Topic"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw/edit?usp=drivesdk",
"cachedResultName": "Copy of Deep Research Template (file -> make a copy)"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "qVntjW61XxH91qGU",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5,
"alwaysOutputData": true
},
{
"id": "358d3faa-5c52-45b4-995e-61df3d658d58",
"name": "Tavily4",
"type": "n8n-nodes-base.httpRequest",
"position": [
384,
2784
],
"parameters": {
"url": "https://api.tavily.com/search",
"method": "POST",
"options": {},
"jsonBody": "={\n \"query\": \"{{ $json.output }}\",\n \"topic\": \"general\",\n \"search_depth\": \"advanced\",\n \"chunks_per_source\": 3,\n \"max_results\": 5\n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpBearerAuth"
},
"credentials": {
"tavilyApi": {
"id": "GsoWv8ijASHYumaZ",
"name": "Tavily account"
},
"httpBearerAuth": {
"id": "yIRLEMTLlP5vUNSx",
"name": "Tavily Token"
},
"httpHeaderAuth": {
"id": "bU5Qf0UOdsicB1SX",
"name": "Unipile"
}
},
"typeVersion": 4.2
},
{
"id": "60f3da2f-3723-4c58-9758-e4720086c466",
"name": "Split Out6",
"type": "n8n-nodes-base.splitOut",
"position": [
576,
2784
],
"parameters": {
"options": {},
"fieldToSplitOut": "results"
},
"typeVersion": 1
},
{
"id": "03b6fcf9-ace2-47db-9d3e-281cb98704d3",
"name": "Code4",
"type": "n8n-nodes-base.code",
"position": [
784,
2784
],
"parameters": {
"jsCode": "// Create separate items for each URL starting from number 6\n\n// Transform the input items to create numbered URLs\n// Start counting from 6 and increment by 1\nreturn items.map((item, index) => {\n const number = index + 21; // Start at 6 instead of 1\n \n return {\n json: {\n number: number,\n url: item.json.url,\n numberedUrl: `${number}. ${item.json.url}`\n }\n };\n});"
},
"typeVersion": 2
},
{
"id": "e59e668f-6732-4edd-98e7-f8cd42a18d84",
"name": "Aggregate8",
"type": "n8n-nodes-base.aggregate",
"position": [
1296,
2928
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "output"
}
]
}
},
"typeVersion": 1
},
{
"id": "95a54452-d398-49e5-a807-aae6fc1048cc",
"name": "Writer4",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
960,
2928
],
"parameters": {
"text": "=Title: {{ $('Split Out6').item.json.title }}\n\nResearch: \n{{ $('Split Out6').item.json.content }}\n\nSource:\n{{ $json.numberedUrl }}\n\nStyle Guide Example:\n{{ $('Switch').first().json.Introduction }}",
"options": {
"systemMessage": "=# Overview\nYou are an advanced AI research assistant specializing in writing professional HTML reports based on a provided title, research, source, and a given style guide. Your task is to generate a fully formatted HTML report that is both visually appealing and structured according to professional writing standards.\n\n## Report Generation Guidelines\n1. Adherence to Style Guide\n- The report must strictly follow the provided HTML style guide, ensuring consistent styling, colors, fonts, padding, and layout.\n\n2. Structure & Formatting\n- The report should be well-structured and formatted in professional HTML.\n- Title (<h1>) – Provided as \"Title\"\n- Content Body – Fully formatted research content with proper sectioning (<h2>, <h3>, <p>).\n- Each section should be wrapped in a div styled according to the provided guide to ensure consistency.\n- Use <p> for paragraphs, <ul>/<ol> for lists, and <hr> to separate sections when necessary.\n- No Overview or Conclusion headers are necessary, just output a full report.\n- Horizontal Line (<hr>) should be used to separate sections for better visual clarity.\n\n3. Research-Based Content\n- Synthesize information logically and ensure the report is well-researched, factual, and professionally written.\n- Use informative writing. Provide as much detail as possible.\n- Maintain a logical progression of ideas, summarizing key points effectively.\n\n4. Source Attribution & Clickable Links\n- Use the number given in front of the source as the clickable attribute in the report.\n- Source links must be inline within the text using: <a href=\"SOURCE_URL\" target=\"_blank\">[1]</a>\n- Do not include a \"References\" section—instead, all sources should be embedded within the content.\n\n## Example Output Structure (Applying Style Guide)\n<!DOCTYPE html>\n<html>\n<head>\n <title>Research Report: [Title]</title>\n <style>\n body { font-family: Arial, sans-serif; line-height: 1.6; margin: 20px; }\n h1, h2, h3 { color: #333; }\n .report-section { background-color: #f4f4f4; padding: 20px; font-size: 16px; line-height: 1.6; color: #333; margin-bottom: 10px; }\n </style>\n</head>\n<body>\n\n <div class=\"report-section\">\n <h1>Research Report: [Title]</h1>\n </div>\n\n <div class=\"report-section\">\n <h2>Introduction</h2>\n <p>The connection between carrots and vision health has long been a subject of both scientific inquiry and popular wisdom. \n From wartime propaganda to modern nutritional science, these vibrant orange vegetables have maintained their reputation as \n nature's answer to eye health maintenance.</p>\n <hr>\n <p>This report systematically explores five key aspects of the carrot-vision relationship, including their nutritional profile, \n beta-carotene's role, scientific studies, and comparative benefits with other eye-healthy vegetables.</p>\n </div>\n\n <div class=\"report-section\">\n <h2>Key Findings</h2>\n <h3>Nutritional Composition</h3>\n <p>Carrots contain high levels of vitamin A, antioxidants, and beta-carotene, which play a significant role in vision health \n <a href=\"https://example.com\" target=\"_blank\">[1]</a>.</p>\n\n <h3>Scientific Studies on Vision Benefits</h3>\n <p>Recent studies have examined the link between carrot consumption and reduced risk of age-related eye diseases \n <a href=\"https://example.com\" target=\"_blank\">[2]</a>.</p>\n </div>\n\n <div class=\"report-section\">\n <h2>Conclusion</h2>\n <p>Based on extensive research, carrots do contribute positively to vision health due to their high beta-carotene content. \n However, their benefits should be seen as part of a balanced diet rather than a standalone solution.</p>\n </div>\n\n</body>\n</html>"
},
"promptType": "define"
},
"typeVersion": 1.8
},
{
"id": "c8d9f803-3735-4b5a-8cab-6ac1d6c65807",
"name": "Aggregate9",
"type": "n8n-nodes-base.aggregate",
"position": [
1296,
2784
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "numberedUrl"
}
]
}
},
"typeVersion": 1
},
{
"id": "ec4ba676-c03a-42f7-8bb7-651c8e7ef649",
"name": "Merge7",
"type": "n8n-nodes-base.merge",
"position": [
1472,
2800
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineByPosition"
},
"typeVersion": 3
},
{
"id": "79dae0f4-d793-44b5-b409-8cabeb342ae9",
"name": "Get Sources",
"type": "n8n-nodes-base.googleSheets",
"position": [
2896,
736
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupValue": "={{ $('On form submission').first().json['Search Topic'] }}",
"lookupColumn": "Search Topic"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw/edit?usp=drivesdk",
"cachedResultName": "Copy of Deep Research Template (file -> make a copy)"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "qVntjW61XxH91qGU",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5,
"alwaysOutputData": true
},
{
"id": "b157d13b-68fb-4d2d-be5a-b1763115bd05",
"name": "Limit",
"type": "n8n-nodes-base.limit",
"position": [
2704,
736
],
"parameters": {},
"typeVersion": 1
},
{
"id": "cfb80a10-aaa4-4e70-a20d-a07a1a43ef35",
"name": "OpenRouter Chat Model7",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
3680,
1024
],
"parameters": {
"model": "anthropic/claude-sonnet-4.5",
"options": {}
},
"credentials": {
"openRouterApi": {
"id": "mTN0GOF1NYXFOPKG",
"name": "OpenRouter account"
}
},
"typeVersion": 1
},
{
"id": "0d271410-7b5c-4db6-a8b1-a46ee1b7d96d",
"name": "Sources",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
3104,
736
],
"parameters": {
"text": "=Sources\n{{ $json['Topic 1 Sources'] }}\n{{ $json['Topic 2 Sources'] }}\n{{ $json['Topic 3 Sources'] }}\n{{ $json['Topic 4 Sources'] }}\n{{ $json['Topic 5 Sources'] }}",
"options": {
"systemMessage": "=# Overview\nYou are an AI assistant specializing in generating well-formatted HTML source sections for research reports. You will be given a list of sources, each with an associated number. Your task is to generate an HTML-formatted \"Sources\" section where:\n1) Each source is displayed with its original number in brackets [ ].\n2) Each source is a clickable hyperlink that opens in a new tab when clicked.\n3) The list is structured in an ordered format (<ul> or <ol>) for clarity and readability.\n\n## Formatting Guidelines:\n- The section title should be <h2>Sources</h2>.\n- Use an unordered list (<ul>) to display the sources.\n- Each source should be in the format:\n<li><a href=\"SOURCE_URL\" target=\"_blank\">[NUMBER] Source Title</a></li>\nThe original numbering of the sources must be preserved.\n\n## Example Output Structure:\n<div class=\"sources-section\">\n <h2>Sources</h2>\n <ul>\n <li><a href=\"https://example1.com\" target=\"_blank\">[1] Research on AI Development</a></li>\n <li><a href=\"https://example2.com\" target=\"_blank\">[2] The Impact of Automation</a></li>\n <li><a href=\"https://example3.com\" target=\"_blank\">[3] Machine Learning Trends</a></li>\n </ul>\n</div>"
},
"promptType": "define"
},
"typeVersion": 1.8
},
{
"id": "1057e751-2f32-427c-be96-071fa5a6f0c5",
"name": "Send Sources",
"type": "n8n-nodes-base.googleSheets",
"position": [
3424,
736
],
"parameters": {
"columns": {
"value": {
"Sources": "={{ $json.output }}",
"Search Topic": "={{ $('On form submission').first().json['Search Topic'] }}"
},
"schema": [
{
"id": "Search Topic",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Search Topic",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Title",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Introduction",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Introduction",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 1",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 1",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 2",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 2",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 3",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 3",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 4",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 4",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 5",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 5",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 1 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 1 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 1 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 2 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 2 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 2 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 3 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 3 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 3 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 4 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 4 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 4 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 5 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 5 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 5 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Sources",
"type": "string",
"display": true,
"required": false,
"displayName": "Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ToC",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "ToC",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "number",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Search Topic"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLtek-h9e_Std_lfAG8NIG0TsX3yraYKy3kxJWZ2Av4/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw/edit?usp=drivesdk",
"cachedResultName": "Copy of Deep Research Template (file -> make a copy)"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "qVntjW61XxH91qGU",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5,
"alwaysOutputData": true
},
{
"id": "fe8d44e7-74d3-4d4f-bd18-16e487ecc905",
"name": "Get All Content",
"type": "n8n-nodes-base.googleSheets",
"position": [
3616,
736
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupValue": "={{ $('On form submission').first().json['Search Topic'] }}",
"lookupColumn": "Search Topic"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw/edit?usp=drivesdk",
"cachedResultName": "Copy of Deep Research Template (file -> make a copy)"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "qVntjW61XxH91qGU",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5
},
{
"id": "bb1adcac-fa66-4128-8963-ee62b4dbdafb",
"name": "Combine Content",
"type": "n8n-nodes-base.code",
"position": [
3424,
1008
],
"parameters": {
"jsCode": "// N8N Code Node to combine multiple fields into a single field with new lines\n\n// This code expects the input item to have the following fields:\n// - Title\n// - Introduction\n// - ToC (Table of Contents)\n// - Chapter 1\n// - Topic 1 Content\n// - Chapter 2\n// - Topic 2 Content\n// - Chapter 3\n// - Topic 3 Content\n// - Chapter 4\n// - Topic 4 Content\n// - Chapter 5\n// - Topic 5 Content\n// - Sources\n\n// Access the incoming data\nconst item = items[0];\n\n// Create a new field called \"CombinedContent\" that joins all fields with newlines\nconst combinedContent = [\n item.json.Title || '',\n item.json.Introduction || '',\n item.json.ToC || '',\n item.json['Chapter 1'] || '',\n item.json['Topic 1 Content'] || '',\n item.json['Chapter 2'] || '',\n item.json['Topic 2 Content'] || '',\n item.json['Chapter 3'] || '',\n item.json['Topic 3 Content'] || '',\n item.json['Chapter 4'] || '',\n item.json['Topic 4 Content'] || '',\n item.json['Chapter 5'] || '',\n item.json['Topic 5 Content'] || '',\n item.json.Sources || ''\n].join('\\n\\n');\n\n// Add the combined content to the item\nitem.json.CombinedContent = combinedContent;\n\n// Return the modified item\nreturn [item];"
},
"typeVersion": 2
},
{
"id": "2bca6f10-36a0-4217-b6ad-d5fa7253980b",
"name": "Download PDF",
"type": "n8n-nodes-base.httpRequest",
"position": [
2864,
1248
],
"parameters": {
"url": "={{ $json.download_url }}",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "6f0827b9-9ce9-434f-9a63-8937d438a19a",
"name": "Merge2",
"type": "n8n-nodes-base.merge",
"position": [
2432,
800
],
"parameters": {
"numberInputs": 5
},
"typeVersion": 3
},
{
"id": "a4396bab-01c7-4c6a-8b31-c6f9909a3f93",
"name": "Send Report",
"type": "n8n-nodes-base.gmail",
"position": [
3056,
1248
],
"webhookId": "e066c2ef-6c8c-413e-a70e-05c88f29b9f6",
"parameters": {
"sendTo": "={{ $('On form submission').first().json.Email }}",
"message": "=Your Deep Research Report on {{ $('On form submission').first().json['Search Topic'] }} is complete.\n\nYou can find it attached below.",
"options": {
"attachmentsUi": {
"attachmentsBinary": [
{}
]
},
"appendAttribution": false
},
"subject": "=Deep Research Report: {{ $('On form submission').first().json['Search Topic'] }}",
"emailType": "text"
},
"credentials": {
"gmailOAuth2": {
"id": "EwXXtt2Nq8R5cHzM",
"name": "Gmail account"
}
},
"typeVersion": 2.1
},
{
"id": "b4eb98b4-9b95-4e67-aae8-b608748d9ac2",
"name": "HTML",
"type": "n8n-nodes-base.html",
"position": [
1632,
784
],
"parameters": {
"options": {},
"operation": "extractHtmlContent",
"dataPropertyName": "output",
"extractionValues": {
"values": [
{
"key": "section",
"cssSelector": "title"
}
]
}
},
"typeVersion": 1.2
},
{
"id": "9fce9652-b259-40ff-ba4a-9a863f968249",
"name": "Combine",
"type": "n8n-nodes-base.code",
"position": [
1792,
784
],
"parameters": {
"jsCode": "return [{\n sections: $input.all().map(item => item.json.section)\n}];\n"
},
"typeVersion": 2
},
{
"id": "a06d5c0b-b560-4f79-baa4-d5c7449fbb19",
"name": "HTML1",
"type": "n8n-nodes-base.html",
"position": [
1632,
1280
],
"parameters": {
"options": {},
"operation": "extractHtmlContent",
"dataPropertyName": "output",
"extractionValues": {
"values": [
{
"key": "section",
"cssSelector": "title"
}
]
}
},
"typeVersion": 1.2
},
{
"id": "66b4a7e2-8945-423e-a364-f8dee7174f60",
"name": "Combine1",
"type": "n8n-nodes-base.code",
"position": [
1792,
1280
],
"parameters": {
"jsCode": "return [{\n sections: $input.all().map(item => item.json.section)\n}];\n"
},
"typeVersion": 2
},
{
"id": "0580e351-3f3d-4376-a5ba-54d03f0ed174",
"name": "HTML2",
"type": "n8n-nodes-base.html",
"position": [
1632,
1808
],
"parameters": {
"options": {},
"operation": "extractHtmlContent",
"dataPropertyName": "output",
"extractionValues": {
"values": [
{
"key": "section",
"cssSelector": "title"
}
]
}
},
"typeVersion": 1.2
},
{
"id": "f69b978a-01c0-45b0-8d20-6cbac0389087",
"name": "Combine2",
"type": "n8n-nodes-base.code",
"position": [
1792,
1808
],
"parameters": {
"jsCode": "return [{\n sections: $input.all().map(item => item.json.section)\n}];\n"
},
"typeVersion": 2
},
{
"id": "de707be1-7a35-409b-b0f6-cf0af202e237",
"name": "HTML3",
"type": "n8n-nodes-base.html",
"position": [
1632,
2304
],
"parameters": {
"options": {},
"operation": "extractHtmlContent",
"dataPropertyName": "output",
"extractionValues": {
"values": [
{
"key": "section",
"cssSelector": "title"
}
]
}
},
"typeVersion": 1.2
},
{
"id": "cc975d3b-9ce4-43bd-88df-c5c27ecd61c8",
"name": "Combine3",
"type": "n8n-nodes-base.code",
"position": [
1792,
2304
],
"parameters": {
"jsCode": "return [{\n sections: $input.all().map(item => item.json.section)\n}];\n"
},
"typeVersion": 2
},
{
"id": "3f8847aa-b80b-4268-bdfe-2ae90efdd27e",
"name": "HTML4",
"type": "n8n-nodes-base.html",
"position": [
1632,
2800
],
"parameters": {
"options": {},
"operation": "extractHtmlContent",
"dataPropertyName": "output",
"extractionValues": {
"values": [
{
"key": "section",
"cssSelector": "title"
}
]
}
},
"typeVersion": 1.2
},
{
"id": "3c5b5fa9-dd04-49ee-b0b4-579d7fdcbd2c",
"name": "Combine4",
"type": "n8n-nodes-base.code",
"position": [
1792,
2800
],
"parameters": {
"jsCode": "return [{\n sections: $input.all().map(item => item.json.section)\n}];\n"
},
"typeVersion": 2
},
{
"id": "264b7ddf-81eb-439e-8476-1ca1175e2d0a",
"name": "Table of Contents",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
2656,
1008
],
"parameters": {
"text": "=Chapter 1: {{ $('Plan Topics').first().json.output.topic_1 }}\nSections:\n{{ $json['Topic 1 Sections']}}\n\nChapter 2: {{ $('Plan Topics').first().json.output.topic_2 }}\nSections:\n{{ $json['Topic 2 Sections'] }}\n\nChapter 3: {{ $('Plan Topics').first().json.output.topic_3 }}\nSections:\n{{ $json['Topic 3 Sections'] }}\n\nChapter 4: {{ $('Plan Topics').first().json.output.topic_4 }}\nSections:\n{{ $json['Topic 4 Sections'] }}\n\nChapter 5: {{ $('Plan Topics').first().json.output.topic_5 }}\nSections:\n{{ $json['Topic 5 Sections'] }}\n\nStyle Guide:\n{{ $json.Introduction }}",
"options": {
"systemMessage": "=# Overview\nYou are an AI assistant tasked with creating a structured Table of Contents (ToC) in professional HTML formatting for a research report. Your output must follow the provided style guide and be clean, readable, and well-structured.\n\n## Guidelines\n1) Format Chapters as <h2> Elements\n- Each chapter should be a distinct <h2> heading.\n2) Format Sections as an Ordered List (<ol>)\n- Each section under a chapter should be a list item (<li>) inside an <ol>.\n- Maintain clear hierarchy and indentation for readability.\n3) Apply Given Style Guide\n- Wrap the ToC in a <div> with the same padding, font size, and color as the style guide.\n- Add a horizontal rule (<hr>) for separation.\n\n## Example Output\n\n<div style=\"background-color: #f4f4f4; padding: 20px; font-size: 16px; line-height: 1.6; color: #333;\">\n <h2>Table of Contents</h2>\n <hr>\n <ol>\n <li>\n <h2>Chapter 1: Introduction</h2>\n <ol>\n <li>Background and Importance</li>\n <li>Research Goals</li>\n </ol>\n </li>\n <li>\n <h2>Chapter 2: Nutritional Science of Carrots</h2>\n <ol>\n <li>Vitamin A and Vision Health</li>\n <li>Antioxidants in Carrots</li>\n <li>Other Essential Nutrients</li>\n </ol>\n </li>\n </ol>\n</div>"
},
"promptType": "define"
},
"typeVersion": 1.8
},
{
"id": "dc737bc1-07d6-4b3c-b095-26f2e13edf9b",
"name": "Send ToC",
"type": "n8n-nodes-base.googleSheets",
"position": [
3024,
1008
],
"parameters": {
"columns": {
"value": {
"ToC": "={{ $json.output }}",
"Search Topic": "={{ $('On form submission').first().json['Search Topic'] }}"
},
"schema": [
{
"id": "Search Topic",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Search Topic",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Title",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Introduction",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Introduction",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 1",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 1",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 2",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 2",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 3",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 3",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 4",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 4",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 5",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 5",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 1 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 1 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 1 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 2 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 2 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 2 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 3 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 3 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 3 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 4 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 4 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 4 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 5 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 5 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 5 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ToC",
"type": "string",
"display": true,
"required": false,
"displayName": "ToC",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "number",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Search Topic"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLtek-h9e_Std_lfAG8NIG0TsX3yraYKy3kxJWZ2Av4/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw/edit?usp=drivesdk",
"cachedResultName": "Copy of Deep Research Template (file -> make a copy)"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "qVntjW61XxH91qGU",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5
},
{
"id": "0e8717b4-a2c4-451e-b61a-663d5b38d69c",
"name": "Send Intro",
"type": "n8n-nodes-base.googleSheets",
"position": [
-544,
1136
],
"parameters": {
"columns": {
"value": {
"Title": "={{ $json.output.title }}",
"Chapter 1": "={{ $json.output.chapter_1 }}",
"Chapter 2": "={{ $json.output.chapter_2 }}",
"Chapter 3": "={{ $json.output.chapter_3 }}",
"Chapter 4": "={{ $json.output.chapter_4 }}",
"Chapter 5": "={{ $json.output.chapter_5 }}",
"Introduction": "={{ $json.output.introduction }}",
"Search Topic": "={{ $('On form submission').item.json['Search Topic'] }}"
},
"schema": [
{
"id": "Search Topic",
"type": "string",
"display": true,
"required": false,
"displayName": "Search Topic",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Title",
"type": "string",
"display": true,
"required": false,
"displayName": "Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Introduction",
"type": "string",
"display": true,
"required": false,
"displayName": "Introduction",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 1",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Chapter 1",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 2",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Chapter 2",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 3",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Chapter 3",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 4",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Chapter 4",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 5",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Chapter 5",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 1 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 1 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 1 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 2 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 2 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 2 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 3 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 3 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 3 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 4 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 4 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 4 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 5 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 5 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 5 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ToC",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "ToC",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLtek-h9e_Std_lfAG8NIG0TsX3yraYKy3kxJWZ2Av4/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw/edit?usp=drivesdk",
"cachedResultName": "Copy of Deep Research Template (file -> make a copy)"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "qVntjW61XxH91qGU",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5
},
{
"id": "7de3b1e6-0709-409a-8682-5f650ce193ba",
"name": "Title, Intro, Chapters",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
-688,
1376
],
"parameters": {
"jsonSchemaExample": "{\n \"title\": \"<Generated Report Title>\",\n \"introduction\": \"<Generated Introduction>\",\n \"chapter_1\": \"<h2>Chapter 1: [Title]</h2>\",\n \"chapter_2\": \"<h2>Chapter 2: [Title]</h2>\",\n \"chapter_3\": \"<h2>Chapter 3: [Title]</h2>\",\n \"chapter_4\": \"<h2>Chapter 4: [Title]</h2>\",\n \"chapter_5\": \"<h2>Chapter 5: [Title]</h2>\"\n}\n"
},
"typeVersion": 1.2
},
{
"id": "1f134efa-051d-4f3d-8a0e-b10ee2d00589",
"name": "Get All Content1",
"type": "n8n-nodes-base.googleSheets",
"position": [
3200,
1008
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupValue": "={{ $('On form submission').first().json['Search Topic'] }}",
"lookupColumn": "Search Topic"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw/edit?usp=drivesdk",
"cachedResultName": "Copy of Deep Research Template (file -> make a copy)"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "qVntjW61XxH91qGU",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5
},
{
"id": "e415d4e5-55ba-437c-aa43-073fcbe83cb5",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1728,
656
],
"parameters": {
"color": 4,
"width": 1800,
"height": 1000,
"content": "# Planning Stage\n"
},
"typeVersion": 1
},
{
"id": "c61e31ed-44c1-4960-ae48-480c76182d2f",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
112,
656
],
"parameters": {
"color": 5,
"width": 2140,
"height": 500,
"content": "# Chapter 1\n"
},
"typeVersion": 1
},
{
"id": "4eb10693-c677-42ad-8c4b-10770a036b19",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
112,
1184
],
"parameters": {
"width": 2140,
"height": 480,
"content": "# Chapter 2\n"
},
"typeVersion": 1
},
{
"id": "ad219985-e9aa-4ce0-a39c-b8be85453a6b",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
112,
1680
],
"parameters": {
"color": 5,
"width": 2140,
"height": 500,
"content": "# Chapter 3\n"
},
"typeVersion": 1
},
{
"id": "cfe05023-a7b0-4870-8cf0-43366ff8b30e",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
112,
2208
],
"parameters": {
"width": 2140,
"height": 480,
"content": "# Chapter 4\n"
},
"typeVersion": 1
},
{
"id": "e1d1afd5-1cdf-4e49-92eb-567c99d2ff9a",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
112,
2704
],
"parameters": {
"color": 5,
"width": 2140,
"height": 500,
"content": "# Chapter 5\n"
},
"typeVersion": 1
},
{
"id": "d3a59bea-7fa5-40d1-84c2-4915a12d1b06",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
2272,
656
],
"parameters": {
"color": 4,
"width": 1580,
"height": 500,
"content": "# Finalize Content"
},
"typeVersion": 1
},
{
"id": "0efdfa17-a71c-4cd2-850f-481da9996691",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
2272,
1184
],
"parameters": {
"color": 6,
"width": 1080,
"height": 240,
"content": "# Generate PDF"
},
"typeVersion": 1
},
{
"id": "614e5c26-4980-4acf-99c3-f2febee3a62f",
"name": "Generate PDF",
"type": "n8n-nodes-base.httpRequest",
"position": [
2672,
1248
],
"parameters": {
"url": "https://rest-us.apitemplate.io/v2/create-pdf-from-html",
"method": "POST",
"options": {},
"jsonBody": "={\n \"body\": \"{{$json[\"CombinedContent\"].replace(/\"/g, '\\\\\"').replace(/\\n/g, '\\\\n')}}\",\n \"css\": \"<style>.bg{background: red};</style>\",\n \"data\": {\n \"name\": \"This is a title\"\n },\n \"settings\": {\n \"paper_size\": \"A4\",\n \"orientation\": \"1\",\n \"header_font_size\": \"9px\",\n \"margin_top\": \"40\",\n \"margin_right\": \"10\",\n \"margin_bottom\": \"40\",\n \"margin_left\": \"10\",\n \"print_background\": \"1\",\n \"displayHeaderFooter\": true,\n \"custom_header\": \"<style>#header, #footer { padding: 0 !important; }</style>\\n<table style=\\\"width: 100%; padding: 0px 5px;margin: 0px!important;font-size: 8px\\\">\\n <tr>\\n <td style=\\\"text-align:left; width:30%!important;\\\"><span class=\\\"date\\\"></span></td>\\n <td style=\\\"text-align:center; width:30%!important;\\\"><span class=\\\"pageNumber\\\"></span></td>\\n <td style=\\\"text-align:right; width:30%!important;\\\"><span class=\\\"totalPages\\\"></span></td>\\n </tr>\\n</table>\",\n \"custom_footer\": \"<style>#header, #footer { padding: 0 !important; }</style>\\n<table style=\\\"width: 100%; padding: 0px 5px;margin: 0px!important;font-size: 8px\\\">\\n <tr>\\n <td style=\\\"text-align:left; width:30%!important;\\\"><span class=\\\"date\\\"></span></td>\\n <td style=\\\"text-align:center; width:30%!important;\\\"><span class=\\\"pageNumber\\\"></span></td>\\n <td style=\\\"text-align:right; width:30%!important;\\\"><span class=\\\"totalPages\\\"></span></td>\\n </tr>\\n</table>\"\n }\n}",
"sendBody": true,
"sendQuery": true,
"specifyBody": "json",
"authentication": "predefinedCredentialType",
"queryParameters": {
"parameters": [
{
"name": "filename",
"value": "={{ $('On form submission').first().json['Search Topic'] }}.pdf"
}
]
},
"nodeCredentialType": "apiTemplateIoApi"
},
"credentials": {
"apiTemplateIoApi": {
"id": "9SoEOHqR1OW6DqJO",
"name": "APITemplate.io account"
}
},
"typeVersion": 4.2
},
{
"id": "32b13801-47f9-4608-bf10-53b121848e97",
"name": "Google Sheets10",
"type": "n8n-nodes-base.googleSheets",
"position": [
1952,
784
],
"parameters": {
"columns": {
"value": {
"Search Topic": "={{ $('On form submission').first().json['Search Topic'] }}",
"Topic 1 Content": "={{ $('Merge3').first().json.output.join(\"\\n \\n\") }}",
"Topic 1 Sources": "={{ $('Merge3').first().json.numberedUrl.join(\"\\n\") }}",
"Topic 1 Sections": "={{ $json.sections.join(\"\\n\") }}"
},
"schema": [
{
"id": "Search Topic",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Search Topic",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Title",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Introduction",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Introduction",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 1",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 1",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 2",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 2",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 3",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 3",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 4",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 4",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter 5",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Chapter 5",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Sources",
"type": "string",
"display": true,
"required": false,
"displayName": "Topic 1 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Sections",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Topic 1 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 1 Content",
"type": "string",
"display": true,
"required": false,
"displayName": "Topic 1 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 2 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 2 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 2 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 2 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 3 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 3 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 3 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 3 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 4 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 4 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 4 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 4 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 5 Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Sections",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 5 Sections",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Topic 5 Content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Topic 5 Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Sources",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Sources",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ToC",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "ToC",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "number",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Search Topic"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLtek-h9e_Std_lfAG8NIG0TsX3yraYKy3kxJWZ2Av4/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1CkeR3A45n_KD8IAFMtmNbj9PlkKxmR8kkv2vUlSkZgw/edit?usp=drivesdk",
"cachedResultName": "Copy of Deep Research Template (file -> make a copy)"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "qVntjW61XxH91qGU",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5,
"alwaysOutputData": true
}
],
"pinData": {},
"connections": {
"Code": {
"main": [
[
{
"node": "Writer",
"type": "main",
"index": 0
},
{
"node": "Aggregate1",
"type": "main",
"index": 0
}
]
]
},
"HTML": {
"main": [
[
{
"node": "Combine",
"type": "main",
"index": 0
}
]
]
},
"Code1": {
"main": [
[
{
"node": "Writer1",
"type": "main",
"index": 0
},
{
"node": "Aggregate3",
"type": "main",
"index": 0
}
]
]
},
"Code2": {
"main": [
[
{
"node": "Writer2",
"type": "main",
"index": 0
},
{
"node": "Aggregate5",
"type": "main",
"index": 0
}
]
]
},
"Code3": {
"main": [
[
{
"node": "Writer3",
"type": "main",
"index": 0
},
{
"node": "Aggregate7",
"type": "main",
"index": 0
}
]
]
},
"Code4": {
"main": [
[
{
"node": "Writer4",
"type": "main",
"index": 0
},
{
"node": "Aggregate9",
"type": "main",
"index": 0
}
]
]
},
"HTML1": {
"main": [
[
{
"node": "Combine1",
"type": "main",
"index": 0
}
]
]
},
"HTML2": {
"main": [
[
{
"node": "Combine2",
"type": "main",
"index": 0
}
]
]
},
"HTML3": {
"main": [
[
{
"node": "Combine3",
"type": "main",
"index": 0
}
]
]
},
"HTML4": {
"main": [
[
{
"node": "Combine4",
"type": "main",
"index": 0
}
]
]
},
"Intro": {
"main": [
[
{
"node": "Send Intro",
"type": "main",
"index": 0
}
]
]
},
"Limit": {
"main": [
[
{
"node": "Get Sources",
"type": "main",
"index": 0
}
]
]
},
"Merge": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"Merge1": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Merge2": {
"main": [
[
{
"node": "Limit",
"type": "main",
"index": 0
}
]
]
},
"Merge3": {
"main": [
[
{
"node": "HTML",
"type": "main",
"index": 0
}
]
]
},
"Merge4": {
"main": [
[
{
"node": "HTML1",
"type": "main",
"index": 0
}
]
]
},
"Merge5": {
"main": [
[
{
"node": "HTML2",
"type": "main",
"index": 0
}
]
]
},
"Merge6": {
"main": [
[
{
"node": "HTML3",
"type": "main",
"index": 0
}
]
]
},
"Merge7": {
"main": [
[
{
"node": "HTML4",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "Tavily",
"type": "main",
"index": 0
}
],
[
{
"node": "Tavily1",
"type": "main",
"index": 0
}
],
[
{
"node": "Tavily2",
"type": "main",
"index": 0
}
],
[
{
"node": "Tavily3",
"type": "main",
"index": 0
}
],
[
{
"node": "Tavily4",
"type": "main",
"index": 0
}
]
]
},
"Tavily": {
"main": [
[
{
"node": "Split Out2",
"type": "main",
"index": 0
}
]
]
},
"Writer": {
"main": [
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
]
]
},
"Combine": {
"main": [
[
{
"node": "Google Sheets10",
"type": "main",
"index": 0
}
]
]
},
"Sources": {
"main": [
[
{
"node": "Send Sources",
"type": "main",
"index": 0
}
]
]
},
"Tavily1": {
"main": [
[
{
"node": "Split Out3",
"type": "main",
"index": 0
}
]
]
},
"Tavily2": {
"main": [
[
{
"node": "Split Out4",
"type": "main",
"index": 0
}
]
]
},
"Tavily3": {
"main": [
[
{
"node": "Split Out5",
"type": "main",
"index": 0
}
]
]
},
"Tavily4": {
"main": [
[
{
"node": "Split Out6",
"type": "main",
"index": 0
}
]
]
},
"Writer1": {
"main": [
[
{
"node": "Aggregate2",
"type": "main",
"index": 0
}
]
]
},
"Writer2": {
"main": [
[
{
"node": "Aggregate4",
"type": "main",
"index": 0
}
]
]
},
"Writer3": {
"main": [
[
{
"node": "Aggregate6",
"type": "main",
"index": 0
}
]
]
},
"Writer4": {
"main": [
[
{
"node": "Aggregate8",
"type": "main",
"index": 0
}
]
]
},
"5 Topics": {
"ai_outputParser": [
[
{
"node": "Plan Topics",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Combine1": {
"main": [
[
{
"node": "Google Sheets2",
"type": "main",
"index": 0
}
]
]
},
"Combine2": {
"main": [
[
{
"node": "Google Sheets3",
"type": "main",
"index": 0
}
]
]
},
"Combine3": {
"main": [
[
{
"node": "Google Sheets4",
"type": "main",
"index": 0
}
]
]
},
"Combine4": {
"main": [
[
{
"node": "Google Sheets5",
"type": "main",
"index": 0
}
]
]
},
"Send ToC": {
"main": [
[
{
"node": "Get All Content1",
"type": "main",
"index": 0
}
]
]
},
"Aggregate": {
"main": [
[
{
"node": "Merge3",
"type": "main",
"index": 1
}
]
]
},
"Split Out": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 1
}
]
]
},
"Aggregate1": {
"main": [
[
{
"node": "Merge3",
"type": "main",
"index": 0
}
]
]
},
"Aggregate2": {
"main": [
[
{
"node": "Merge4",
"type": "main",
"index": 1
}
]
]
},
"Aggregate3": {
"main": [
[
{
"node": "Merge4",
"type": "main",
"index": 0
}
]
]
},
"Aggregate4": {
"main": [
[
{
"node": "Merge5",
"type": "main",
"index": 1
}
]
]
},
"Aggregate5": {
"main": [
[
{
"node": "Merge5",
"type": "main",
"index": 0
}
]
]
},
"Aggregate6": {
"main": [
[
{
"node": "Merge6",
"type": "main",
"index": 1
}
]
]
},
"Aggregate7": {
"main": [
[
{
"node": "Merge6",
"type": "main",
"index": 0
}
]
]
},
"Aggregate8": {
"main": [
[
{
"node": "Merge7",
"type": "main",
"index": 1
}
]
]
},
"Aggregate9": {
"main": [
[
{
"node": "Merge7",
"type": "main",
"index": 0
}
]
]
},
"Send Intro": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Set Topics": {
"main": [
[
{
"node": "Split Out1",
"type": "main",
"index": 0
}
]
]
},
"Split Out1": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 0
}
]
]
},
"Split Out2": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Split Out3": {
"main": [
[
{
"node": "Code1",
"type": "main",
"index": 0
}
]
]
},
"Split Out4": {
"main": [
[
{
"node": "Code2",
"type": "main",
"index": 0
}
]
]
},
"Split Out5": {
"main": [
[
{
"node": "Code3",
"type": "main",
"index": 0
}
]
]
},
"Split Out6": {
"main": [
[
{
"node": "Code4",
"type": "main",
"index": 0
}
]
]
},
"Get Sources": {
"main": [
[
{
"node": "Sources",
"type": "main",
"index": 0
}
]
]
},
"Plan Topics": {
"main": [
[
{
"node": "Intro",
"type": "main",
"index": 0
},
{
"node": "Split Out",
"type": "main",
"index": 0
},
{
"node": "Set Topics",
"type": "main",
"index": 0
}
]
]
},
"Download PDF": {
"main": [
[
{
"node": "Send Report",
"type": "main",
"index": 0
}
]
]
},
"Generate PDF": {
"main": [
[
{
"node": "Download PDF",
"type": "main",
"index": 0
}
]
]
},
"Send Sources": {
"main": [
[
{
"node": "Get All Content",
"type": "main",
"index": 0
}
]
]
},
"Google Sheets2": {
"main": [
[
{
"node": "Merge2",
"type": "main",
"index": 1
}
]
]
},
"Google Sheets3": {
"main": [
[
{
"node": "Merge2",
"type": "main",
"index": 2
}
]
]
},
"Google Sheets4": {
"main": [
[
{
"node": "Merge2",
"type": "main",
"index": 3
}
]
]
},
"Google Sheets5": {
"main": [
[
{
"node": "Merge2",
"type": "main",
"index": 4
}
]
]
},
"Combine Content": {
"main": [
[
{
"node": "Generate PDF",
"type": "main",
"index": 0
}
]
]
},
"Get All Content": {
"main": [
[
{
"node": "Table of Contents",
"type": "main",
"index": 0
}
]
]
},
"Google Sheets10": {
"main": [
[
{
"node": "Merge2",
"type": "main",
"index": 0
}
]
]
},
"Get All Content1": {
"main": [
[
{
"node": "Combine Content",
"type": "main",
"index": 0
}
]
]
},
"Table of Contents": {
"main": [
[
{
"node": "Send ToC",
"type": "main",
"index": 0
}
]
]
},
"On form submission": {
"main": [
[
{
"node": "Plan Topics",
"type": "main",
"index": 0
}
]
]
},
"OpenRouter Chat Model": {
"ai_languageModel": [
[
{
"node": "Plan Topics",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenRouter Chat Model1": {
"ai_languageModel": [
[
{
"node": "Intro",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenRouter Chat Model2": {
"ai_languageModel": [
[
{
"node": "Writer",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenRouter Chat Model3": {
"ai_languageModel": [
[
{
"node": "Writer1",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenRouter Chat Model4": {
"ai_languageModel": [
[
{
"node": "Writer2",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenRouter Chat Model5": {
"ai_languageModel": [
[
{
"node": "Writer3",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenRouter Chat Model6": {
"ai_languageModel": [
[
{
"node": "Writer4",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenRouter Chat Model7": {
"ai_languageModel": [
[
{
"node": "Sources",
"type": "ai_languageModel",
"index": 0
},
{
"node": "Table of Contents",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Title, Intro, Chapters": {
"ai_outputParser": [
[
{
"node": "Intro",
"type": "ai_outputParser",
"index": 0
}
]
]
}
}
}