Run your own code during a call
Add a Custom tool or an available Python Code Action, define inputs, and check its runtime result.
ReviewedOn this page
You can have the agent run your own code mid-call — to check something in your system, calculate a price, or qualify a caller.
Custom tool (available to everyone)
- Open the call flow. In Settings, click Add next to Functions.
- Under Build your own, click Custom tool.
- Give the tool a name and a description — the description is what the agent reads to decide when to use it, so be specific.
- Choose how it runs: your own code, a call to your API, or a written response.
- Define the inputs the agent should collect before running it.
- Save, then publish the flow.
Code Actions (limited availability)
Code Actions runs Python during a call and is enabled for specific workspaces. If you don't see it, use a Custom tool instead — or contact support if you think your workspace should have it.
- Open the call flow, then Settings → Advanced Settings → Integrations → Code Actions.
- Click Add Action.
- Fill in the name, the description shown to the agent, the input variables, and your Python code.
- Save, then publish the flow.
Testing
Run a test call and ask the agent something that should trigger the action. Check the result appears in the call record, and that the agent uses the value in what it says next.