๐ N8N Integration
Connect CodeCanvas with N8N
Use N8N's visual workflow builder to create powerful automations triggered by your CodeCanvas bots โ no coding required.
โฑ 15 minutes ยท Intermediate
Example Workflow
๐ฑ
User Message
Telegram/WA/FB
โ
๐
CodeCanvas
Webhook trigger
โ
โ๏ธ
N8N Workflow
Process & logic
โ
๐
Google Sheets
Save data
โ
๐ง
Email Alert
Notify team
๐ฏ What You Can Build
๐
Lead Capture
When someone messages your bot, auto-save their info to Google Sheets or a CRM like HubSpot
๐
Team Notifications
Send Slack or email alerts to your team when specific keywords are detected in bot messages
๐
Order Processing
Customer messages "order" โ N8N creates order in your system โ sends confirmation back
๐
Appointment Booking
Bot collects name and time โ N8N creates Google Calendar event โ sends confirmation
๐ค
AI Processing
Route messages through OpenAI in N8N for custom AI responses beyond CodeCanvas AI
๐
Analytics Dashboard
Send bot metrics to Google Data Studio or Airtable for custom reporting dashboards
๐ Step-by-Step Setup
1
Install or Access N8N
You need an N8N instance. You have 3 options:
- N8N Cloud (easiest) โ Go to n8n.io and start a free trial. No installation needed.
- Self-hosted with Docker โ Run on your own VPS:
docker run -d -p 5678:5678 n8nio/n8n
- NPM install โ
npm install n8n -g && n8n start
๐กFor beginners, N8N Cloud is the easiest option โ no server management needed.
2
Create Your CodeCanvas Bot & Get Webhook URL
- Go to Dashboard โ Bots
- Create a new bot on your preferred platform (Telegram, WhatsApp, etc.)
- Copy the Webhook URL from the bot's Webhook tab
https://codecanvas.top/api/webhook.php?bot=123&secret=abc123def456
๐กYour bot automatically saves all messages to the Messages dashboard โ N8N is for additional processing and integrations.
3
Create N8N Webhook Node (Trigger)
- Open N8N and click + New Workflow
- Click Add first step โ Search for "Webhook"
- Set HTTP Method to POST
- Copy the Test URL or Production URL from N8N
N8N WEBHOOK URL LOOKS LIKE:
https://your-n8n.app.n8n.cloud/webhook/abc123-def456-ghi789
4
Create a CodeCanvas Bot Flow That Triggers N8N
In your bot's flow builder, create a flow that makes an HTTP request to N8N when triggered:
- Go to your bot โ Add Flow
- Set trigger: e.g. Keyword = "order"
- Response type: Text
- Response: "Thank you! Processing your order..."
๐กCodeCanvas automatically sends webhook data to N8N when messages arrive. You can also use the N8N webhook URL directly in your platform's webhook settings alongside CodeCanvas.
5
Understand the Webhook Data Format
When CodeCanvas receives a message, it sends this JSON data to any connected webhooks:
{
"bot_id": 123,
"platform": "telegram",
"sender": "username123",
"sender_id": "987654321",
"message": "I want to order product X",
"timestamp": "2026-05-06 10:30:00",
"chat_id": "987654321",
"bot_response": "Thank you! Processing..."
}
๐กIn N8N, access these fields using expressions like {{ $json.message }} or {{ $json.sender }}
6
Build Your N8N Workflow
After the Webhook trigger, add your processing nodes. Here's an example โ Save to Google Sheets + Send Email:
1๏ธโฃ
Webhook (Trigger)
Receives message from CodeCanvas bot
2๏ธโฃ
IF Node
Check: does message contain "order"? Branch into Yes/No paths
3๏ธโฃ
Google Sheets Node
Append row: sender, message, timestamp, platform
4๏ธโฃ
Send Email Node
Alert your team: "New order from {{ $json.sender }}: {{ $json.message }}"
7
Dual Webhook Setup (Advanced)
For more control, set up both CodeCanvas AND N8N webhooks on your Telegram bot:
# Set CodeCanvas as primary webhook
https://api.telegram.org/bot{TOKEN}/setWebhook?url=https://codecanvas.top/api/webhook.php?bot=123&secret=abc
# Use N8N webhook in CodeCanvas flow response to forward data
# Or use Telegram's allowed_updates to send to multiple endpoints
โ ๏ธTelegram only supports ONE webhook URL. Use CodeCanvas as primary and forward to N8N from CodeCanvas flows, OR use N8N as primary and call CodeCanvas API to log messages.
8
Test Your Integration
- In N8N, click "Test workflow" to activate listening mode
- Send a test message to your bot
- N8N should show the received data in the Webhook node
- Check that all subsequent nodes execute correctly
- Click "Save" then "Activate" to make it live
โ
Once activated, N8N runs 24/7 in the background processing all bot messages automatically.
๐ Popular N8N Nodes to Use
=$n[0]?>
=$n[1]?>
=$n[2]?>
Ready to automate?
Create your CodeCanvas bot first, then connect it to N8N for powerful automations.
Related Guides