AI Agent1 input → 0 outputs
Tool Terminate
Marks the end of a tool execution flow and returns the result back to the AI Agent.
Inputs
Outputs
This node has no outputs—it signals completion back to the Tool Adapter internally.
Details
Every tool flow started by a Tool Adapter must end with a Tool Terminate node. This node:
- Captures the final
msg.payloadas the tool result - Signals completion to the originating Tool Adapter
- Returns the result to the AI Agent for processing
Return Values
The AI receives whatever is in msg.payload:
- String: AI sees as text response
- Object: AI can parse structured data
- Array: AI can iterate over results
Flow Pattern
[Tool Adapter output 2] → [Your Logic] → [Tool Terminate]
Examples
Simple Result:
msg.payload = "Patient found: John Smith, DOB: 1985-03-15"; return msg; // Goes to Tool Terminate
Structured Result:
msg.payload = {
found: true,
patient: { name: "John Smith", mrn: "12345" },
count: 1
};
return msg;
Best Practices
- Always end tool flows with Tool Terminate
- Return meaningful data in
msg.payload - Include error information if the tool failed
- Keep responses concise—AI has context limits