{"record":{"id":"2d8bc12c8de74e60","repo":"n8n-io/n8n","slug":"agent-static-prompt","errorCode":"AGENT_STATIC_PROMPT","errorMessage":"Is input data required for '${node.name}'? If so, add an expression to the prompt. When following a chat trigger node, use { promptType: 'auto', text: '={{ $json.chatInput }}' }. Or use { promptType: 'define', text: '={{ ... }}' } to add dynamic data like input data.","messagePattern":"Is input data required for '(.+?)'\\? If so, add an expression to the prompt\\. When following a chat trigger node, use (.+?)\\}' \\}\\. Or use (.+?)\\}' \\} to add dynamic data like input data\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/@n8n/workflow-sdk/src/workflow-builder/plugins/validators/agent-validator.ts","lineNumber":52,"sourceCode":"\t\t}\n\n\t\tconst promptType = params.promptType as string | undefined;\n\n\t\t// Skip checks for auto/guardrails mode (undefined defaults to auto)\n\t\tif (!promptType || promptType === 'auto' || promptType === 'guardrails') {\n\t\t\treturn issues;\n\t\t}\n\n\t\t// Check: Static prompt (no expression)\n\t\tconst text = params.text;\n\t\tconst hasValidExpression = containsExpression(text);\n\t\tconst hasMalformedExpression = containsMalformedExpression(text);\n\n\t\t// Only warn about static prompt if there's NO expression at all\n\t\t// (MISSING_EXPRESSION_PREFIX will handle malformed expressions)\n\t\tif (!text || (!hasValidExpression && !hasMalformedExpression)) {\n\t\t\tissues.push({\n\t\t\t\tcode: 'AGENT_STATIC_PROMPT',\n\t\t\t\tmessage: `Is input data required for '${node.name}'? If so, add an expression to the prompt. When following a chat trigger node, use { promptType: 'auto', text: '={{ $json.chatInput }}' }. Or use { promptType: 'define', text: '={{ ... }}' } to add dynamic data like input data.`,\n\t\t\t\tseverity: 'warning',\n\t\t\t\tnodeName: node.name,\n\t\t\t});\n\t\t}\n\n\t\t// Check: No system message\n\t\tconst options = params.options as Record<string, unknown> | undefined;\n\t\tconst systemMessage = options?.systemMessage ?? params.systemMessage;\n\t\tif (\n\t\t\t!systemMessage ||\n\t\t\t(typeof systemMessage === 'string' && systemMessage.trim().length === 0)\n\t\t) {\n\t\t\tissues.push({\n\t\t\t\tcode: 'AGENT_NO_SYSTEM_MESSAGE',\n\t\t\t\tmessage: `'${node.name}' has no system message. System-level instructions should be in the system message field.`,\n\t\t\t\tseverity: 'warning',\n\t\t\t\tnodeName: node.name,","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/workflow-sdk/src/workflow-builder/plugins/validators/agent-validator.ts#L34-L70","documentation":"Warning-level validator issue (code AGENT_STATIC_PROMPT) emitted by the agent validator when an Agent node's text prompt has no expression at all — i.e. it is empty or a plain literal with no '=' expression and no malformed '{{ }}' fragment. Such a static prompt cannot incorporate incoming item data, which defeats the purpose of an agent that should react to runtime input.","triggerScenarios":"Defining an agent node with { text: 'Summarize this' } (no expression), or an empty text field, while expecting the agent to process incoming workflow data.","commonSituations":"First-draft agent config that hardcodes the prompt; copying a template that lost its expression; expecting chat input without wiring $json.chatInput.","solutions":["If following a chat trigger, set text to '={{ $json.chatInput }}' (promptType 'auto').","Otherwise set promptType 'define' and reference input data, e.g. '={{ $json.someField }}'.","Confirm the '=' prefix is present so n8n evaluates the value as an expression."],"exampleFix":"// before\nagent({ text: 'Summarize this' })\n// after\nagent({ promptType: 'auto', text: '={{ $json.chatInput }}' })","handlingStrategy":"validation","validationCode":"function hasExpression(value: unknown): boolean {\n  return typeof value === 'string' && value.startsWith('=');\n}\nconst text = agentParams.text;\nif (!hasExpression(text)) {\n  // warn: static prompt — add an expression\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always start agent prompts with '=' when they must ingest data.","Use promptType 'auto' with $json.chatInput for chat-triggered agents.","Run the agent validator during local builds to catch static prompts early."],"tags":["agent","validator","expression","prompt","ai"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}