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
Automate research to HTML with n8n and OpenAI

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

Learn how to Build this Workflow with AI:

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.

Automate research to HTML with n8n and OpenAI

Visit through Desktop to Interact with the Workflow.

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 Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.