n8n-io/n8n · warning
AGENT_NO_SYSTEM_MESSAGE
AGENT_NO_SYSTEM_MESSAGE
Error message
'${node.name}' has no system message. System-level instructions should be in the system message field. What it means
Warning-level validator issue (code AGENT_NO_SYSTEM_MESSAGE) emitted when an Agent node has no system message — neither options.systemMessage nor params.systemMessage is set, or it is an empty/whitespace string. Without a system message the agent lacks system-level instructions, which usually leads to inconsistent behavior.
Source
Thrown at packages/@n8n/workflow-sdk/src/workflow-builder/plugins/validators/agent-validator.ts:67
// (MISSING_EXPRESSION_PREFIX will handle malformed expressions)
if (!text || (!hasValidExpression && !hasMalformedExpression)) {
issues.push({
code: 'AGENT_STATIC_PROMPT',
message: `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.`,
severity: 'warning',
nodeName: node.name,
});
}
// Check: No system message
const options = params.options as Record<string, unknown> | undefined;
const systemMessage = options?.systemMessage ?? params.systemMessage;
if (
!systemMessage ||
(typeof systemMessage === 'string' && systemMessage.trim().length === 0)
) {
issues.push({
code: 'AGENT_NO_SYSTEM_MESSAGE',
message: `'${node.name}' has no system message. System-level instructions should be in the system message field.`,
severity: 'warning',
nodeName: node.name,
});
}
return issues;
},
};
View on GitHub (pinned to 5ac6606e81)
Solutions
- Add options.systemMessage (or top-level systemMessage) with the agent's role/instructions.
- Ensure the value is a non-empty, non-whitespace string.
- If intentionally omitted, accept the warning or suppress it via validator configuration.
Example fix
// before
agent({ text: '={{ $json.chatInput }}' })
// after
agent({
text: '={{ $json.chatInput }}',
systemMessage: 'You are a helpful assistant that summarizes text.'
}) Defensive patterns
Strategy: validation
Validate before calling
function hasSystemMessage(p: { systemMessage?: unknown; options?: { systemMessage?: unknown } }): boolean {
const sm = p.options?.systemMessage ?? p.systemMessage;
return typeof sm === 'string' && sm.trim().length > 0;
}
if (!hasSystemMessage(agentParams)) {
// warn: missing system message
} Prevention
- Always set a non-empty systemMessage on agent nodes.
- Keep agent role/instructions in the system message, not the user prompt.
- Validate agent config before exporting a workflow.
When it happens
Trigger: Building an agent node and omitting systemMessage entirely, or passing systemMessage: '' / a blank string.
Common situations: Minimal agent setup that only fills the user prompt; migrating a config where the system message key was renamed or dropped.
Related errors
- AGENT_STATIC_PROMPT
- AGENT_STATIC_PROMPT
- Run ${this.runId} is not suspended. Cannot resume.
- Reflector output must be valid JSON
- Reflector output must be a JSON object
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/3d283f2ab3c0cab2.
Report an issue: GitHub.