Before you build one
Two questions decide whether this is the right tool. Does the agent need the answer during the call? If the information can wait until afterwards, a summary email or a post-call webhook is simpler and cannot keep a caller waiting. Does the endpoint answer quickly? Anything over two or three seconds is a long silence on a phone call. If your system is slow, say so in the pre-execution message and keep the timeout honest.Name it and describe it well
The description is not documentation. It is how the agent decides whether to call this at all, so write it for a colleague who has never seen your systems. Avoid describing data the call does not return. If your description promises delivery dates and the response has none, the agent will keep looking for them and improvise when it cannot find them.Declare your parameters
Add each value the call needs under Parameters, with a name, a type and a short description. This matters more than it looks. With parameters declared, the agent fills them in one at a time, like arguments. Without them, it has to compose a blob of JSON from your URL, and it gets that wrong more often.
Values the agent cannot know, such as the caller’s phone number or the language of the call, do not need to be parameters. Write them straight into the URL or body as
{{caller_phone_number}} and {{language}}, and the call fills them in from the conversation.
Response mapping
Leave this empty and the agent gets the whole response. For most lookups that is exactly right, and mapping every field by hand would be work for nothing. Map when you want one of three things:- Narrow what the agent sees. Useful when the response carries fields that are irrelevant, or that you would rather the agent did not repeat back to a caller.
- Keep a value for later. Mapped values are remembered for the rest of the conversation, so a later call or a later step can use them.
- Route on a value. In a flow, a mapped value can decide which way the conversation goes next.
The syntax
The left box is the variable name you choose. The right box is the path into the JSON response.
A leading
$. is also accepted, so $.data.customer.name works too. You will see that style in our own integration definitions. It makes no difference to the result, so use whichever you find easier to read.
Mapped values stick around
A later call can use a mapped value as{{customer_name}}, exactly like any other variable. It is saved with the conversation too, so you can see it afterwards.
That makes chaining natural: one call looks up a customer id, the next uses it.