AI Content Engine: From Research to HTML with OpenAI, Perplexity

This workflow automates AI-driven content creation using OpenAI and Perplexity APIs. Key nodes include Webhook Trigger (receives POST requests), Validate Input (checks topic), Topic Optimizer Agent (refines topic), Perplexity Research Agent (fetches data), Telegram Research Update (sends notification), Article Structure Agent (creates article), HTML Generator Agent (generates HTML), HTML Response (returns HTML), Error Response (handles invalid inputs), and Error Handler (captures errors).\n\nSetup Requirements: Install n8n from n8n.io or sign up at cloud.n8n.io. Create a Webhook node (Webhook Trigger) with path content-engine and HTTP method POST. Obtain API keys: OpenAI (from platform.openai.com > API Keys), Perplexity (from api.perplexity.ai > API Keys), and Telegram Bot (via BotFather on Telegram). In n8n’s Credentials, add OpenAI API (API key), HTTP Header Auth for Perplexity (header: Authorization, value: Bearer your-api-key), and Telegram API (bot token and chat ID). Configure Topic Optimizer Agent and Article Structure Agent (gpt-4 model), Perplexity Research Agent (https://api.perplexity.ai/chat/completions), and Telegram Research Update. Ensure Validate Input checks for a non-empty topic. Connect nodes; handle errors like invalid API keys (401) or missing topic (400).\n\nTesting and Deployment: Import the JSON into n8n’s workflow editor. Test with curl -X POST http://your-n8n-instance/content-engine -d '{"topic":"AI in healthcare"}'. Verify HTML Response outputs a styled HTML document with Tailwind CSS. Check Telegram Research Update for a notification with topic and summary. Validate Error Response for missing topic ({"status": "error", "message": "Missing required 'topic' parameter"}). Handle errors like invalid Perplexity API key (401) or Telegram chat ID issues. Activate the workflow in n8n and integrate the webhook URL into your app. Monitor logs for issues like API rate limits or invalid topic formats, ensuring reliable content generation and delivery.

$6.99

Workflow steps: 11

Integrated apps: webhook, if, respondToWebhook

AI Content Engine: From Research to HTML with OpenAI, Perplexity preview