> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # executeSwml > Execute a raw SWML document as an action. [connect]: /docs/server-sdks/reference/typescript/agents/function-result/connect [record-call]: /docs/server-sdks/reference/typescript/agents/function-result/record-call [send-sms]: /docs/server-sdks/reference/typescript/agents/function-result/send-sms [functionresult]: /docs/server-sdks/reference/typescript/agents/function-result 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. > **Note** > > Most use cases are covered by the specific action methods > ([`connect()`][connect], > [`recordCall()`][record-call], > [`sendSms()`][send-sms], etc.). > Use `executeSwml()` only when you need SWML features not available through > convenience methods. ## **Parameters** **`swmlContent`** `string | Record | { toDict(): Record }` — required 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` -- SWML data structure (shallow-copied into the action) * An object exposing a `toDict()` method (e.g., a `SwmlBuilder` instance) -- the returned dictionary is used as the SWML payload --- **`transfer`** `boolean` — default: false When `true`, the call exits the agent after the SWML executes. When `false`, the SWML executes inline and the agent continues. --- ## **Returns** [`FunctionResult`][functionresult] -- `this`, for chaining. ## **Example** ```typescript {4} import { FunctionResult } from '@signalwire/sdk'; const result = new FunctionResult() .executeSwml({ version: '1.0.0', sections: { main: [{ play: { url: 'https://example.com/audio.mp3' } }] }, }); ``` > Execute a raw SWML document as an action.