Return Action
The action module for this action is "vb/action/builtin/returnAction".
This action (which should be the terminal action of a chain) allows you to control the outcome and payload of that chain when necessary. Parameters for this action are as follows:
| Parameter Name | Description |
|---|---|
| payload | The payload to return from this action. Useful in a 'callChainAction" to control the resulting payload from calling that action chain. This can be an expression. |
| outcome | The outcome to return from this action. Useful in a 'callChainAction" to control the resulting outcome from calling that action chain. This can be an expression. |
An example that uses the return action on a chain that makes a REST call, but returns a simpler value:
"myActionChain": {
"root": "myAction",
"actions": {
"someRestCall": {
"module": "vb/action/builtin/callRestAction",
"parameters": {...},
"outcomes": {
"success": "myReturnAction"
}
}
"myReturnAction": {
"module": "vb/action/builtin/returnAction",
"parameters": {
"outcome": "success",
"payload": "{{ $chain.results.someRestCall.body.somewhere.inthe.payload.isa.string }}"
}
}
}
}This will return a simple string on a successful REST call if this action chain was called via the 'callChainAction'.