Automate Research Report Creation with OpenAI, Wikipedia & Gmail

Discover how to automate comprehensive research report generation using an n8n workflow that integrates OpenAI, Wikipedia, Google Search, and Gmail. Save hours on gathering, summarizing, and delivering research-packed PDFs effortlessly.
lmChatOpenAi
code
httpRequest
+14
Workflow Identifier: 1003
NODES in Use: lmChatOpenAi, memoryBufferWindow, toolHttpRequest, agent, outputParserStructured, code, splitOut, aggregate, googleSheets, httpRequest, gmail, manualTrigger, executeWorkflowTrigger, googleDrive, if, stickyNote, telegram

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

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What This Workflow Does

This workflow automates full research report creation from a single topic.
It solves the problem of slow, manual research that takes many hours.
The result is a detailed PDF report sent by email and Telegram.
Users get timely, complete, and well-structured research reports without extra effort.


Who Should Use This Workflow

This workflow helps market analysts, researchers, or anyone needing quick research reports.
It suits users who want to save time and avoid missing important new info.


Tools and Services Used

  • OpenAI API: Refines queries and summarizes research using GPT-4o-mini.
  • NewsAPI: Finds recent news articles.
  • Wikipedia API: Gets background info.
  • Google Custom Search API: Retrieves web search results.
  • SerpApi: Searches academic papers via Google Scholar.
  • PDFShift API: Converts HTML to PDF.
  • Gmail API: Sends report emails.
  • Telegram Bot API: Sends report PDFs to chat.
  • Google Sheets API: Logs metadata.
  • Google Drive API: (Optional) Manages files.


Inputs, Processing, and Outputs

Inputs

  • Research topic entered or triggered via webhook.

Processing Steps

  1. Input Validation: Checks the topic is at least 3 characters and cleans it.
  2. OpenAI Chat Model1: Refines the topic to fix caps and formatting.
  3. Query Refiner Agent: Creates 5 related search queries expanding the topic scope.
  4. Research AI Agent: Uses NewsAPI, Wikipedia API, Google Search, SerpApi, and OpenAI to gather and combine info.
  5. Parse Research Output: Converts AI JSON string output into usable JSON.
  6. Split Out: Separates the JSON into report sections.
  7. Merge Split Items and Aggregate: Combines all sections into one structured JSON.
  8. Generate PDF HTML: Builds an elegant report in HTML with styling and date formatting.
  9. Convert HTML to PDF: Sends HTML to PDFShift and gets PDF URL.
  10. Download PDF: Downloads the PDF file.
  11. Send Research to Gmail: Emails the PDF with a formatted message.
  12. Send PDF: Sends the report via Telegram chat.
  13. Store Research Metadata: Logs topic, sources, dates in Google Sheets.

Outputs

  • Polished, comprehensive PDF research report.
  • Automatic delivery by email and Telegram.
  • Metadata saved in Google Sheets.


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

Importing the Workflow

  1. Download the workflow file using the Download button on this page.
  2. Open n8n editor where the workflow should run.
  3. Use the Import from File option to load the saved workflow.

Configuring Credentials and Settings

  1. Open each node that needs API Keys or OAuth, like OpenAI, NewsAPI, PDFShift, Gmail, Telegram, Google Sheets.
  2. Insert the correct API Keys or OAuth tokens.
  3. Update any IDs or emails in nodes for Google Sheets, Gmail, or Telegram to fit your accounts.
  4. If needed, change folder paths or table names to your own setup.
  5. Copy and paste provided code in the Input Validation or HTML generation nodes if code is shown.

Testing and Activating

  1. Run the workflow once manually to check for errors.
  2. Watch the output PDF and delivery to email/Telegram.
  3. If all works, turn on the workflow to active mode.
  4. Set up webhook triggers or scheduled runs if you want automatic research.

Use the self-host n8n resource for options on hosting your n8n instance if needed.


Customization Ideas

  • Change the number of related queries generated in the Query Refiner prompt.
  • Modify CSS styles inside Generate PDF HTML to adjust report look.
  • Add more research sources by creating new HTTP Request nodes and updating the research message prompt.
  • Use other delivery nodes like Slack or Teams instead of Gmail/Telegram.
  • Insert translation nodes before PDF creation for multilingual reports.


Common Problems and Solutions

  • OpenAI API Quota or Auth Error: Check your OpenAI API Key in n8n. Renew or upgrade the key.
  • PDFShift Conversion Error: Confirm API Key and simplify the HTML if wrong.
  • Gmail Sending Fails: Reauthenticate your Gmail OAuth in n8n to refresh token.


Pre-Production Checklist

  • Verify all API Keys and OAuth tokens are correct.
  • Test input validation node with different queries.
  • Check output topics from the Query Refiner.
  • Confirm PDF generates and looks right.
  • Test emails and Telegram PDF delivery.
  • Ensure Google Sheets records metadata correctly.


Deployment Guide

Activate the workflow in the n8n dashboard.
Run manually or configure triggers like webhooks or schedules for regular report generation.
Monitor logs and output for errors.
Adjust quotas or keys as usage grows.

Use the self-host n8n link if planning VPS setup or self hosting n8n for better control.


Summary of Benefits and Outcomes

✓ Saves hours of manual research work.
✓ Produces accurate, comprehensive research reports.
✓ Sends finished reports automatically via email and chat.
✓ Keeps metadata logged for tracking.
✓ Easy to configure and extend in n8n.


Frequently Asked Questions

Yes, the n8n OpenAI nodes can be set to other GPT models supported by the API plan.
The workflow calls multiple APIs like OpenAI, NewsAPI, Google Search, PDFShift, and SerpApi, so monitor API usage to avoid limits.
Data stays within n8n and used APIs. Secure API Keys and OAuth tokens. Avoid sharing sensitive info publicly.
Check the PDFShift API Key. Test and simplify the input HTML content to avoid format errors.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free