For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
ReferenceGuides
ReferenceGuides
  • Core
    • Introduction to SWML
    • Expressions
    • Template functions
    • Variables
    • Errors
  • Calling
    • Overview
    • ai
    • ai_sidecar
    • amazon_bedrock
    • answer
    • cond
    • connect
    • denoise
    • detect_machine
    • enter_queue
    • execute
    • goto
    • hangup
    • join_conference
    • join_room
    • label
    • live_transcribe
    • live_translate
    • pay
    • play
    • prompt
    • receive_fax
    • record
    • record_call
    • request
    • return
    • send_digits
    • send_fax
    • send_sms
    • set
    • sip_refer
    • sleep
    • stop_denoise
    • stop_record_call
    • stop_tap
    • switch
    • tap
    • transcribe
    • transcribe_stop
    • transfer
    • unset
    • user_event
  • Messaging
    • Overview
    • execute
    • goto
    • label
    • receive
    • reply
    • request
    • return
    • switch
    • transfer
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Properties
  • Variables
  • Examples
  • Return with optional value
  • Return with multiple values
  • using the on_return parameter
  • Return with no value
Calling

return

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

send_digits

Next
Built with

Return from execute or exit script.

return
anyRequired

The return value.

Properties

No specific parameters. The value can be set to any type.

Variables

Set by the method:

  • return_value:(out) Optional return value.

Examples

Return with optional value

1version: 1.0.0
2sections:
3 main:
4 - return: 1

Return with multiple values

1version: 1.0.0
2sections:
3 main:
4 - execute:
5 dest: fn_that_returns
6 - play:
7 url: 'say: returned ${return_value[0].a}'
8 fn_that_returns:
9 - return:
10 - a: 1
11 - b: 2

using the on_return parameter

1version: 1.0.0
2sections:
3 main:
4 - execute:
5 dest: fn_that_returns
6 on_return:
7 - play:
8 url: 'say: returned ${return_value}'
9 fn_that_returns:
10 - return: hello

Return with no value

1version: 1.0.0
2sections:
3 main:
4 - return: {}

Additional examples are available in the introduction.