๐Ÿ”— 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:

๐Ÿ’กFor beginners, N8N Cloud is the easiest option โ€” no server management needed.
2

Create Your CodeCanvas Bot & Get Webhook URL

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)

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:

๐Ÿ’ก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:

Webhook Payload (JSON)POST
{
  "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

โœ…Once activated, N8N runs 24/7 in the background processing all bot messages automatically.

๐Ÿ”Œ Popular N8N Nodes to Use

Ready to automate?

Create your CodeCanvas bot first, then connect it to N8N for powerful automations.

๐Ÿค– Create Bot First โ†’ ๐Ÿ”— Visit N8N โ†’

Related Guides

๐Ÿ“ฑ
Telegram Setup
5 minutes
โšก
Bot Flows
5 minutes
๐Ÿ’š
WhatsApp Bot
10 minutes