n8n

How to Generate OpenAI Blog Articles for Marketing?

Turn a simple topic into a ready to publish blog post. A webhook receives the topic, research is run, and the system returns clean HTML ready for your site. Teams can also get a short preview in Telegram for fast review.

Here is how it works. A Webhook node collects the topic from a GET request on the pblog path. The topic is checked and improved with an LLM so it is clear and SEO friendly. A Perplexity research call gathers current information. An LLM then writes a full article in a strict JSON structure that includes category, title, metadata, content, and hashtags. Next, the draft is converted to HTML and then into a single line Tailwind styled page using a Basic LLM Chain. If checks validate each step. A Telegram node posts the first part of the text to a chat so editors can react quickly. The webhook responds with the final HTML or a clear error message.

You will need API keys for OpenAI and Perplexity, plus a Telegram bot and a chat id. Expect a large drop in drafting time and fewer copy and paste steps. This setup works well for marketing teams, agencies, and founders who publish often and want a repeatable, reliable content pipeline.

What are the key features?

  • Webhook intake parses a topic from a GET request on the pblog path
  • Topic refinement with an LLM to improve clarity and SEO intent
  • Perplexity research call to collect up to date context and sources
  • Structured Output Parser enforces a JSON schema with category, title, metadata, content, and hashtags
  • Conditional checks validate research, article creation, and HTML steps
  • HTML builder converts the article to clean markup using an LLM
  • Basic LLM Chain turns the page into a single line Tailwind styled HTML document
  • Telegram notification posts a short preview to a chosen chat for quick feedback
  • Success and error responses return clear results to the original webhook caller

What are the benefits?

  • Reduce blog draft time from 4 hours to 15 minutes
  • Automate 70% of research and first draft writing
  • Improve article structure consistency by 90% using a fixed JSON schema
  • Cut formatting work to near zero with Tailwind HTML output
  • Speed up reviews by sending previews to Telegram in seconds
  • Handle higher article volume without adding staff

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with OpenAI, Telegram, Perplexity and Webhook.site. See the Tools Required section above for links to create accounts with these services.
  3. Open the Webhook node and confirm the path is pblog and the Response mode is set to Respond to Webhook node.
  4. Set up OpenAI credentials: double click any OpenAI node, choose Create new credential, select API Key, paste your OpenAI API key from the OpenAI dashboard, and save. Use a clear name like OpenAI Main.
  5. Set up Perplexity credentials: open the HTTP Request node labeled Perplexity, choose Create new credential, select API Key or Header Auth, add your Perplexity API key to the Authorization header as required, and save.
  6. Create a Telegram bot with BotFather and copy the bot token. In n8n, open the Telegram nodes, click Create new credential, paste the bot token, and save. Add your chat id in the Chat Id nodes as needed.
  7. In the Set or Get Topic nodes, confirm the field that holds the topic from the query string. Send a test GET request to the webhook URL with ?topic=your_subject to verify parsing.
  8. Check the Structured Output Parser node and confirm the JSON schema fields match your needs. Keep category, title, metadata, content, and hashtags to ensure clean parsing.
  9. Review the Basic LLM Chain prompt that converts markdown to a single line Tailwind HTML page. Adjust classes or styles if your site uses a different CSS setup.
  10. Send a test request from Webhook.site or curl to the webhook URL. Watch the n8n execution to confirm research, article creation, and HTML steps complete without errors.
  11. Open Telegram and confirm a preview message arrives. If it fails, check the chat id and that the bot was added to the chat.
  12. If the webhook returns an error, check the If nodes to see which step failed. Common fixes include invalid API keys, missing topic input, or JSON parse errors in the article output.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

OpenAI

Sign up

Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens

Perplexity

Sign up

Pay-as-you-go API: Sonar $1/M input tokens, $1/M output tokens + per-request fee (e.g., $0.005 at low context)

Telegram

Sign up

Free: $0, Telegram Bot API usage is free for developers

Webhook.site

Sign up

Free tier: $0, public API available; free URLs expire after 7 days and accept up to 100 requests

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.