Messaging

goto

View as MarkdownOpen in Claude

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."