Using a Tool in a Flow
Two ways a tool runs#
A tool can be reached in two ways, and the difference matters.
| The agent decides | A flow decides | |
|---|---|---|
| What triggers it | The agent reads the description and judges the moment. | A Call a tool step, at a fixed point in a flow. |
| Good for | Look-ups that could come up at any point in a conversation. | Steps that must happen in order, every time. |
| The description | Decides whether it fires, so it has to be right. | Not what fires it — the flow does. |
The Call a tool step#
In the flow editor, add a Call a tool step and choose the tool with Tool to call.
That is all the step needs. Everything about how the call is made — the address, the inputs, the credential, what the agent is told — belongs to the tool, not to the step. The step only says when.
The step branches two ways:
- It worked — what happens next when the call succeeded.
- It didn't — what happens when it did not.
Always build the It didn't branch
The editor flags a tool step whose branches go nowhere: "Nothing happens after the call." An unfinished failure branch means a customer sits waiting on a reply that never arrives, which is the worst way for this to go wrong.
Where the values come from#
The tool's inputs are filled the same way in a flow as anywhere else: the agent supplies them from the conversation.
In practice that means asking first. A renewal flow asks for the policy number in an Ask a question step — with a checked answer, so a mistyped number is caught before the call — and the tool step that follows uses it.
Asking first has a second benefit: a bad policy number produces a helpful retry from your flow, rather than a failed API call and an apology.
Tools that only a flow may use#
Some tools should never be reached on the agent's own judgement — something that cancels a policy, say, which must only happen at the end of a flow that has already confirmed it.
Switching on Use only in Flow does exactly that. The agent will not choose it by itself, and because the description is no longer what fires it, the description stops being required.
The Call a tool step can still select it as normal.
Putting it together#
A renewal flow, with the tool in the middle of it:
- Send a message — "Happy to help with your renewal."
- Ask a question — the policy number, as a checked answer.
- Call a tool — look the policy up.
- It worked → confirm the renewal date, then ask whether to go ahead.
- It didn't → apologise and hand off to a person.
- Call a tool — start the renewal. This one changes something, so it confirms first.
- End the flow.
Two tools, one flow: a look-up and a change, with the question between them. That shape — ask, look up, confirm, act — covers most of what flows are for.