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
- 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.
- A Function or Set node extracts and structures the AI response into an article schema including title, sections, quotes, metadata, and hashtags.
- A second AI Tool Node receives the article JSON and converts it into a single-line professional HTML document.
- 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
- Use the Download button on this page to get the workflow file.
- In the n8n editor, choose “Import from File” and select the downloaded workflow.
2. Configure after import
- Add your OpenAI GPT API Key in the credentials section of the AI Tool node.
- Update any IDs, emails, channels, or folder names if the workflow uses specific values.
- Check the Webhook node path and note the URL to test external requests.
- 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
- Send a test POST with sample JSON to the webhook URL to check if the workflow runs properly.
- Review the returned HTML string for formatting accuracy.
- 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 formattingCustomization 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.
