Modality-aware responses for text and voice conversations
Key Takeaway
To make one Agentforce Service agent reply differently in voice and text, write agent-level instructions that branch on the read-only system variable @system_variables.current_modality. Give a rule for each value: "voice" and "text".
The same Agentforce Service agent can talk with customers in text, over a Messaging or Enhanced Chat v2 connection, or in voice, over a Telephony connection. A good reply often needs to look different in each mode. The read-only system variable @system_variables.current_modality tells the agent which mode it is in. You can use it in conditional instructions or pass it to actions, so you can shape replies for reading or for listening.
What system variables are
- You reference a system variable as
@system_variables.<variable_name>. - You don't define system variables in the variables block.
- A system variable holds a value only during the conversation session.
- System variables work in the same places as custom and linked variables, so they can appear in instructions, logical expressions, action inputs, and filters.