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
  • Examples
  • Retry a request up to three times
Messaging

goto

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

label

Next
Built with

Jump to a label within the current section. Used for retry loops and conditional repetition.

goto does not cross subroutine boundaries — it can only jump within the section that contains the matching label.

Properties

goto
objectRequired

An object that accepts the following properties.

goto.label
stringRequired

Label to jump to. Must reference a label step earlier or later in the current section.

goto.max
integerDefaults to 100

Maximum number of times this goto can jump to its label. Once the limit is reached, the section ends without running any further steps.

Examples

Retry a request up to three times

1version: 1.0.0
2sections:
3 main:
4 - label: try_lookup
5 - request:
6 url: "https://api.example.com/lookup"
7 body:
8 phone: "%{message.from}"
9 save_variables: true
10 - switch:
11 variable: request_result
12 case:
13 success:
14 - reply:
15 body: "Hi %{request_response.name}!"
16 timeout:
17 - goto:
18 label: try_lookup
19 max: 3
20 default:
21 - reply:
22 body: "Sorry, we couldn't look up your account."