dify - 💡(How to fix) Fix Feature Request: Allow Agent node to use workflow nodes as tools (Knowledge Base, HTTP Request, Code, etc.) [1 participants]

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…
GitHub stats
langgenius/dify#35529Fetched 2026-04-24 06:14:09
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
1
Participants
Timeline (top)
labeled ×1
RAW_BUFFERClick to expand / collapse

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

The Agent node currently can only use external tools (plugins, built-in tools, MCP). It cannot use Dify's own workflow nodes — Knowledge Base, HTTP Request, Code, etc. — as tools.

This means if a user wants their agent to decide when to search a knowledge base or when to make an HTTP request (rather than always doing it), they have to publish a separate workflow-as-tool, which is cumbersome and breaks the single-workflow experience.

Users should be able to select any node in the same workflow as an agent tool directly from the agent's settings panel.

2. Additional context or comments

UI: A "Node Tools" dropdown in the agent node settings panel, listing other nodes in the same workflow. The user selects which nodes the agent can call as tools.

Tool description for LLM: Auto-generated from the node's type and configuration, combined with a user-provided description. For example, a Knowledge Base node becomes: "Search the product documentation knowledge base. Use this when the user asks about product features or troubleshooting."

Parameter mapping: Dynamically generated based on how the user configured each node. For example:

Knowledge Base node → tool parameter: query (string) HTTP Request node → tool parameters based on template variables in URL/body Code node → tool parameters from user-defined input variables Execution: When the agent's LLM calls a node-tool, the agent executes that node using the existing create_child_engine() pattern (same mechanism iteration/loop nodes use), gets the result, and returns it to the LLM for continued reasoning.

Supported node types (phased):

PhaseNode Types
Phase 1Knowledge Retrieval, HTTP Request
Phase 2Code, Template Transform, LLM
Phase 3Tool (plugin), Document Extractor, Parameter Extractor, Question Classifier

Not supported: Start, End, IF/ELSE, Iteration, Loop (flow control nodes don't make sense as callable tools).

Technical Approach The agent node already receives tools via AgentToolEntity. This feature would:

Add a "node_tools" field to agent node config — list of node IDs in the same workflow At runtime, for each selected node, auto-generate an AgentToolEntity from the node's input/output schema When the agent calls a node-tool, execute it via child engine (like iteration nodes do) and return the output Combine auto-generated tool description with user's custom description for LLM function-calling

3. Can you help us with this feature?

  • I am interested in contributing to this feature.

extent analysis

TL;DR

To enable the Agent node to use Dify's own workflow nodes as tools, add a "node_tools" field to the agent node config and auto-generate an AgentToolEntity for each selected node.

Guidance

  • Modify the agent node config to include a "node_tools" field, which will store a list of node IDs from the same workflow.
  • Develop a mechanism to auto-generate an AgentToolEntity for each selected node, based on its input/output schema.
  • Implement the execution of node-tools via a child engine, similar to iteration nodes, and return the output to the LLM.
  • Consider phasing the rollout of supported node types, starting with Knowledge Retrieval and HTTP Request nodes.

Example

// Example of auto-generating an AgentToolEntity for a Knowledge Base node
const knowledgeBaseNode = { type: 'Knowledge Base', input: { query: 'string' } };
const agentToolEntity = {
  id: knowledgeBaseNode.id,
  type: 'node-tool',
  input: knowledgeBaseNode.input,
  description: `Search the ${knowledgeBaseNode.type} node`,
};

Notes

The implementation details may vary depending on the specific requirements and constraints of the Dify platform. It's essential to ensure that the auto-generated AgentToolEntity accurately represents the selected node's capabilities and input/output schema.

Recommendation

Apply the workaround by adding the "node_tools" field to the agent node config and auto-generating AgentToolEntity instances for each selected node, as this will enable the Agent node to use Dify's own workflow nodes as tools.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING