n8n Integration Guide
Connect your customer-owned n8n instance (Cloud or self-hosted) with ChatCoat for bi-directional workflow automation.
Architecture Model
ChatCoat uses a zero-cloud-lock-in architecture for n8n. You connect your own n8n instance using standard webhooks and API authentication. ChatCoat remains fully operational independently of n8n.
ChatCoat fires real-time HMAC-SHA256 signed webhooks to your n8n Webhook node on events like new leads, comments, published posts, and RSS articles.
Your n8n workflows trigger ChatCoat actions (create lead, schedule campaign, reply to comment) using an n8n HTTP Request node with Bearer token authentication.
1. Outbound Events (ChatCoat → n8n)
Trigger your n8n workflows whenever things happen in ChatCoat.
Step 1: Create an n8n Webhook Node
- In your n8n canvas, add a Webhook trigger node.
- Set HTTP Method to
POST. - Copy the Production URL (e.g.
https://n8n.yourdomain.com/webhook/chatcoat-events). - Go to n8n Automation in ChatCoat, paste the URL, and select the events you want to receive.
Step 2: Normalized Event Envelope
Every outbound event adheres to a standard, normalized JSON envelope:
{
"event_id": "evt_01hx7a9bcdef...",
"event_type": "lead.created",
"timestamp": "2026-09-24T18:00:00Z",
"organization_id": "org_2t...",
"resource_id": "lead_123...",
"version": "1.0",
"payload": {
"lead_id": "lead_123...",
"platform": "instagram",
"username": "sarah_growth",
"display_name": "Sarah Miller",
"intent": "Interested in marketing automation demo",
"source_comment_text": "How can I try this out?",
"status": "new",
"tags": ["social-lead", "instagram"]
}
}Step 3: HMAC-SHA256 Signature Verification
ChatCoat signs every delivery using HMAC-SHA256. The signature is provided in the header:
To verify this in n8n, add a Code node right after your Webhook node:
const crypto = require('crypto');
const secret = 'YOUR_CHATCOAT_WEBHOOK_SECRET';
const signatureHeader = $input.first().json.headers['x-chatcoat-signature'] || '';
const rawBody = JSON.stringify($input.first().json.body);
const expectedSignature = 'sha256=' + crypto
.createHmac('sha256', secret)
.update(rawBody)
.digest('hex');
if (signatureHeader !== expectedSignature) {
throw new Error('Invalid signature: Payload verification failed');
}
return $input.first();Available Event Types
Fires when a new lead is captured from comments or messages.
Fires when all posts in a campaign are published across platforms.
Fires when an individual post goes live on a specific network.
Fires when a social comment receives a reply via UI, AI, or API.
Fires when a fresh article is ingested from any tracked RSS/Atom feed.
Fires when a new channel (Meta, X, LinkedIn, YouTube) is connected.
2. Inbound Actions (n8n → ChatCoat)
Call ChatCoat endpoints from n8n using an HTTP Request node.
Step 1: Authentication
Generate an API Key on the n8n Automation page. Keys begin with cca_n8n_... and are securely tied to your organization.
Action: Create a Lead
Method: POST
URL: https://api.chatcoat.com/api/leads
Headers:
Authorization: Bearer YOUR_N8N_KEY
Content-Type: application/json
Body (JSON):
{
"platform": "website_contact_form",
"username": "alex_johnson",
"display_name": "Alex Johnson",
"source_comment_text": "Signed up on landing page",
"intent": "Enterprise pricing inquiry",
"tags": ["n8n-sync", "website"]
}Action: Reply to a Social Comment
Method: POST
URL: https://api.chatcoat.com/api/comments/COMMENT_ID/reply
Headers:
Authorization: Bearer YOUR_N8N_KEY
Content-Type: application/json
Body (JSON):
{
"message_text": "Thanks for reaching out! Check your DMs for the link."
}Action: Create Campaign from RSS Item
Method: POST
URL: https://api.chatcoat.com/api/rss/items/ITEM_ID/create-campaign
Headers:
Authorization: Bearer YOUR_N8N_KEY
Content-Type: application/json
Body (JSON):
{
"platforms": ["instagram", "facebook", "linkedin"]
}