n8n - 💡(How to fix) Fix AI tool descriptions are not consistently evaluating n8n expressions before being passed to the agent/model

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

  • error: all
RAW_BUFFERClick to expand / collapse

Bug Description

AI tool descriptions are not consistently evaluating n8n expressions before being passed to the AI Agent/model.

In a proof workflow, two AI tools are connected to the same Agent and receive the same upstream input:

{ "sessionId": "123", "user": "ABC", "thread_ts": "12345" }

Both tools use the same expression pattern in their tool description field:

={{ $json.sessionId }}{{ $json.user }}{{ $json.thread_ts }}

For one tool type, the expression resolves correctly to 123ABC12345. For another tool type, the Agent receives the raw unevaluated expression text instead.

To Reproduce

In a proof workflow, two AI tools are connected to the same Agent and receive the same upstream input.

{ "sessionId": "123", "user": "ABC", "thread_ts": "12345" } Both tools use the same expression pattern in their tool description field:

={{ $json.sessionId }}{{ $json.user }}{{ $json.thread_ts }}

Both tools show in the UI with valid evaluations and expanded content.

<img width="986" height="381" alt="Image" src="https://github.com/user-attachments/assets/3062beb9-b75a-453d-9022-f422096ca56d" /> <img width="983" height="268" alt="Image" src="https://github.com/user-attachments/assets/115774a5-279f-47bd-affa-2c1086ac9ebb" />

However when the workflow is executed for one tool type, the expression resolves correctly to 123ABC12345. For the other tool type, the Agent receives the raw unevaluated expression text instead.

<img width="1698" height="1247" alt="Image" src="https://github.com/user-attachments/assets/955a72a2-fa9c-47bb-8fe9-ac3881123d3b" /> <img width="1371" height="1018" alt="Image" src="https://github.com/user-attachments/assets/bdc79d9f-bd4e-4879-a003-30ad73ed3489" /> <img width="1159" height="1040" alt="Image" src="https://github.com/user-attachments/assets/6b2f2ffa-2ea5-4323-aa1e-24e88b181c33" />

Note, the tools that work correctly seem to use the parameter name description, the ones that don't use toolDescription.

Example Workflow { "nodes": [ { "parameters": {}, "id": "1eb91096-afad-45e6-9692-3e38b216808f", "name": "Manual Trigger", "type": "n8n-nodes-base.manualTrigger", "typeVersion": 1, "position": [ 336, 544 ] }, { "parameters": { "assignments": { "assignments": [ { "id": "test-session", "name": "sessionId", "value": "123", "type": "string" }, { "id": "test-user", "name": "user", "value": "ABC", "type": "string" }, { "id": "test-thread", "name": "thread_ts", "value": "12345", "type": "string" } ] }, "options": {} }, "id": "37a7e8cd-c678-4a85-ac1c-51f8188affaf", "name": "Set test inputs", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 528, 544 ] }, { "parameters": { "promptType": "define", "text": "I'm trying to test a bug, please confirm the description of your two tools.", "options": { "systemMessage": "You are a probe agent. The user wants you to invoke both your tools so we can inspect what description was passed to OpenAI. Call the tool with empty / placeholder args. After the call, respond with the single word 'done' and then the description of both tools." } }, "id": "b008e4d7-8e7c-4b70-9290-bc379df16634", "name": "Probe Agent", "type": "@n8n/n8n-nodes-langchain.agent", "typeVersion": 1.7, "position": [ 752, 544 ] }, { "parameters": { "model": { "__rl": true, "value": "gpt-5.5", "mode": "list", "cachedResultName": "gpt-5.5" }, "options": {} }, "id": "2313d93e-4f85-43f1-a820-eb8a54a02b3e", "name": "OpenAI GPT", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "typeVersion": 1.2, "position": [ 720, 784 ], "credentials": { "openAiApi": { "id": "0L1weZneNTwszqU8", "name": "n8n-proof-of-bug" } } }, { "parameters": { "description": "={{ $json.sessionId }}{{ $json.user }}{{ $json.thread_ts }}", "workflowId": { "__rl": true, "mode": "id", "value": "G37YR31SdCbWHLUg" }, "workflowInputs": { "mappingMode": "defineBelow", "value": {}, "matchingColumns": [], "schema": [ { "id": "sessionId", "displayName": "sessionId", "required": false, "defaultMatch": false, "display": true, "canBeUsedToMatch": true, "removed": false }, { "id": "user", "displayName": "user", "required": false, "defaultMatch": false, "display": true, "canBeUsedToMatch": true, "removed": false }, { "id": "thread_ts", "displayName": "thread_ts", "required": false, "defaultMatch": false, "display": true, "canBeUsedToMatch": true, "removed": false } ], "attemptToConvertTypes": false, "convertFieldsToString": false } }, "id": "8c8528b1-99df-4417-b9c0-86fb105f3618", "name": "ToolA", "type": "@n8n/n8n-nodes-langchain.toolWorkflow", "typeVersion": 2.2, "position": [ 848, 784 ] }, { "parameters": { "toolDescription": "={{ $json.sessionId }}{{ $json.user }}{{ $json.thread_ts }}", "method": "POST", "url": "https://slack.com/api/reactions.add", "authentication": "predefinedCredentialType", "nodeCredentialType": "slackApi", "options": { "response": { "response": {} } } }, "type": "n8n-nodes-base.httpRequestTool", "typeVersion": 4.2, "position": [ 960, 784 ], "id": "a479ca29-7ea3-4968-925a-dd98a3325046", "name": "ToolB", "credentials": { "slackApi": { "id": "ABC", "name": "REDACTED" } } } ], "connections": { "Manual Trigger": { "main": [ [ { "node": "Set test inputs", "type": "main", "index": 0 } ] ] }, "Set test inputs": { "main": [ [ { "node": "Probe Agent", "type": "main", "index": 0 } ] ] }, "OpenAI GPT": { "ai_languageModel": [ [ { "node": "Probe Agent", "type": "ai_languageModel", "index": 0 } ] ] }, "ToolA": { "ai_tool": [ [ { "node": "Probe Agent", "type": "ai_tool", "index": 0 } ] ] }, "ToolB": { "ai_tool": [ [ { "node": "Probe Agent", "type": "ai_tool", "index": 0 } ] ] } }, "pinData": { "Manual Trigger": [ {} ] }, "meta": { "templateCredsSetupCompleted": true, "instanceId": "ff8bc74e685205366b7c1dbd5470d650b694ebd82b586124e988b6855aef7cb2" } }

Expected behavior

All AI tool description fields that support n8n expressions should evaluate those expressions before the tool schema is passed to the Agent/model.

Expected value passed to the model: 123ABC12345 Actual value passed for the HTTP Request Tool: ={{ $json.sessionId }}{{ $json.user }}{{ $json.thread_ts }}

This breaks dynamic tool descriptions in AI Agent workflows, especially where descriptions depend on runtime context such as user session, permissions, enabled tools, or metadata.

Debug Info

Debug info

core

  • n8nVersion: 2.20.7
  • platform: docker (self-hosted)
  • nodeJsVersion: 24.14.1
  • nodeEnv: production
  • database: postgres
  • executionMode: scaling (multi-main)
  • concurrency: -1
  • license: enterprise (production)
  • consumerId: 1a734ee3-c22c-44bd-98f6-8fdf5af8a4de

storage

  • success: all
  • error: all
  • progress: false
  • manual: true
  • binaryMode: s3

pruning

  • enabled: true
  • maxAge: 720 hours
  • maxCount: 75000 executions

client

  • userAgent: mozilla/5.0 (macintosh; intel mac os x 10_15_7) applewebkit/537.36 (khtml, like gecko) chrome/148.0.0.0 safari/537.36
  • isTouchDevice: false

cluster

  • instanceCount: 9
  • versions: 2.20.7
  • instances:
    • instanceKey: 364ce66d-ba19-4d2a-98b5-814a857efa27, hostId: worker-n8n-worker-5d4697bdc5-cmcm6, instanceType: worker, instanceRole: unset, version: 2.20.7
    • instanceKey: a9c9a202-72f7-4d54-b386-703c213326a8, hostId: worker-n8n-worker-5d4697bdc5-qb5g6, instanceType: worker, instanceRole: unset, version: 2.20.7
    • instanceKey: d3522921-fe73-42a9-95e7-c8aa284eba74, hostId: worker-n8n-worker-5d4697bdc5-zk85h, instanceType: worker, instanceRole: unset, version: 2.20.7
    • instanceKey: 59f344a3-c860-426c-8124-4caaaefcc634, hostId: main-n8n-68445b8bb4-xrvwj, instanceType: main, instanceRole: follower, version: 2.20.7
    • instanceKey: 64b17d9b-5c5b-4898-b574-18f5e98496b4, hostId: worker-n8n-worker-5d4697bdc5-wpdzp, instanceType: worker, instanceRole: unset, version: 2.20.7
    • instanceKey: f8b0b075-d6a6-488f-8ef6-d8596e7073c1, hostId: main-n8n-68445b8bb4-5fhvr, instanceType: main, instanceRole: leader, version: 2.20.7
    • instanceKey: 64fbe677-65a4-44f7-99af-f93c8bf1d55a, hostId: worker-n8n-worker-5d4697bdc5-l5vsn, instanceType: worker, instanceRole: unset, version: 2.20.7
    • instanceKey: 54781043-e832-4b50-8f80-495634f9e92b, hostId: worker-n8n-worker-5d4697bdc5-5ctmc, instanceType: worker, instanceRole: unset, version: 2.20.7
    • instanceKey: aa1f9c11-e7ea-429e-9544-9888d9f9bf75, hostId: main-n8n-68445b8bb4-qrd7b, instanceType: main, instanceRole: follower, version: 2.20.7
  • checks:
    • check: hostid-clash, status: succeeded, warnings: -
    • check: lifecycle, status: succeeded, warnings: -
    • check: split-brain, status: succeeded, warnings: -
    • check: version-mismatch, status: succeeded, warnings: -

Generated at: 2026-05-21T13:42:41.895Z

Operating System

AKS

n8n Version

2.20.7

Node.js Version

24.14.1

Database

PostgreSQL

Execution mode

queue

Hosting

self hosted

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

All AI tool description fields that support n8n expressions should evaluate those expressions before the tool schema is passed to the Agent/model.

Expected value passed to the model: 123ABC12345 Actual value passed for the HTTP Request Tool: ={{ $json.sessionId }}{{ $json.user }}{{ $json.thread_ts }}

This breaks dynamic tool descriptions in AI Agent workflows, especially where descriptions depend on runtime context such as user session, permissions, enabled tools, or metadata.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

n8n - 💡(How to fix) Fix AI tool descriptions are not consistently evaluating n8n expressions before being passed to the agent/model