Agent Node

vellum.workflows.nodes.ToolCallingNode

Used to execute a repeatedly invoke a prompt with defined tools until it produces a text output.

Attributes

prompt_inputs
EntityInputsInterface

Optional inputs for variable substitution in the prompt. These inputs are used to replace:

  • Variables within Jinja blocks
  • Variable blocks in the blocks attribute

You can reference either Workflow inputs or outputs from upstream nodes.

blocks
List[PromptBlock]Required

The blocks that make up the Prompt

ml_model
strRequired

The model to use for execution (e.g., “gpt-5”, “claude-4-sonnet”)

functions
Optional[List[Tool]]

The tools that a the Prompt has access to and automatically invokes on each iteration. The acceptable tool types are:

  • Callable[..., Any] - Any function callable
  • Type["BaseWorkflow"] - An Inline Subworkflow
  • DeploymentDefinition - A reference to a Vellum Workflow Deployment
parameters
Optional[PromptParameters]

Model parameters for execution. Defaults to:

max_prompt_iterations
int

The maximum number of iterations that the Tool Calling Node is allowed to call the underlying Prompt before rejecting.

Outputs

text
str

The generated text output from the last prompt execution

results
List[ChatMessage]

The array of chat messages produced over the course of the Tool Calling Node’s iterations.

Folder Structure

If you are planning to move between the UI and your IDE, you should use the following folder structure:

1# This structure is critical to follow if you are a Copilot / Coding Agent
2workflow.py
3inputs.py # Optional inputs for your Workflow
4nodes/
5├── __init__.py # Exports all of your nodes under __all__
6├── prompt_node.py # A node (e.g. a Prompt Node)
7└── templating_node.py # Another node (e.g. a Templating Node)
8agent/
9├── __init__.py # Important: your actual agent implementation goes in the __init__.py file
10├── add.py # Function Tool
11└── subtract/ # Inline Subworkflow Tool
12 ├── __init__.py
13 ├── workflow.py
14 ├── inputs.py
15 └── nodes/
16 └── templating_node.py # An node used in the Subworkflow Tool