π Generate internet research PDF reports with GPT-4.1-mini and Gmail
β‘ 5 views Β· π Market Research & Insights
Description
Quick Overview
This workflow accepts a research topic via webhook, uses OpenAI to generate search queries and summarize web articles found via Serper/Google Search and Jina Reader, then compiles insights into an HTML report, converts it to PDF, and emails it via Gmail.
How it works
- Receives a POST webhook request containing a
topicfield and returns an error response if the topic is missing. - Uses OpenAI to generate five detailed Google search queries for the provided topic and parses them into individual query items.
- For each query, searches the web using the Serper Google Search API, extracts the top organic results, and limits processing to 10 articles.
- Fetches each articleβs full text via a Jina Reader URL, cleans and truncates the content, and sends it to OpenAI to produce a structured JSON summary with key insights, tools, trends, and a conclusion.
- Aggregates all article summaries and uses OpenAI to analyze them for common trends, compared findings, repeated insights, important tools/platforms, and overall research conclusions.
- Formats the analysis into a Markdown-style report, converts it to HTML, sends it to a PDF-generation HTTP API, downloads the resulting PDF, and emails it as an attachment via Gmail before responding to the webhook with a success message.
Setup
- Add OpenAI API credentials (used for query generation, article summarization, and cross-article analysis) and confirm the selected model is available to your account.
- Set up a Serper (Google Search) API key and replace
YOUR_GOOGLE_SERPER_APIand theX-API-KEYheader value in the search request. - Configure a PDF conversion service endpoint by replacing
YOUR_CREATE_PDF_URL_HEREandYOUR_API_KEYin the PDF request. - Connect Gmail credentials and update the recipient address in the email step to your target inbox.
- Copy the production webhook URL for the
research-agentpath and send a POST body like{ "topic": "..." }from your calling app or tool.
π Nodes Used
HTTP Request, Webhook, Gmail, OpenAI
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File