AutomationFlowsAI & RAG › N8ncal · /command

N8ncal · /command

n8nCal · /command. Uses agent, lmChatAnthropic, memoryPostgresChat, toolWorkflow. Webhook trigger; 12 nodes.

Webhook trigger★★★★☆ complexityAI-powered12 nodesAgentAnthropic ChatMemory Postgres ChatTool Workflow
AI & RAG Trigger: Webhook Nodes: 12 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the Agent → Anthropic Chat recipe pattern — see all workflows that pair these two integrations.

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 →

Download .json
{
  "name": "n8nCal \u00b7 /command",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "n8ncal/command",
        "responseMode": "responseNode",
        "options": {
          "allowedOrigins": "*"
        }
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        -400,
        0
      ],
      "id": "75cdbf83-7a20-4af4-92e0-52704e5486d2",
      "name": "Webhook \u00b7 /command"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "auth-token-check",
              "leftValue": "={{ $json.headers['x-n8ncal-token'] }}",
              "rightValue": "={{ $env.N8NCAL_TOKEN }}",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -180,
        0
      ],
      "id": "78db2ead-3e3b-4ef5-ae00-82e9cb7299d0",
      "name": "Auth check"
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={\n  \"error\": \"unauthorized\"\n}",
        "options": {
          "responseCode": 401
        }
      },
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        60,
        200
      ],
      "id": "e74b34d2-4ad3-42e2-9608-49c73e9dadf1",
      "name": "Respond 401"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $('Webhook \u00b7 /command').item.json.body.text }}",
        "options": {
          "systemMessage": "=You are n8nCal, a calendar copilot.\n\nUser persona instructions:\n{{ $('Webhook \u00b7 /command').item.json.body.persona || 'Be concise. Default to action over commentary.' }}\n\nGround rules:\n- Current time: {{ $now.toISO() }}\n- User timezone: {{ $('Webhook \u00b7 /command').item.json.body.timezone || 'UTC' }}\n- Prior conversation turns are loaded from memory automatically. Use them.\n- For event creation/modification/deletion: on first mention, DRAFT the change in your reply and ask for confirmation. Do NOT call create_event yet. On the next turn, when the user says confirm/yes/do it, call the tool using the details you proposed earlier (visible in memory).\n- For read intents (\"what's on my calendar\"), call list_events directly and summarize.\n- For reminders, call set_reminder immediately \u2014 they're easy to undo.\n- For notification tests (\"ping me\", \"test\"), call send_notification.\n- Replies under 3 sentences unless asked for detail.\n- Never invent attendees, times, or links. If vague, ask one clarifying question.",
          "maxIterations": 5,
          "returnIntermediateSteps": false
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        140,
        0
      ],
      "id": "5eafef8e-39d1-449b-8a0c-05d61ee69b27",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "model": "claude-sonnet-4-6",
        "options": {
          "maxTokensToSample": 1024,
          "temperature": 0.2
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "typeVersion": 1.3,
      "position": [
        -40,
        240
      ],
      "id": "c2c730de-df37-4e61-a087-bea6d1b44106",
      "name": "Anthropic \u00b7 Sonnet",
      "credentials": {
        "anthropicApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $('Webhook \u00b7 /command').item.json.body.conversation_id || 'default' }}",
        "tableName": "n8ncal_chat_history",
        "contextWindowLength": 12
      },
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "typeVersion": 1.3,
      "position": [
        120,
        240
      ],
      "id": "c79ec751-9598-4a3a-b9f8-f0be104f23da",
      "name": "Chat Memory \u00b7 Postgres",
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "name": "list_events",
        "description": "List calendar events in a date/time range. Use for any 'what's on my calendar' or 'am I free' question.",
        "workflowId": {
          "__rl": true,
          "value": "REPLACE_WITH_TOOL_LIST_EVENTS_WORKFLOW_ID",
          "mode": "id"
        },
        "specifyInputSchema": true,
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"from\": { \"type\": \"string\", \"description\": \"ISO 8601 start of range\" },\n    \"to\":   { \"type\": \"string\", \"description\": \"ISO 8601 end of range\" }\n  },\n  \"required\": [\"from\", \"to\"]\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "typeVersion": 2.2,
      "position": [
        280,
        240
      ],
      "id": "3285a961-c568-4759-be77-33a1e9a7a1cf",
      "name": "tool \u00b7 list_events"
    },
    {
      "parameters": {
        "name": "create_event",
        "description": "Create a calendar event. ONLY call after user confirmation in a previous turn (now visible in memory). Never on first mention.",
        "workflowId": {
          "__rl": true,
          "value": "REPLACE_WITH_TOOL_CREATE_EVENT_WORKFLOW_ID",
          "mode": "id"
        },
        "specifyInputSchema": true,
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"title\":    { \"type\": \"string\" },\n    \"start\":    { \"type\": \"string\", \"description\": \"ISO 8601\" },\n    \"end\":      { \"type\": \"string\", \"description\": \"ISO 8601\" },\n    \"attendees\":{ \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n    \"location\": { \"type\": \"string\" },\n    \"notes\":    { \"type\": \"string\" }\n  },\n  \"required\": [\"title\", \"start\", \"end\"]\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "typeVersion": 2.2,
      "position": [
        400,
        240
      ],
      "id": "75a54210-e35d-4b2e-9147-a443d9d5881a",
      "name": "tool \u00b7 create_event"
    },
    {
      "parameters": {
        "name": "set_reminder",
        "description": "Set a follow-up reminder. Fires a notification at the due time.",
        "workflowId": {
          "__rl": true,
          "value": "REPLACE_WITH_TOOL_SET_REMINDER_WORKFLOW_ID",
          "mode": "id"
        },
        "specifyInputSchema": true,
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"text\":     { \"type\": \"string\" },\n    \"due\":      { \"type\": \"string\", \"description\": \"ISO 8601\" },\n    \"priority\": { \"type\": \"string\", \"enum\": [\"low\", \"med\", \"high\"] }\n  },\n  \"required\": [\"text\", \"due\"]\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "typeVersion": 2.2,
      "position": [
        520,
        240
      ],
      "id": "ed891bf4-3a1e-4592-948b-536002962b08",
      "name": "tool \u00b7 set_reminder"
    },
    {
      "parameters": {
        "name": "send_notification",
        "description": "Notify the user via iotPush, Telegram, or SMS. Use for confirmations, pings, reminder fires.",
        "workflowId": {
          "__rl": true,
          "value": "REPLACE_WITH_TOOL_NOTIFY_WORKFLOW_ID",
          "mode": "id"
        },
        "specifyInputSchema": true,
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"channel\": { \"type\": \"string\", \"enum\": [\"iotpush\", \"telegram\", \"sms\", \"all\"] },\n    \"title\":   { \"type\": \"string\" },\n    \"body\":    { \"type\": \"string\" },\n    \"priority\":{ \"type\": \"string\", \"enum\": [\"low\", \"normal\", \"high\"] }\n  },\n  \"required\": [\"channel\", \"body\"]\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "typeVersion": 2.2,
      "position": [
        640,
        240
      ],
      "id": "d09eb1fe-8e34-4f8e-8021-c0f262bb8ede",
      "name": "tool \u00b7 send_notification"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "r",
              "name": "reply",
              "value": "={{ $json.output }}",
              "type": "string"
            },
            {
              "id": "se",
              "name": "sideEffects",
              "value": "={{ $json.intermediateSteps || [] }}",
              "type": "array"
            },
            {
              "id": "cid",
              "name": "conversation_id",
              "value": "={{ $('Webhook \u00b7 /command').item.json.body.conversation_id || 'default' }}",
              "type": "string"
            },
            {
              "id": "ts",
              "name": "ts",
              "value": "={{ $now.toISO() }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        460,
        0
      ],
      "id": "03281f27-3640-43c0-ae2e-7dd996f53875",
      "name": "Shape response"
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ $json }}",
        "options": {}
      },
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        680,
        0
      ],
      "id": "e6f28bfb-8cf3-4343-b2b9-20321d013486",
      "name": "Respond"
    }
  ],
  "connections": {
    "Webhook \u00b7 /command": {
      "main": [
        [
          {
            "node": "Auth check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Auth check": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Respond 401",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic \u00b7 Sonnet": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Chat Memory \u00b7 Postgres": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "tool \u00b7 list_events": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "tool \u00b7 create_event": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "tool \u00b7 set_reminder": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "tool \u00b7 send_notification": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Shape response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Shape response": {
      "main": [
        [
          {
            "node": "Respond",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "tags": [
    {
      "name": "n8nCal"
    }
  ]
}

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.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

n8nCal · /command. Uses agent, lmChatAnthropic, memoryPostgresChat, toolWorkflow. Webhook trigger; 12 nodes.

Source: https://github.com/dasecure/n8ncal/blob/dd9a67e052fb7ba52c03770283ea1a95f0595fc2/workflows/01-command.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Local AI Expert. Uses lmChatAnthropic, memoryPostgresChat, executeWorkflowTrigger, supabase. Webhook trigger; 15 nodes.

Anthropic Chat, Memory Postgres Chat, Execute Workflow Trigger +5
AI & RAG

CLINICAINTEGRAL_secretary. Uses postgres, mcpClientTool, googleDriveTool, toolWorkflow. Webhook trigger; 89 nodes.

Postgres, Mcp Client Tool, Google Drive Tool +14
AI & RAG

Remi 1.1. Uses lmChatOpenAi, memoryPostgresChat, openAi, postgres. Webhook trigger; 89 nodes.

OpenAI Chat, Memory Postgres Chat, OpenAI +7
AI & RAG

my-secretary. Uses postgres, mcpClientTool, googleDriveTool, toolWorkflow. Webhook trigger; 86 nodes.

Postgres, Mcp Client Tool, Google Drive Tool +13
AI & RAG

secretaria. Uses postgres, n8n-nodes-evolution-api, openAi, httpRequest. Webhook trigger; 71 nodes.

Postgres, N8N Nodes Evolution Api, OpenAI +12