{"product_id":"n8n-webhook-generate-research-pdf-with-openai-gpt-4-1-gmail","title":"n8n Webhook: Generate Research PDF with OpenAI GPT-4.1 \u0026 Gmail","description":"\u003ch3\u003eTurn any research topic into a polished PDF—automatically—then email it via Gmail\u003c\/h3\u003e\n\u003cp\u003eThis n8n Webhook workflow generates research reports end-to-end: it accepts a topic through a POST request, uses OpenAI (GPT-4.1) to generate search queries and summarize articles, compiles the findings into an HTML report, converts it to a PDF, and emails the PDF attachment using Gmail.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReceives a webhook request\u003c\/strong\u003e and expects a \u003ccode\u003etopic\u003c\/code\u003e field; if \u003ccode\u003etopic\u003c\/code\u003e is missing, it returns an error response.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGenerates search queries with OpenAI\u003c\/strong\u003e: creates five detailed Google search queries for the given topic and parses them into individual query items.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSearches the web\u003c\/strong\u003e using the \u003cstrong\u003eSerper Google Search API\u003c\/strong\u003e, extracts top organic results, and processes up to \u003cstrong\u003e10 articles per workflow run\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReads full article content\u003c\/strong\u003e via \u003cstrong\u003eJina Reader\u003c\/strong\u003e, cleans and truncates the text, then sends it to OpenAI for a structured JSON summary (key insights, tools, trends, and a conclusion).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePerforms cross-article analysis\u003c\/strong\u003e with OpenAI to identify common trends, compared findings, repeated insights, key tools\/platforms, and an overall research conclusion.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eBuilds the report and delivers it\u003c\/strong\u003e: formats the analysis into a Markdown-style report, converts it to \u003cstrong\u003eHTML\u003c\/strong\u003e, sends it to a \u003cstrong\u003ePDF-generation HTTP API\u003c\/strong\u003e, downloads the PDF, and emails it as an attachment via \u003cstrong\u003eGmail\u003c\/strong\u003e.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eQuickly generate a “research brief” PDF for SaaS decisions or product discovery.\u003c\/li\u003e\n  \u003cli\u003eCreate repeatable market or competitor research packets on demand through an API call.\u003c\/li\u003e\n  \u003cli\u003eAutomate internal summaries for analysts and ops teams—delivered directly to email.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eWebhook input validation: \u003cstrong\u003ewebhook\u003c\/strong\u003e, \u003cstrong\u003eif\u003c\/strong\u003e, \u003cstrong\u003eset\u003c\/strong\u003e\n\u003c\/li\u003e\n  \u003cli\u003eControl flow and iteration: \u003cstrong\u003ecode\u003c\/strong\u003e, \u003cstrong\u003elimit\u003c\/strong\u003e\n\u003c\/li\u003e\n  \u003cli\u003eEmail delivery: \u003cstrong\u003egmail\u003c\/strong\u003e (PDF attachment)\u003c\/li\u003e\n  \u003cli\u003eAI-driven research: \u003cstrong\u003eOpenAI GPT-4.1\u003c\/strong\u003e for query generation, article summaries, and cross-article synthesis\u003c\/li\u003e\n  \u003cli\u003eWeb research sources: \u003cstrong\u003eSerper\u003c\/strong\u003e (Google Search) and \u003cstrong\u003eJina Reader\u003c\/strong\u003e\n\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46001841930419,"sku":"N8N-19477","price":56.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/oLdR7RYuwOWRGCyAeRP2H_asq3L1hx.png?v=1789117430","url":"https:\/\/buyflowscripts.com\/products\/n8n-webhook-generate-research-pdf-with-openai-gpt-4-1-gmail","provider":"N8N Commerce","version":"1.0","type":"link"}