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.
SWML content in one of three formats:
string — raw SWML JSON text (parsed via JSON.parse; invalid JSON is wrapped as { raw_swml: content })Record<string, unknown> — SWML data structure (shallow-copied into the action)toDict() method (e.g., a SwmlBuilder instance) — the returned dictionary is used as the SWML payloadWhen true, the call exits the agent after the SWML executes. When false,
the SWML executes inline and the agent continues.
FunctionResult — this, for chaining.