goto

View as MarkdownOpen in Claude

Jump to a label within the current section, optionally based on a condition. The goto method will only navigate to a label within the same section.

Properties

goto
objectRequired

An object that accepts the following properties.

goto.label
stringRequired

The label in section to jump to.

goto.when
string

A JavaScript condition that determines whether to perform the jump. If the condition evaluates to true, the jump is executed. If omitted, the jump is unconditional.

goto.max
integerDefaults to 100

The maximum number of times to jump, from the minimum of 1 to max 100 jumps.

Examples

Loop with max

1version: 1.0.0
2sections:
3 main:
4 - label: foo
5 - play:
6 url: 'say: This speech will be repeated 4 times.'
7 - goto:
8 label: foo
9 max: 3

Loop if a condition is satisfied

1version: 1.0.0
2sections:
3 main:
4 - label: foo
5 - play:
6 url: 'say: This is some text that will be repeated 4 times.'
7 - set:
8 do_loop: true
9 - goto:
10 label: foo
11 when: do_loop === true
12 max: 3