The Function node (type: "function") runs one of the flow's functions as soon as the flow reaches it. Use it when an action must happen at a known point: check availability after the caller gives a date, create the booking after confirmation, log the lead before ending.
Configure#
- Add a Function node. It picks the flow's first function if there is one.
- In Node settings, choose the Function. New opens the function modal to create a Custom Function and select it.
- Wait for result ("Hold the transition until the function returns.") is on by default.
- Speak during execution is off by default. When on, the node speaks its Message while running (optional).
- Add transitions. New function nodes start with a prompt transition "Function completed". Replace it with equation transitions on the function's response variables where you can.
Any function type can be used: custom, code, MCP, integration app, extract, SMS, transfer, end call and so on.
How it runs#
Optional message#
If Speak during execution is on, the node speaks its Message while running (a prompt or a static sentence). If that is empty, it speaks the function's own execution message, or "One moment please."
Arguments#
If the function has parameters, one LLM call with the conversation (and the node's message text as an extra instruction) fills them in. Pinned values are added as usual.
Run#
With Wait for result on, the flow waits for the function to finish. With it off, the function runs in the background and the flow moves on immediately.
Transitions#
Equation transitions are checked first (they can read the function's response variables), then prompt transitions and global nodes in a separate LLM call, then the else edge. If nothing matches, the flow stays in the node and the agent replies.
The function's own Speak during execution and Speak after execution settings are not used inside a function node; the node controls speech. The function's Typing sound still plays while it runs. A function that ends the call (end call, a successful transfer) ends the flow.
Fields#
| Field | Type | Default | Description |
|---|---|---|---|
type |
"function" |
||
tool_id |
string | A tool_id from the flow's tools[] |
|
wait_for_result |
boolean | true |
Wait before evaluating transitions |
speak_during_execution |
boolean | false |
Speak the instruction while running |
instruction |
{type, text} |
Message while running; also guides argument generation | |
edges |
array of edges | [] |
|
else_edge |
edge | Optional |
{
"id": "node_check",
"type": "function",
"name": "Check availability",
"tool_id": "tool_check_availability",
"wait_for_result": true,
"speak_during_execution": true,
"instruction": { "type": "static_text", "text": "Let me check the diary for you." },
"edges": [
{
"id": "edge_free",
"destination_node_id": "node_offer",
"transition_condition": { "type": "equation", "equations": [{ "left": "{{next_slot}}", "operator": "exists" }], "operator": "&&" }
}
],
"else_edge": { "id": "edge_none", "destination_node_id": "node_no_slots", "transition_condition": { "type": "prompt", "prompt": "Else" } }
}Gotchas#
- A function node that references a deleted function logs an error and skips the call, then evaluates its transitions.
- With Wait for result off, response variables are not there yet when transitions are evaluated.
- Prompt transitions after a function cost an extra LLM call. An equation plus an else edge is faster and deterministic.