Deploy a self-hosted AI Deep Research Agent using n8n and OpenAI. This powerful n8n workflow performs recursive web searches, extracts data using Apify, and generates comprehensive reports in Notion.
Download this n8n workflow template and start using it instantly.























Data Analysts and Researchers needing automated, in-depth data collection.
Developers looking to build advanced AI agents using the n8n automation platform.
Users seeking to replicate OpenAI's 'Deep Research' feature using self-hosted or open source automation.
Technical users who require complex, asynchronous workflows leveraging n8n templates.
This comprehensive automation solution transforms a simple research prompt into a multi-stage, recursive investigation process, achieving in minutes what might take a human hours. The core value of this n8n workflow lies in its ability to dynamically generate follow-up research queries based on initial findings (breadth) and repeat the process across multiple iterations (depth). By integrating with cutting-edge LLMs (OpenAI) and specialized web scraping services (Apify), this n8n template ensures high-quality data collection. The final output is a structured, markdown-formatted report automatically uploaded to a user-defined Notion database, providing a seamless experience from prompt submission to final report delivery.
The process begins when a user submits a prompt via the n8n form trigger, defining the research query and two critical parameters: depth (number of research iterations) and breadth (number of sources/sub-queries per iteration).
Execute Workflow n8n node, allowing the initial user interaction to terminate quickly.JobType Router and Accumulate Results nodes. In each iteration, an LLM generates specific SERP queries based on the current prompt and all 'learnings' accumulated so far.DeepResearch Report), which produces a detailed report in Markdown format.Notion Block Generator), and uploaded sequentially to the Notion page created in step 2. Finally, the Notion entry's status is updated to 'Done', completing the n8n workflow.To deploy this powerful n8n workflow, follow these steps:
Create Row and Get Existing Row n8n nodes with your specific database ID.RAG Web Browser n8n node with your Apify credentials (Header Auth is recommended, often using a 'Bearer' token format).On form submission n8n trigger to initiate the research process. Ensure the 'Execute Workflow' n8n nodes reference the correct ID of the published workflow for proper asynchronous and recursive execution. On form submission (n8n trigger): The starting point of this n8n workflow. It collects the user's research query, desired depth, and breadth using a custom-styled form interface.
OpenAI Chat Model / Clarifying Questions (LLM Chain): Uses an OpenAI n8n node (o3-mini) with a structured output parser to determine if the initial prompt requires clarification, generating up to three follow-up questions.
Create Row (Notion n8n node): Creates the initial empty Notion database page to serve as the destination for the final report.
Initiate DeepResearch (Execute Workflow n8n node): Triggers an asynchronous, separate execution of this same n8n workflow, passing necessary initial data. This enables the recursive loop needed for deep research.
RAG Web Browser (HTTP Request n8n node): Calls the Apify RAG Web Browser actor. This n8n node performs the web search and content extraction, crucial for the data gathering phase of the n8n workflow.
DeepResearch Learnings (LLM Chain + Structured Output): This crucial component uses an OpenAI n8n node to process the raw markdown content scraped by Apify, synthesizing it into concise, structured 'learnings' and further follow-up questions.
Accumulate Results (Set n8n node): Manages the state of the recursive loop by collecting all learnings and URLs gathered across all iterations, and checks if the defined research depth has been reached.
DeepResearch Report (LLM Chain): The final LLM integration. This n8n node takes all accumulated 'learnings' and the original prompt to generate the comprehensive, multi-page report in Markdown format.
Notion Block Generator (Google Gemini Chat Model): A dedicated LLM model used to convert the generated Markdown/HTML report structure into the specific JSON block schema required by the Notion API for proper formatting.
Upload to Notion Page (HTTP Request n8n node): Directly interacts with the Notion API endpoint to sequentially patch the blocks (content) onto the previously created report page.
Use this comprehensive n8n workflow to create an intelligent AI Smart Home Agent powered by GPT-4. Execute commands for lighting, temperature, and devices via chained n8n templates.

Learn how to trigger an n8n workflow using Home Assistant events and AppDaemon. This n8n templates guide provides the secure Webhook n8n node setup for smart home automation.

Integrate a powerful n8n workflow to connect chat inputs to the Cerebras AI endpoint. Leverage the gpt-oss-120b model using this custom n8n template for high-speed LLM processing.

Learn how to build a robust, self-hosted website monitoring service using this powerful n8n workflow. Schedule site checks, log status changes, and send instant alerts via Gmail and Slack.

Use this essential n8n workflow to automate daily Hostinger VPS snapshots, extract server metrics (RAM, Disk, CPU), and receive real-time status alerts via WhatsApp.


Freelance consultant based in the UK specialising in AI-powered automations. I work with select clients tackling their most challenging projects. For business enquiries, send me an email at [email protected] LinkedIn: https://www.linkedin.com/in/jimleuk/ X/Twitter: https://x.com/jimle_uk







































