return

View as Markdown

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.