Convert Research Topics to HTML Articles with Perplexity AI in n8n

This n8n workflow automates converting user research topics into fully formatted HTML articles using the Perplexity AI tool. It solves the challenge of manual content creation by delivering structured, SEO-friendly posts effortlessly.
ai_tool
Workflow Identifier: 2002
NODES in Use: ai_tool

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 research topic as input then creates a detailed, good-looking HTML article fast.
It solves the problem of spending many hours to research, write, and format content manually.
The result is usable HTML ready for blogs or newsletters.

The workflow asks AI for topic info, organizes that into article parts, and makes a single-line HTML output.
It saves time and stops formatting mistakes.


Who should use this workflow

The workflow is good for content marketers who need fast article drafts without coding.
It’s also useful for non-tech users who want clean, professional HTML from short topic inputs.

If you want to turn any topic idea into a quality article automatically, this workflow fits well.
It works well for teams dealing with many articles and deadlines.


Tools and services used

  • n8n platform: To build the automation workflow.
  • Perplexity AI Tool Node: Runs AI queries against the OpenAI GPT API.
  • OpenAI GPT API: Provides AI-generated text completions.
  • Webhook node: Accepts incoming HTTP POST topic inputs.
  • Respond to Webhook node: Sends the final HTML article back.
  • Function or Set nodes: Parse and format JSON data as needed.

This workflow can run on self-host n8n setups too. For help with hosting n8n, visit self-host n8n.


How the workflow works (Input → Processing → Output)

Inputs

The workflow starts by receiving a topic in JSON format via HTTP POST on the Webhook node.
The input should include text describing the research topic.

Processing Steps

  1. AI Tool Node calls OpenAI GPT API to get latest and relevant info on the topic using a structured JSON message with model, system prompt, and user content.
  2. A Function or Set node extracts and structures the AI response into an article schema including title, sections, quotes, metadata, and hashtags.
  3. A second AI Tool Node receives the article JSON and converts it into a single-line professional HTML document.
  4. The workflow prepares the HTML output string ready to publish.

Output

The final output is a single-line HTML string sent back via the Respond to Webhook node.
Users receive this ready-to-use HTML for embedding on websites or newsletters.


Beginner step-by-step: How to use this workflow in n8n

1. Download and import

  1. Use the Download button on this page to get the workflow file.
  2. In the n8n editor, choose “Import from File” and select the downloaded workflow.

2. Configure after import

  1. Add your OpenAI GPT API Key in the credentials section of the AI Tool node.
  2. Update any IDs, emails, channels, or folder names if the workflow uses specific values.
  3. Check the Webhook node path and note the URL to test external requests.
  4. You can copy the included prompt code from the Input section below and paste it where needed in the AI nodes.

3. Test and activate

  1. Send a test POST with sample JSON to the webhook URL to check if the workflow runs properly.
  2. Review the returned HTML string for formatting accuracy.
  3. Turn on the workflow toggle in n8n to activate for production.

This allows quick setup and running of the workflow without building step-by-step from scratch.
If using self-host n8n, verify the hosting environment is working for stable executions.


Input Examples and Prompt Code

The webhook expects a JSON POST like:

{
  "text": "Climate change effects on marine life"
}

The main AI query prompt looks like:

{
  "model": "llama-3.1-sonar-small-128k-online",
  "messages": [
    {"role": "system", "content": "Your system prompt here."},
    {"role": "user", "content": "{{ $json.text }}"}
  ],
  "max_tokens": 4000,
  "temperature": 0.2
}

The HTML formatting prompt used later is:

=Convert this verbatim into HTML: {{ $json.article.toJsonString() }}

## Formatting Guidelines
- HTML document must be single line document without tabs or line breaks
- Use proper HTML tags throughout
- Use <h1> for main title, <h2> for sections, <p> for paragraphs, <blockquote> for quotes
- Maintain professional tone and consistent formatting

Customization ideas

  • Change the AI model parameter for different writing styles or lengths.
  • Add more fields to article JSON like reading time or author bio.
  • Use Telegram Bot API node to trigger workflow from chat messages.
  • Output other formats like Markdown or PDFs by adding conversion nodes.

Common problems and fixes

Authentication errors with OpenAI API

Check if the correct API key is saved in the AI Tool node credentials.
Test the node with a simple prompt to confirm connection.

Webhook not receiving data

Make sure the webhook URL is copied exactly.
Ensure the Webhook node is set to accept POST requests.


Pre-production checklist

  • Confirm OpenAI API Key is working in the AI Tool nodes.
  • Send test JSON topic to webhook and check AI responses.
  • Verify article JSON has all required fields before HTML conversion.
  • Review the single-line HTML for correct tags and layout.
  • Backup the workflow before turning on for daily use.

Deployment guide

Turn the workflow toggle on in n8n to activate.
Share the webhook URL with content requesters or connect it with CMS systems.

Use n8n executions dashboard to watch runs and fix errors.
This helps keep production smooth and task automated.


Summary of benefits

✓ Saves hours of manual writing and formatting.
✓ Produces clean, professional HTML articles automatically.
✓ Easy to use for non-technical users.
✓ Uses AI for updated, relevant content.
✓ Works with n8n and OpenAI GPT API easily.

→ Quick topic-to-article conversion.
→ Consistent and error-free formatting.
→ Ready HTML output for publishing.


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