Skip to main content
Every custom function has an execution phase that decides when it runs. Most functions are tools the agent calls mid-conversation, but a function can also run once at the start of a call or once at the end.

The three phases

You assign functions to phases from the agent’s Functions tab, under Call Lifecycle for the before and after phases, and under the tool list for during-call functions.

Before the call

Use this for anything the agent should already know when it picks up — an account record, a delivery status, whether this caller is on a list. The function runs once at the start of the call. Whatever it returns becomes available to the agent as context and as variables the workflow can use, so the agent can greet the caller with the information already in hand rather than looking it up mid-sentence.
A pre-call lookup is usually a better experience than a mid-call one: the agent never has to pause to fetch something it could have had all along.

During the call

This is the default. The function is exposed to the agent as a tool, and the agent calls it when the conversation calls for it — looking up an order, checking availability, creating a ticket. Because the caller is waiting, keep these fast. If an operation is slow and the result is not needed for the agent’s next sentence, mark it async instead.

After the call

Use this to push an outcome somewhere once the call is over. The function runs after the call ends, when the transcript, the summary, and any structured analysis are available. Typical uses:
  • Writing a record into an internal system
  • Notifying a team about an outcome
  • Triggering a follow-up process
Post-call functions and webhooks cover similar ground. Use a webhook when you want the call data delivered to a system you control; use a post-call function when you want to act on the call from inside VoiceInfra’s function system.

Choosing a phase

Use before the call when

The agent should know something from the first word, and the value does not change during the call.

Use during the call when

The caller’s own words decide whether the action is needed, or the data must be current at that moment.

Use after the call when

The action needs the finished conversation — the transcript, summary, or extracted fields.

Use a webhook instead when

You want the raw call record pushed to your own endpoint rather than acting on it inside VoiceInfra.

Frequently asked questions

Yes. You can assign multiple functions to the before and after phases, and as many tools to the during-call phase as you need.
Its response becomes context the agent can use, exposed to prompts and workflows as variables. Return structured JSON with clearly named fields so the agent can reference specific values.
The call has finished, so the transcript, the AI-generated summary, and any structured analysis are all available alongside the call’s basic details.
No. Workflow tool nodes run mid-conversation, so they only accept during-call functions. Publishing tells you when this is the problem.
Assigning them does not. Any API calls they make are yours, and any calls or messages they trigger are metered normally.