This n8n workflow automates content creation using the Perplexity API, generating articles with optional research. Key nodes include Webhook Trigger (receives POST requests), Validate Input (checks topic), Prepare Content Parameters (sets content options), Check Research Requirement, Topic Optimizer Agent, Research Agent (API interaction), Article Structure Agent, Direct Content Generator, Check HTML Generation, HTML Generator Agent, JSON Response Formatter, Success Response, Input Error Response, and Error Response Handler (handle outputs). Set up Requirements and Configuration: Install n8n by downloading from n8n.io for self-hosting or sign up at cloud.n8n.io for cloud setup. Follow installation prompts or create a cloud account. Obtain Perplexity API credentials from api.perplexity.ai: sign up, access your dashboard, and generate an API key. In n8n, import the provided JSON to create the workflow. Configure the Research Agent node with your API key under 'Credentials,' selecting 'Perplexity API.' Set the Webhook Trigger node’s path to 'ai-content-engine,' ensure it accepts POST requests, and optionally enable header authentication with a secure key. The Validate Input node ensures the topic is non-empty and at least three characters long. Testing and Deployment Steps: Test by sending a POST request to the Webhook URL (from the Webhook Trigger node) using Postman. Example JSON body: {'topic': 'AI in automation', 'contentType': 'article', 'targetAudience': 'developers', 'includeResearch': true, 'generateHtml': true} or {'topic': 'Cloud computing', 'includeResearch': false} with the authentication header if enabled. The 'Success Response' node returns a 200 status with JSON or HTML content, or 'Input Error Response' (400 status) for invalid topics. Monitor logs for errors like invalid API keys or rate limits, and verify credentials or input formats if issues occur. Activate the workflow in n8n’s interface for deployment. Validate outputs to confirm article structure (title, sections, hashtags) or HTML content matches the requested topic and format.
$6.99
Workflow steps: 14
Integrated apps: webhook, if, set