The call

Automations

Functions that run before the first turn, at hang-up and after the call, what the agent and your systems get from them, and how tests treat them.

An agent's Automations tab holds the functions that run around a conversation, not during it. No model decides whether they run. They run at fixed points, in an order you set, and their conditions read variables and how the call ended.

StageWhen it runsWhat it can be
Pre-call functionsBefore the agent's first wordCustom API, Agent tool, Connected app
Hang-up functionsAs the call ends, within 10 secondsCustom API, Text message, Email, Slack message
Post-call functionsAfter Post-call analysis, within 90 secondsAny of the six

Add one with Add automation on its stage. A function can wait on others in the same stage, and a function that waits on one that failed or was skipped is skipped too. Automations belong to the version, so a change reaches callers when you publish.

A Text message function sends from the sender name VerticalAI. On a campaign call or a lead callback placed from an Australian mobile, it can send from that mobile instead, with your business name and Reply STOP to opt out added, once that is on for your workspace (Texts the agent sends on a call).

Pre-call functions

A pre-call function looks something up before the conversation starts: the caller's record by their number, today's roster, an open job. On a chat, pre-call functions run once, before the first reply.

The caller waits for every one

The agent speaks only after every pre-call function has finished. There's no overall limit, so the slowest chain of functions is how long the caller waits in silence.

  • A Custom API request stops at its Timeout, 7 seconds unless you change it (1 to 60), and tries again only on a timeout, a connection error or a server error, up to its Retries (0 by default, at most 3).
  • An Agent tool runs as long as that tool takes. A webhook tool stops at 15 seconds.
  • A Connected app stops at 15 seconds.

Keep each one fast. A lookup on the call path should answer in well under a second, with its timeout set to about 2 seconds and no retry, so a slow system costs the caller two seconds of silence at most, not seven. Health raises a risk when an inbound caller could wait more than 7 seconds before the agent speaks.

What the agent sees

Each pre-call function that succeeds puts its response in a note at the head of the conversation, which the model reads before its first reply. Agent fields decides how much:

  • Whole response (the default) gives the model every field, up to 15,000 characters.
  • Only listed fields gives it only the paths you list, one per line, such as data.0.name.

Keep that list short. Everything in it is something the agent can say, and a whole record from a CRM is mostly fields the call doesn't need. A field that mustn't reach a caller shouldn't reach the model at all (see Tools).

Outputs are separate. Each maps a response field to a name, typed Text, Yes/No or Number, and fills {{name}} in the system prompt.

A pre-call function that fails, times out, is skipped or is turned off adds nothing to the note. Its outputs fill the prompt as empty text, so write the prompt to read well when they're blank.

A pre-call function that finds the caller by their phone number can also stand in for asking who they are, for low-risk details. See Callers found by phone number.

Hang-up functions

Hang-up functions start the moment the call ends and must finish within 10 seconds. Post-call analysis hasn't run yet, so its results aren't available here. Use them for what has to happen at once, such as telling a live screen the call is over.

Post-call functions

Post-call functions run after Post-call analysis writes the summary, the outcome and your fields. Use them to send the wrap-up to your CRM, text a confirmation or post to a channel. Turning post-call analysis off stops them too (see Call checks).

Post-call fields

The fields panel on Post-call analysis holds the details you want pulled from every call: a Name, a Type (Text, Choice, Yes/No or Number), a Description, and Choices for a Choice field. An input set to AI on a post-call function works the same way, with its own instruction.

The description is the instruction the analysis follows, word for word. It answers from the call only, and leaves a field empty when the call didn't say. It never guesses. A vague description gets a vague answer.

Vague:   Notes about the job.
Better:  The fault the caller described, in their words, in one sentence.
         Empty if they didn't describe one.

What your system receives

Every value is text. A Yes/No field arrives as true or false and a number as its digits. Any field can be empty, because the call may not have answered it.

  • Inside quotes in a JSON body, a value is sent as a string, and an empty one as "".
  • Written bare, outside quotes, a value is sent as a JSON number, true, false or null. Use that only for a Number or Yes/No field.
  • A header, query or input whose value is empty is left out.
  • In an email body, an empty value is left blank and the rest of the email is sent.
  • A function whose URL or message would be empty isn't sent, and is recorded as skipped.

Write your endpoint to treat every field as text and an empty field as unknown.

What a function can fill in

A function's URL, query, headers, body and inputs can use these. The agent's variables work in every stage too, and so do the outputs of the functions it waits on.

VariableStagesHolds
{{call_id}}AllThe call's id, the one on its call page
{{caller.number}}AllThe caller's number on a phone call; on a call the agent placed, the number it rang
{{direction}}Allinbound or outbound
{{channel}}Allphone, web, teams or chat, or zendesk for an email answered on a Zendesk ticket
{{agent_number}}AllThe agent's number on this call, empty on chat
{{disconnection_reason}}Hang-up, post-callHow the call ended (below)
{{call_status}}Hang-up, post-callended or error, or not_connected when a call the agent placed rang out or was busy. That call has no conversation, so only its hang-up functions run
{{call_duration_seconds}}Hang-up, post-callThe call's length in whole seconds
{{call_summary}}, {{call_outcome}}, {{call_successful}}, {{user_sentiment}}, {{urgency}}, {{caller_type}}Post-callWhat Post-call analysis found
{{customer_name}}, {{account_number}}, {{phone_number}}, {{email}}, {{address}}, {{issue_type}}, {{resolution}}Post-callCaller details the analysis found in the call, empty when it didn't say
{{call_url}}, {{transcript}}, {{caller_is_team}}Post-callA link to the call, the transcript as Caller and Agent lines (the newest 20,000 characters), and whether the caller is on your team

Your Post-call fields are post-call variables too, by their names.

The disconnection reason is one of caller_hangup, agent_end_call, transfer_to_human, connection_lost, voicemail_detected, voicemail_reached, no_answer, busy, no_input_hangup, idle_timeout, max_duration, outside_hours, emergency, injection_hangup, moderation_hangup or error.

Conditions

Conditions decide whether a function runs. A rule can test a variable (the caller's details, an output, a post-call field). Hang-up and post-call functions can also test the disconnection reason, the call status, and whether the caller hung up early. A function's conditions see the outputs of the functions it waits on.

Trying them out

ActionWhat it does
Run a testRuns one function now, for real. A text message is sent, a request reaches your system.
PreviewRenders a Custom API, text, email or Slack function and sends nothing.
Dry run on a past call or chatRuns the hang-up and post-call functions against a call that already happened, and shows what each would have sent. Nothing is sent or saved.

In tests

Every test runs the agent's automations, marked as simulated. A function that would send something records what it would have sent instead: a hang-up or post-call Custom API request, a text, an email, a Slack message, a connected-app write.

A pre-call Custom API request or connected-app read runs for real only in a test whose Tools are set to Real systems. With Sample answers it's recorded as simulated, so in that test it adds nothing to the note and its outputs are empty.

On this page