Skip to main content

aiAgent

aiAgent is a group container node — it never executes directly. When the graph builder encounters it, it dissolves the node in-place: the inner workflow's nodes are merged into the unified execution graph, incoming outer edges are stitched to the inner agentInput node, and outgoing outer edges originate from the inner agentOutput node. The aiAgent node itself is dropped from the final graph.

It is the standard wrapper for packaging a hierarchical agent sub-workflow (typically a deepAgent with attached subagents and tools) as a single reusable step inside a larger pipeline.

Parameters

aiAgent accepts any fields (extra="allow"). However, params on the outer aiAgent node are not forwarded to the inner workflow. Inner nodes must reference outer workflow nodes directly via template syntax (e.g. {{ @httpRequest.query }}). The params block on aiAgent serves as documentation of intent only — the operative params are on the inner agentInput node.

Inner Workflow

The inner data.workflow must contain:

  • One agentInput node (entry point) — see agentInput
  • One agentOutput node (exit point) — see agentOutput
  • Any number of deepAgent, subagent, tool, and other nodes in between

Output

aiAgent has no output of its own. The effective output of the group is what the agentOutput node emits, which is whatever the last inner node passed to it.

Example

{
"id": "aiAgent",
"type": "aiAgent",
"data": {
"label": "AI Agent",
"isExecuted": false,
"handles": ["inputs", "outputs"],
"schema": {},
"params": {},
"inputs": [], "outputs": [], "errors": [],
"workflow": {
"nodes": [
{
"id": "agentInput",
"type": "agentInput",
"data": {
"isInput": true,
"params": {
"model": { "value": "{{ @httpRequest.model }}", "isExpression": true, "isAttachedToInputNode": false },
"system_prompt": { "value": "{{ @httpRequest.system_prompt }}", "isExpression": true, "isAttachedToInputNode": false },
"messages": { "value": "{{ @httpRequest.messages }}", "isExpression": true, "isAttachedToInputNode": false },
"datasetIds": { "value": [], "isExpression": false, "isAttachedToInputNode": false },
"maxSubAgents": { "value": 2, "isExpression": false, "isAttachedToInputNode": false },
"streaming": { "value": true, "isExpression": false, "isAttachedToInputNode": false }
}
}
},
{
"id": "deepAgentNode",
"type": "deepAgent",
"data": {
"params": {
"model": { "value": "{{ @agentInput.model }}", "isExpression": true, "isAttachedToInputNode": false },
"system_prompt": { "value": "{{ @agentInput.system_prompt }}", "isExpression": true, "isAttachedToInputNode": false },
"messages": { "value": "{{ @agentInput.messages }}", "isExpression": true, "isAttachedToInputNode": false },
"streaming": { "value": "{{ @agentInput.streaming }}", "isExpression": true, "isAttachedToInputNode": false }
}
}
},
{
"id": "agentOutput",
"type": "agentOutput",
"data": {
"params": {
"messages": { "value": "{{ @deepAgentNode.messages }}", "isExpression": true, "isAttachedToInputNode": false },
"sources": { "value": "{{ @deepAgentNode.sources }}", "isExpression": true, "isAttachedToInputNode": false }
}
}
}
],
"edges": [
{ "id": "e1", "source": "agentInput", "sourceHandle": "outputs", "target": "deepAgentNode", "targetHandle": "inputs" },
{ "id": "e2", "source": "deepAgentNode", "sourceHandle": "outputs", "target": "agentOutput", "targetHandle": "inputs" }
]
}
},
"position": { "x": 300, "y": 0 },
"isSelected": false,
"isDragging": false
}