- Python
- TypeScript
signature
Valid variable values
- Python
- TypeScript
Variable values must be JSON-serializable: strings, numbers, booleans,
None, and dicts/lists composed of those types.Seeding variables at call start
For the following types of calls, variables can be seeded at the start.- Python
- TypeScript
- Outbound calls — pass a
variablesdict tocall_phone() - Campaigns — each contact’s
datadict becomes that contact’s variables
Other ways to store call state
As an alternative to call variables, you can keep per-call state in an in-process dictionary keyed bycall.id.
That said, we only recommend this for simple use cases. If your process restarts, any in-memory state will be lost.
For durable per-call state, use Redis or another session store keyed by call.id.
- Python
- TypeScript
Example
- Python
- TypeScript
example.py