Perplexity & OpenAI: Automate Research to HTML Webpage in n8n

Discover how this n8n workflow automates research on user topics via Perplexity AI, enriches with OpenAI GPT models, and converts insights into a styled HTML web page, saving you hours on content creation and formatting.
webhook
lmChatOpenAi
httpRequest
+10
Workflow Identifier: 2186
NODES in Use: webhook, set, if, chainLlm, httpRequest, outputParserStructured, agent, respondToWebhook, telegram, noOp, lmChatOpenAi, toolWorkflow, stickyNote

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 gets a topic from a user and makes a detailed article fast.
It fixes the prompt, does deep research using the Perplexity AI API, and then writes a clean HTML article with GPT.
The final article is styled with Tailwind CSS and ready to publish.
This saves many hours of manual work and lowers mistakes.


Who Should Use This Workflow

This workflow helps content writers, bloggers, and researchers.
If the user needs quick, nice-looking articles from research data, this workflow is good.
No need for coding skills, but basic n8n editor access helps.
User wants fast and reliable article creation with minimal manual effort.


Tools Used in This Workflow

  • n8n Webhook node: Receives the user’s topic via HTTP requests.
  • OpenAI GPT (gpt-4o-mini model): Improves the topic prompt and formats articles.
  • Perplexity AI API: Performs detailed research based on the improved prompt.
  • LangChain Output Parser node: Converts raw research text into a structured JSON article.
  • Agent nodes: Extract JSON from response and create the HTML article.
  • Telegram Bot API (optional): Sends article summaries to Telegram chats.

How the Workflow Works (Inputs → Process → Output)

Inputs

  • User sends a topic to a webhook URL as query or body parameter.

Processing Steps

  • Webhook node captures the topic.
  • Set node (Get Topic) extracts and stores the topic.
  • If node (If Topic Exists) checks for topic presence.
  • Chain LLM node (Improve Users Topic) uses GPT to clarify and extend the topic.
  • HTTP Request node (Perplexity) sends improved prompt to Perplexity AI and gets research data.
  • LangChain Output Parser node (Structured Output Parser1) parses raw research to structured JSON.
  • Agent node (Extract JSON) extracts the article JSON cleanly.
  • Agent node (Create HTML Article) converts JSON to a responsive, one-line Tailwind CSS styled HTML article.
  • Set node (Contents) separates the article’s title and content.

Output

  • Respond to Webhook node sends HTML article back as response.
  • Optional: Telegram nodes send a short preview to chat.

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

Import Please

  1. Download the workflow using the Download button on this page.
  2. In n8n editor, click Import from File and choose the downloaded file.

Configure Credentials

  1. Open the imported workflow.
  2. Add or update your OpenAI API Key in the GPT nodes.
  3. Provide the Perplexity AI API Key in the HTTP Request node headers.
  4. If using Telegram notifications, set your Telegram Bot Token and Chat ID in the respective nodes.

Custom Settings

  1. Check any IDs, emails, or channel names and update if they differ from your setup.
  2. Review any prompt texts or URLs that can be copied and changed if needed.

Testing and Activation

  1. Run the workflow once with a test topic via the webhook URL.
  2. Ensure the HTML article is returned and Telegram message sent if enabled.
  3. Activate the workflow by toggling the switch to make it live.
  4. Use self-host n8n if full control over running the workflow on servers is needed.

Common Inputs and Outputs

  • Input: HTTP request with URL parameter ?topic=Your Topic or JSON body field topic.
  • Output: Plain text HTTP response returns clean, single-line HTML article.
  • Optional Output: Telegram notification with first 300 characters summary.

Handling Edge Cases and Failures

  • If the topic is missing, the If node (If Topic Exists) stops the workflow or can send an error.
  • Check Perplexity API errors related to authentication or rate limits to fix API keys.
  • Watch for JSON parsing failures if Perplexity or GPT output changes format.
  • If HTML generation creates multi-line or invalid output, review the prompt instructions in the Create HTML Article node.
  • Keep an eye on network connectivity for external API calls.

Customization Ideas

  • Change research depth by adjusting max_tokens and temperature in Perplexity Request.
  • Try different OpenAI models by changing the model setting in GPT nodes.
  • Add Google Sheets or database nodes to store articles automatically.
  • Customize Telegram messages with buttons or richer content.
  • Expand webhook to handle lists of topics with batch processing.

Summary and Results

✓ Workflow creates well-structured articles fast and clear.
✓ Research is automatic using Perplexity AI API.
✓ Articles are styled with Tailwind CSS, responsive and modern.
✓ Telegram notifications keep the user informed of new content.
✓ Saves lots of manual time and reduces errors.

Frequently Asked Questions

The Webhook node receives the user’s topic input as an HTTP request to start the workflow.
It sends the improved prompt to Perplexity AI’s chat completions API and receives structured research data.
The Agent node (Create HTML Article) converts the structured JSON into a single-line Tailwind CSS styled HTML article.
Download the workflow file, import it in n8n editor, add required API keys in nodes, test once, then activate the workflow for live use.

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