{"record":{"id":"9def120959ab5aaa","repo":"n8n-io/n8n","slug":"workflow-must-be-started-from-a-chat-trigger-node","errorCode":null,"errorMessage":"Workflow must be started from a chat trigger node","messagePattern":"Workflow must be started from a chat trigger node","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/Chat.node.ts","lineNumber":347,"sourceCode":"\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tconst connectedNodes = this.getParentNodes(this.getNode().name, {\n\t\t\tincludeNodeParameters: true,\n\t\t});\n\n\t\tlet chatTrigger: INode | NodeTypeAndVersion | undefined | null = connectedNodes.find(\n\t\t\t(node) => node.type === CHAT_TRIGGER_NODE_TYPE && !node.disabled,\n\t\t);\n\n\t\tif (!chatTrigger) {\n\t\t\ttry {\n\t\t\t\t// try to get chat trigger from workflow if node working as a tool\n\t\t\t\tchatTrigger = this.getChatTrigger();\n\t\t\t} catch (error) {}\n\t\t}\n\n\t\tif (!chatTrigger) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t'Workflow must be started from a chat trigger node',\n\t\t\t);\n\t\t}\n\n\t\tconst parameters = chatTrigger.parameters as {\n\t\t\tmode?: 'hostedChat' | 'webhook';\n\t\t\toptions: { responseMode: 'lastNode' | 'responseNodes' | 'streaming' | 'responseNode' };\n\t\t};\n\n\t\tif (parameters.mode === 'webhook') {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t'\"Embedded chat\" is not supported, change the \"Mode\" in the chat trigger node to the \"Hosted Chat\"',\n\t\t\t);\n\t\t}\n\n\t\tif (parameters.options.responseMode !== 'responseNodes') {","sourceCodeStart":329,"sourceCodeEnd":365,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/Chat.node.ts#L329-L365","documentation":"Thrown by the ChatTrigger-adjacent response/agent node's execute() when no enabled Chat Trigger node can be found — neither among the parent nodes nor via getChatTrigger() (the tool-mode fallback). The response path is only valid inside a chat-triggered workflow.","triggerScenarios":"Adding an AI response/agent node to a workflow that is triggered by a non-chat trigger (Webhook, Schedule, Manual, Form); the Chat Trigger exists but is disabled; the Chat Trigger is not an upstream parent of this node.","commonSituations":"Building a chat flow then swapping the trigger type; disabling the Chat Trigger for testing; wiring the response node into a branch that isn't downstream of the Chat Trigger.","solutions":["Add a Chat Trigger node as the workflow's trigger and connect it upstream of this node.","Re-enable the existing Chat Trigger if it was disabled.","Reconnect this node so it is a descendant of the Chat Trigger (or used as a tool with getChatTrigger()).","If you don't need chat, remove this node and use a standard output."],"exampleFix":"// before: Schedule Trigger → AI Agent (no Chat Trigger) → throws\n// after: Chat Trigger → AI Agent → this node\n// (replace the trigger, or wire a Chat Trigger as the entry point)","handlingStrategy":"validation","validationCode":"const connected = this.getParentNodes(this.getNode().name, { includeNodeParameters: true });\nconst hasChatTrigger = connected.some(n => n.type === CHAT_TRIGGER_NODE_TYPE && !n.disabled);\nif (!hasChatTrigger) throw new Error('Connect a Chat Trigger upstream');","typeGuard":"function isChatTrigger(node: INode | NodeTypeAndVersion): boolean {\n  return (node as INode).type === CHAT_TRIGGER_NODE_TYPE && !(node as INode).disabled;\n}","tryCatchPattern":null,"preventionTips":["Always start chat flows with a Chat Trigger node.","Keep the Chat Trigger enabled while testing.","Ensure response/agent nodes are downstream of the Chat Trigger."],"tags":["chat-trigger","configuration","workflow-topology","ai-tool"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}