return
Return from the current section. Inside a section or document called via
execute, control returns to the caller and the value is
accessible as return_value in the caller’s context. A document run with execute starts at its
own main, so a return there also hands its value back to the caller.
In the top-level main, meaning the document handling the inbound message or a document reached
through transfer, there is no caller: return stops
execution entirely and its value is discarded.
To return without a value, use return: null.
Properties
return
The value to return. Accepts any type. Use null to return no value.
Variables
When called from a section or document invoked via
execute, return provides the variable below to the
caller’s context once execution resumes. When called from the top-level main, return stops
execution immediately and no variable is set anywhere.
return_value
The value supplied to return. Available in the caller’s context after the execute step
that invoked this section or document completes. String values are expanded for %{...} placeholders
before storage; objects and arrays are stored as-is.
Examples
Return a string from a subroutine
Return with no value (set return_value to null)
An explicit return: null from a section or document called with execute sets the caller’s
return_value to null, overwriting any earlier value. In the top-level main, there is no
caller, so no variable is set.