Skip to main content

Input variables

Input variables carry information supplied when a conversation starts, such as a preferred language or a customer reference. Your agent can read these values in its prompt. In an inbound call flow, Branch on value can also use them to choose an agent before it starts.

Input variables are a general conversation feature. This guide covers branching on them in inbound call flows, where the supported source today is SIP headers sent through the audio gateway.

Send values with a SIP call​

SIP headers are one way to supply input variables when a conversation starts. For an inbound SIP call, add a header whose name starts with X-Stellar-Public- to the initial SIP INVITE:

X-Stellar-Public-Language: NL
X-Stellar-Public-Customer-Id: ABC-123

Stellar removes the prefix, converts the name to lowercase, and replaces hyphens with underscores. These headers become language and customer_id. Use names containing only letters, numbers, hyphens or underscores after the prefix, and avoid sending two headers that become the same name. Values keep their original case.

Values over 512 bytes are truncated. If you send a header more than once, its values become one comma-separated value. For example, NL and FR become NL,FR, which won't match a case containing only NL.

Only the first 32 distinct X-* headers in an INVITE are read. Put X-Stellar-Public-* headers early so they fall within that limit. Headers without the public prefix aren't exposed to the agent as input variables. See SIP headers for the call context sent by your phone system.

Branch on an input variable​

In Routing → Flows, open an inbound call flow and add a Branch on value step. Select Input variable as the Value source, then enter the short name in Variable name:

language

Add a case for each value you want to route, such as NL, FR and EN, and connect each case to its destination. Cases match exactly: NL doesn't match nl. Conversations with an unmatched value or without that input variable follow No match, so connect that branch too.

You can use an input variable at the start of the flow, after an API call, on an agent's failure path, or after an agent hands the conversation back. The flow always reads the value received when the conversation started; an agent hand-back cannot replace it. Branching on input variables is currently supported only in inbound call flows through the audio gateway.

Read the value in an agent​

Refer to the same value in your agent's prompt using its full path:

The preferred language is in call.input_variables.language:
NL means Dutch, FR means French, and EN means English.

To start the call in the passed language rather than describe it in the prompt, turn on Use the language passed by the call. The language input variable then sets the starting language when the agent allows it.

Input variables come from the caller's system. Do not use them for authorization decisions. They are exposed to the agent, so send only information the agent should have access to.

Choose another value source​

After an agent hands back, Resume parameters reads the values passed to its Resume flow action, while Agent variables reads its conversation variables. Earlier step output reads an earlier API call's result before a hand-back, or in an email flow an earlier Classify with AI step's answer. Flow connector identifies the connector that started the conversation and is available throughout an inbound call flow.

In human outbound flows, Variables refers to the values configured under Variables. Those workspace variables aren't a Branch on value source in inbound flows.

Next steps​