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:

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

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.


Visit through Desktop to Interact with the Workflow.

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.