Adding a function
Add a function to the Actions field of a managed topic in three ways:- Type
/in the Actions field - Right-click in the Actions field
- Click the + icon on the right side of the field
{"{{fn:...}}"} vs {"{{ft:...}}"} syntax
The {"{{fn:...}}"} syntax references global functions, which can be used across topics, flows, and rules. This is different from transition functions ({"{{ft:...}}"} syntax), which are scoped to a single flow.
See Transition functions for details on flow-scoped functions.
Known limitation: functions in flows
Example prompt
Use this pattern in the Actions field to ensure the agent calls a function before responding:Controlling agent behavior after a function call
Functions can return values that control what the agent says or does next — for example, returning an exactutterance for the agent to speak, triggering a handoff, or ending the call with hangup.
See Return values for the full reference.
Testing
Save and open the test panel
Save your agent and click Play in the header to open the test chat panel.
Test the invocation
Ask a test question like “Where is my order?” and observe how the agent handles the interaction.
Inspect tool calls
Enable the tool calls toggle in the test panel settings to inspect which functions were called and what parameters were passed. Use this to confirm the function was actually triggered and that the correct arguments were sent — especially when the agent is not behaving as expected.
Related
- Using tools in topics — detailed guide on integrating functions into managed topics
- Create a function — set up a new function with parameters and Python code
- Return values — control agent behavior with function return values
- Transition functions — flow-scoped functions using
{"{{ft:...}}"}syntax

