← All N8N workflows
AI & researchAgentAggregateCodeExecute Workflow TriggerGmail

Automated Research Report Generation with OpenAI, Wikipedia, Google Search, and Gmail/Telegram

Configured with Agent, Aggregate, Execute Workflow Trigger, Gmail, and additional nodes. Review the connections and setup before adapting this template.

Workflow preview
AI & modelsOpenAI Chat ModelOpenAI Chat ModelData storeSimple MemoryMemory Buffer WindowWeb / APISearch NewsTool Http RequestWeb / APIWikipediaTool Http RequestAI & modelsOpenAI Chat Model1OpenAI Chat ModelAI & modelsQuery RefinerAgentAI & modelsResearch AI AgentAgentWeb / APIGoogle Search WebTool Http RequestWeb / APISerpApiTool Http RequestTransformStructured OutputParserOutput Parser StructuredTransformSplit OutSplit OutCodeInput ValidationCodeCodeParse Research OutputCodeCodeMerge Split ItemsCodeData storeStore Research MetadataGoogle SheetsCodeGenerate PDF HTMLCodeWeb / APIConvert HTML to PDFHTTP RequestTransformAggregateAggregateWeb / APIDownload PDFHTTP RequestMessagingSend Research to GmailGmailTriggerWhen clicking ‘Testworkflow’Manual TriggerMessagingSend PDFTelegramTriggerExecuted by Main AIAgentExecute Workflow TriggerFiles / mediaSearch FolderGoogle DriveRoutingIfIf

Node categories in this workflow

  • AI & models
  • Data store
  • Web / API
  • Transform
  • Code
  • Messaging
  • Trigger
  • Files / media
  • Routing

Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.

Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.

How it works

The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.

Workflow node names, types, and operations
NodeCategoryTypeOperation
OpenAI Chat ModelAI & modelsOpenAI Chat ModelSee node parameters
Simple MemoryData storeMemory Buffer WindowSee node parameters
Search NewsWeb / APITool Http RequestSee node parameters
WikipediaWeb / APITool Http RequestSee node parameters
OpenAI Chat Model1AI & modelsOpenAI Chat ModelSee node parameters
Query RefinerAI & modelsAgentSee node parameters
Research AI AgentAI & modelsAgentSee node parameters
Google Search WebWeb / APITool Http RequestSee node parameters
SerpApiWeb / APITool Http RequestSee node parameters
Structured Output ParserTransformOutput Parser StructuredSee node parameters
Split OutTransformSplit OutSee node parameters
Input ValidationCodeCodeSee node parameters
Parse Research OutputCodeCodeSee node parameters
Merge Split ItemsCodeCodeSee node parameters
Store Research MetadataData storeGoogle Sheetsappend
Generate PDF HTMLCodeCodeSee node parameters
Convert HTML to PDFWeb / APIHTTP RequestPOST
AggregateTransformAggregateSee node parameters
Download PDFWeb / APIHTTP RequestSee node parameters
Send Research to GmailMessagingGmailSee node parameters
When clicking ‘Test workflow’TriggerManual TriggerSee node parameters
Send PDFMessagingTelegramsendDocument
Executed by Main AI AgentTriggerExecute Workflow TriggerSee node parameters
Search FolderFiles / mediaGoogle DrivefileFolder
IfRoutingIfSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.

Requirements

An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.

Credential types declared in the source

  • gmailOAuth2
  • googleDriveOAuth2Api
  • googleSheetsOAuth2Api
  • openAiApi
  • serpApi
  • telegramApi

Workflow notes

📋 Research Report Workflow 🧠💻

📋 Research Report Workflow 🧠💻

This workflow generates a professional PDF research report on a given topic, sends it via Telegram, and emails🚀


🔍 Query Refiner

  • What it does: Refines the input topic for better readability. 🧹
  • Input: Topic from the HTTP Request (e.g., "the best ai models 2025").
  • Output: Formatted topic (e.g., "The Best AI Models 2025").
  • ✨ Detail: Capitalizes words and ensures "AI" is uppercase.

📊 Aggregate Research Data

  • What it does: Collects research data for the topic. 📚
  • Input: Refined topic.
  • Output: Research data (introduction, summary, key findings, etc.) with a timestamp.
  • ⏰ Note: The timestamp is used to date the report.

🔗 Merge Split Items

  • What it does: Combines and organizes research data into sections. 🗂️
  • Input: Data from Aggregate Research Data.
  • Output: Structured JSON with sections like introduction, key_findings, sources.
  • 📑 Purpose: Prepares data for the PDF report.

📝 Generate PDF HTML

  • What it does: Creates an HTML template for the PDF report. 🖥️
  • Input: Refined topic and research data.
  • Output: HTML content, file name (e.g., research-report-the-best-ai-models-2025-2025-04-09.pdf), and formatted date.
  • 🎨 Features:
    • Professional styling (Helvetica, Georgia fonts, deep blue accents).
    • Sections: Cover page, introduction, summary, key findings, etc.
    • Escapes special characters to prevent HTML errors.
  • ⏳ Timestamp Fix: Stores rawTimestamp and formattedDate (e.g., "April 9, 2025").

📄 Convert HTML to PDF (PDFShift)

  • What it does: Converts the HTML to a PDF using the PDFShift API. 🖨️
  • Input: HTML content from the previous node.
  • Output: JSON response with a URL to the generated PDF.
  • 🔑 Requirement: Needs a valid PDFShift API key.
  • ⚠️ Note: Outputs a URL, not the PDF binary data.

⬇️ Download PDF

  • What it does: Downloads the PDF from the URL provided by PDFShift. 📥
  • Input: PDF URL from the Convert HTML to PDF node.
  • Output: Binary PDF data (MIME type: application/pdf, ~98 KB).
  • 📛 File Name: Uses the file name from the previous node (e.g., research-report-the-best-ai-models-2025-2025-04-09.pdf).

📱 Gmail/Telegram

  • What it does: Sends the PDF to a Gmail/Telegram chat. 💬
  • Input: PDF binary data and metadata (topic, formatted date).
  • Output: Sends the PDF as a document to the specified chat.
  • 📝 Caption:
Automated Research Report Generation with OpenAI, Wikipedia, Google Search, and Gmail/Telegram

Automated Research Report Generation with OpenAI, Wikipedia, Google Search, and Gmail/Telegram

Purpose and structure

This folder contains the Automated Research Report Generation with OpenAI, Wikipedia, Google Search, and Gmail/Telegram workflow. Its executable nodes use agent, aggregate, code, executeWorkflowTrigger, gmail, googleDrive, googleSheets, httpRequest, if, lmChatOpenAi, manualTrigger, memoryBufferWindow, outputParserStructured, splitOut, telegram, toolHttpRequest. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.

Setup

Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.

Entry points

When clicking ‘Test workflow’, Executed by Main AI Agent

Verification

Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.

Attribution

https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Telegram/1341_Telegram_Splitout_Automate_Webhook.json MIT; preserve source notices.

More in AI & research