Learn how to fix broken variable interpolation in n8n system prompts with simple steps to restore accurate workflows and reliable automation.

Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
The direct fix is: when a system prompt in n8n doesn’t interpolate variables (expressions like {{$json.xxx}}), you must switch the field to Expression mode, or wrap your text inside an expression using backticks and concatenation. System Prompt fields in some AI nodes look like normal text fields, but they do not parse inline {{ }} expressions unless the field is toggled to Expression mode. You can always force interpolation by clicking “Add Expression” and writing the whole prompt as a single expression string.
In n8n, every field is either in Raw Text mode or Expression mode. Raw Text mode will treat {{ $json.something }} literally as text. It does not interpolate it. Expression mode actually evaluates the JavaScript-like expression engine and returns the final string.
That is why it “looks like” variable interpolation is broken — but the field is just not set to Expression mode.
Use one of the two real working patterns below. Both are standard practice in complex production n8n automations.
{{$json.request}} appear literally, it means the field does NOT support inline expressions and you must use Fix #1.
In real production environments, the most stable approach is always to use an expression wrapping the entire prompt. It avoids edge cases where a field silently stops processing inline expressions after updates, or behaves differently between cloud and self‑hosted n8n versions.
$json.prompt.// Clean, fully controlled source
$json.prompt
This ensures you know exactly what is being passed to the AI node, with zero ambiguity.
The fix is to force the field into Expression mode. Inline {{ }} syntax inside text fields in system prompts is not always parsed by n8n, so you must explicitly add an expression or build the entire prompt as a template string. That’s the reliable production-safe approach.
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.