The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "Command Processing Workflow",
"nodes": [
{
"parameters": {
"path": "webhook/command",
"responseMode": "responseNode",
"options": {}
},
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
250,
300
]
},
{
"parameters": {
"jsCode": "// Get input data\nconst input = $input.first();\n\n// Extract command details\nconst {\n activityId,\n command,\n hasAttachments,\n attachments,\n user,\n timestamp\n} = input.json;\n\n// Simple routing logic based on command content\nlet routedAgent = {\n id: 'chat-gpt',\n name: 'Chat GPT'\n};\n\nif (command.toLowerCase().includes('calendar') || command.toLowerCase().includes('schedule')) {\n routedAgent = {\n id: 'calendar',\n name: 'Calendar'\n };\n} else if (command.toLowerCase().includes('email') || command.toLowerCase().includes('mail')) {\n routedAgent = {\n id: 'email',\n name: 'Email'\n };\n} else if (command.toLowerCase().includes('home') || command.toLowerCase().includes('light')) {\n routedAgent = {\n id: 'home-assistant',\n name: 'Home Assistant'\n };\n}\n\n// Return routing result\nreturn {\n json: {\n activityId,\n routedAgent,\n message: `Your request has been routed to ${routedAgent.name}`,\n timestamp: new Date().toISOString()\n }\n};"
},
"name": "Route Command",
"type": "n8n-nodes-base.code",
"typeVersion": 1,
"position": [
450,
300
]
},
{
"parameters": {
"operation": "update",
"table": "activities",
"where": {
"id": "={{$json.activityId}}"
},
"set": {
"agent": "={{$json.routedAgent.name}}",
"agent_id": "={{$json.routedAgent.id}}",
"status": "completed",
"detailed_content": "={{$json.message}}",
"updated_at": "={{$json.timestamp}}"
}
},
"name": "Update Supabase",
"type": "n8n-nodes-base.postgres",
"typeVersion": 1,
"position": [
650,
300
],
"credentials": {
"postgres": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"options": {}
},
"name": "Respond to Webhook",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1,
"position": [
850,
300
]
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "Route Command",
"type": "main",
"index": 0
}
]
]
},
"Route Command": {
"main": [
[
{
"node": "Update Supabase",
"type": "main",
"index": 0
}
]
]
},
"Update Supabase": {
"main": [
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
postgres
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Command Processing Workflow. Uses postgres. Webhook trigger; 4 nodes.
Source: https://github.com/TungNguyenNTT/personal-ai-agents-april-01/blob/6c72ed9d7a19e47edb9301ee10e4895b4c95469f/n8n-workflows/command-workflow.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This template is for developers, teams, and automation enthusiasts who want a private, PIN-protected Telegram chatbot that answers questions from their own documents — without relying on external AI A
HVAC Event Generator v1.0 - INSERT OPERATIONS. Uses postgres. Webhook trigger; 16 nodes.
Eu Clara – Funil Kiwify Completo. Uses postgres, openAi, httpRequest, gmail. Webhook trigger; 70 nodes.
Lua Nova - Sistema Completo. Uses postgres, httpRequest, openAi. Webhook trigger; 55 nodes.
User Signup & Verification: The workflow starts when a user signs up. It generates a verification code and sends it via SMS using Twilio. Code Validation: The user replies with the code. The workflow