Deep Research Automation with n8n and OpenAI for In-Depth Reports

This workflow automates complex, multi-step deep research using n8n, OpenAI, and Apify, transforming user queries into comprehensive reports stored in Notion. It tackles the challenge of lengthy manual research, saving hours by recursively gathering and summarizing web data.
formTrigger
set
lmChatOpenAi
+16
Workflow Identifier: 1139
NODES in Use: formTrigger, set, lmChatOpenAi, chainLlm, outputParserStructured, form, splitOut, splitInBatches, executeWorkflowTrigger, executeWorkflow, noOp, if, filter, aggregate, stopAndError, notion, httpRequest, code, markdown
Automate deep research with n8n and OpenAI

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What This Automation Does

This workflow automates deep research from a user’s question to a detailed report saved in Notion.
It stops analysts from spending many hours searching and writing manually.
Users get fast, clear, and complete research reports without digging through many sites.

The process starts from a user prompt and loops through AI questions, web searches, and content extraction.
It gathers facts recursively, then writes a full report.
Finally, it uploads the report with sources to a Notion page.

This saves time, reduces errors, and gives consistent quality research results.
It works even if the user leaves the form after submitting.


Tools and Services Used

  • n8n: Workflow automation platform that manages all steps.
  • OpenAI API & LangChain LLM: Generates questions, queries, learnings, and the final report.
  • Apify API: Runs web searches and scrapes website contents programmatically.
  • Notion API: Saves research data and final reports into a Notion database.

Who Should Use This Workflow

This automation fits analysts and researchers who need deep, detailed info quickly.
It is for users who want to avoid manual web searching and writing.
Novices can use it without coding inside n8n once set up.

Businesses collecting research reports regularly gain time and better data.
The workflow works best when questions are complex and data volume is large.


Basic Inputs and Outputs

Inputs

  • User research prompt entered via an n8n form node.
  • Depth and breadth parameters chosen by the user to control search intensity.
  • Answers to AI-generated clarifying questions supplied by the user.

Processing Steps

  • Convert user prompt into recursive AI search queries.
  • Scrape web content for each search query using Apify.
  • Extract key learnings from scraped content via OpenAI models.
  • Repeat the search and learning cycle to desired depth.
  • Generate comprehensive markdown report from accumulated learnings.
  • Transform markdown into Notion blocks.
  • Upload structured report and sources to Notion page.

Outputs

  • Notion database entry with research title and status updates.
  • Notion page containing a formatted research report.
  • Bulleted list of source URLs appended at report end.

Beginner Step-by-Step: How to Build and Use This Workflow in n8n

Importing Workflow

  1. Download the workflow file using the Download button on this page.
  2. Open the n8n editor where you manage workflows.
  3. Choose Import from File and select the downloaded workflow.

Configuring Credentials and Settings

  1. Add OpenAI API Key in the credentials section.
  2. Insert Apify API Key with the “Bearer ” prefix for web scraping.
  3. Connect Notion with API Key and verify the database ID for reports.
  4. Update any placeholders like emails, folder IDs, or database properties if mentioned.

Testing and Activating the Workflow

  1. Run the workflow with a sample research prompt and low depth/breadth to test outputs.
  2. Check that results save properly in Notion with the correct status.
  3. Fix any credential errors or missing inputs if found.
  4. When confirmed working, enable the workflow to run for live requests.

For users who want more control or better security, consider self-hosting n8n.


Key Workflow Steps Explained

Input Step

The user submits a research question and parameters via an Research Request form node.
The system gets a unique request ID and prepares variables.

Clarification Loop

AI generates 3 clarifying questions using OpenAI Clarifying Questions node.
User answers these questions on a follow-up Ask Clarity Questions form node.
This improves focus before deep digging.

Recursive Search and Learn

Workflow uses subworkflow triggers to run cycles.
Each cycle generates SERP queries in Generate SERP Queries.
Scrapes web pages with Apify RAG Web Browser node.
Extracts learnings with OpenAI DeepResearch Learnings.
Accumulates this data until depth limit reached.

Report Generation and Notion Upload

After deepest recursion, runs DeepResearch Report to produce markdown text.
Creates a Notion database row and updates status progress.
Converts markdown to HTML, splits it, and formats into Notion blocks.
Uploads blocks to Notion page and appends source URL list.
Marks report status as Done to close the process.


Customization Ideas

  • Change depth and breadth max values in the Research Request form for more or less detail.
  • Switch OpenAI model versions or use models like Google Gemini instead.
  • Replace Apify with other web scrapers if desired.
  • Adapt Notion API targets for different databases or page layouts.
  • Edit prompts in AI nodes to tailor report style or length.

Troubleshooting Common Issues

Apify Auth Error: Usually caused by wrong API Key or header format.
Fix by checking Apify credentials and adding “Bearer ” prefix.

No Content from Web Scrapes: May be from bad queries or just network issues.
Review query generator and Apify quota.

Report Upload Failures: Possibly malformed markdown or API rate limits.
Try simpler markdown, retry logic, or smaller content chunks.


Pre-Production Checklist

  • Verify OpenAI API key includes access to needed models.
  • Test Apify credentials with a sample crawl.
  • Ensure Notion database exists and has required fields.
  • Test trigger form in public mode to confirm input capture.
  • Run a small test request to observe each step’s output.
  • Backup Notion data before large tests to avoid loss.

Deployment Guide

After setup and testing, activate the workflow in n8n.
Share the form URL with users to collect requests.
Check executions and Notion pages regularly.
Watch API usage and scale n8n resources if needed.


Summary

✓ Automates deep research from input to structured report.
✓ Saves hours by replacing manual web searching.
✓ Produces consistent, detailed research with clear sources.
✓ Works asynchronously so user does not wait online.
✓ Easy to use inside n8n with configuration instructions.

Automate deep research with n8n and OpenAI

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Yes, the OpenAI o3-mini model can be swapped with other supported models like GPT-4 or Google Gemini by updating the respective AI nodes and adjusting prompts.
Users control data volume using depth and breadth sliders in the Research Request form, which set the recursion level and the number of queries explored per iteration.
Check the search query format and filters in the Generate SERP Queries node, verify Apify API key validity and quota, and ensure network connectivity.
Review and correct markdown formatting in the DeepResearch Report node, split large report content into smaller blocks, and consider retry logic in Upload to Notion Page node.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.