Generate AI research reports from live web search with OpenAI and Gmail
Needs changesWhat this workflow does
This AI workflow has 14 nodes and runs when someone submits an n8n form (“AI Research Report Request”). Along the way it connects OpenAI Chat Model, Google Sheets and Gmail. It also calls google.serper.dev over HTTP.
How it runs
Trigger: When someone submits an n8n form (“AI Research Report Request”).
- Set config (Edit Fields (Set)): sets 13 fields: serperApiKey, recipientEmail, senderName…
- Search the main topic (HTTP Request): calls google.serper.dev (POST)
- Search the expert angle (HTTP Request): calls google.serper.dev (POST)
- Combine the sources (Code): runs custom JavaScript code
- Analyse the sources (AI Agent): runs an AI agent, with model: Chat model - Analysis; output parser: Output Parser - Analysis
- Write the report (AI Agent): runs an AI agent, with model: Chat model - Writing; output parser: Output Parser - Report
- Build the report email (Code): runs custom JavaScript code
- Log the request (Google Sheets): append
- Email the report (Gmail): uses Gmail
Services it uses
HTTP calls to: google.serper.dev
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in Analyse the sources (v1.7), Write the report (v1.7): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) Analyse the sources (v1.7), Write the report (v1.7) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (9)
- n8n Form Trigger
n8n-nodes-base.formTrigger - Edit Fields (Set)
n8n-nodes-base.set - HTTP Request
n8n-nodes-base.httpRequest - Code
n8n-nodes-base.code - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Google Sheets
n8n-nodes-base.googleSheets - Gmail
n8n-nodes-base.gmail
From the author
Quick overview This workflow collects a research request via an n8n form, runs two live Google searches via the Serper API, uses OpenAI to analyze the sources and write a structured report, then logs the request to Google Sheets and emails the finished report…