Feature Request: Dynamic Tool Connection for AI Agent based on runtime conditions

Problem / Use Case

When building AI Agent workflows in n8n for SaaS products, I often need to give users the ability to enable or disable specific tools based on their subscription plan or personal settings.

Currently, tool connections to the AI Agent node are static — they must be wired on the canvas at design time. There is no native way to conditionally include or exclude a tool at runtime.

The two existing workarounds both have significant drawbacks:

  1. System Prompt control — Tell the agent “only use ENABLED tools” via system message. This works in theory, but is not reliable: it depends 100% on LLM compliance, and a hallucinating model may still attempt to call a DISABLED tool.

  2. Switch node + multiple AI Agent nodes — Create one AI Agent branch per tool combination. This works reliably, but combinatorially explodes: with 10 independently toggle-able tools, you get up to 2^10 = 1024 possible branches. Completely impractical.

Proposed Feature

Add support for dynamic tool connections in the AI Agent node. A few possible approaches:

Option A: Conditional tool input
Allow each tool connection slot to accept a boolean expression or condition. If the condition evaluates to false at runtime, that tool is excluded from the agent’s tool list for that execution.

Option B: Tool list as a data input
Allow the AI Agent node to accept a dynamic list of enabled tool names/IDs via a data input pin. The agent would only expose tools whose names appear in that list.

Option C: “Tool enabled” toggle per tool node
Add an Enabled expression field on each tool sub-node (similar to how items can be disabled in other nodes), so you can pass {{ $json.toolA_enabled }} directly.

Why This Matters

This is a common pattern in multi-tenant SaaS built on n8n:

  • Different users have different plans → different tool access
  • Feature flags need to be enforced at the infrastructure level, not just the prompt level
  • The current workarounds scale very poorly

A dynamic tool connection mechanism would make n8n significantly more production-ready for AI Agent use cases.

Votes appreciated if you’ve hit this limitation too!

Hi @nguyenthieutoan :waving_hand:

This is a very interesting and practical feature request. I like the problem you are solving, especially for multi tenant SaaS use cases where tool access should depend on plan, feature flags, or user settings.
Today, the AI Agent node works with connected tool sub-nodes, and runtime control is really the key issue here. n8n already shows that tool execution can be gated at runtime with :backhand_index_pointing_right: human review, so I think your idea fits the direction of production safe agent workflows very well.


I also agree that prompt only control is not enough if you need real enforcement. A prompt can guide tool choice, but it cannot guarantee that a disabled tool will never be attempted.
My :backhand_index_pointing_right: OOP-style prompt factory is a good way to structure prompts and data before they reach the agent, but for true tool enable/disable enforcement, runtime control is still needed.


The dynamic tool connection idea would definitely make agent workflows more scalable and much easier to manage in real SaaS systems.
Good proposal; I hope it gets attention.

2 Likes