executeSwml
Execute a raw SWML document as an action. This is the escape hatch for advanced use cases that are not covered by the named convenience methods.
Most use cases are covered by the specific action methods
(connect(),
recordCall(),
sendSms(), etc.).
Use executeSwml() only when you need SWML features not available through
convenience methods.
Parameters
swmlContent
SWML content in one of two formats:
string— raw SWML JSON text (parsed viaJSON.parse; invalid JSON is wrapped as{ raw_swml: content })Record<string, unknown>— SWML data structure (spread into the action)
transfer
When true, the call exits the agent after the SWML executes. When false,
the SWML executes inline and the agent continues.
Returns
FunctionResult — this, for chaining.