Tasks
Send Action
The sendaction task automatically executes an action on a stub, or a list of stubs.
Possible uses include conditionally executing a second action, alerting a different stub of an action taken, or even closing a list of stubs. It is worth noting that the sent action still needs to be available in the target stub's state, else the task will fail with the error action_not_in_state
.
Basic usage
Parameters
action_name
The name of the action you want to execute.
required
if the action_names
parameter is not set.
action_names
A list of action names you want to execute. Allows running multiple actions in a single task.
required
if the action_name
parameter is not set.
data
The data passed to the action in lieu of form data, which can be substituted in with ~~stubpost.data
.
message
The action's message.
stubref
The stubref of the stub the sent actions will be executed on.
required
if the stubrefs
parameter is not set.
stubrefs
A list of stubrefs of the stubs the sent actions will executed on.
required
if the stubref
parameter is not set.
bulk_action
If this is set to true
, the action will run on our bulk systems. Actions that run on the bulk systems do not have
a guaranteed order of execution, the upside is that more systems can handle these actions since order does not matter.
This is useful when you want to run thousands of a specific action and the order that they run in does not matter.
Result
Properties
sendActionsList
The list of actions that has be placed in the execution queue.
sendActionsList.action_name
The name of the action that has been sent to the execution queue.
sendActionsList.stubref
The stubref that the action was sent to and will execute on.
sendActionsList.data
The data that was sent as the action data.
sendActionsList.stubref
The message that was used for the action. In other words, the stubpost message.
Examples
Sending to multiple stubs
Using the stubrefs
parameter instead of stubref
allows you to execute the same action on multiple stubs.