To change the behaviour of a workflow based on the instance data, use a switch state. This state does nothing except choose between any number of different possible state transitions.
Parameter
Description
Type
Required
type
Identifies which kind of StateDefinition is being used. In this case it must be set to switch.
string
yes
id
An identifier unique within the workflow to this one state.
string
yes
log
If defined, the workflow will generate a log when it commences this state. See StateLogging.
Identifies which state to transition to next, referring to the next state's unique id. If undefined, this state terminates the workflow. But only if none of the conditions are met.
string
no
catch
Defines behaviour for handling of catchable errors.
Selects or generates the data used to determine if condition is met. The condition is considered met if the result is anything other than null, false, {}, [], "", or 0.