1. Tasks
  2. Send Action

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

editor
        {
    "tasktype": "sendaction",
    "params": {
        "action_name": "_update",
        "data": {
            "hello": "world"
        },
        "message": "Updated action",
        "stubref": "2024-01-01-XXXX-ABCD"
        "bulk_action": false
    }
}

      

Parameters

action_name

optional
string

The name of the action you want to execute.

required if the action_names parameter is not set.


action_names

optional
string[]

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

string

The action's message.


stubref

optional
string

The stubref of the stub the sent actions will be executed on.

required if the stubrefs parameter is not set.


stubrefs

optional
string[]

A list of stubrefs of the stubs the sent actions will executed on.

required if the stubref parameter is not set.


bulk_action

required
boolean

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

loading...

Properties

sendActionsList

array

The list of actions that has be placed in the execution queue.


sendActionsList.action_name

string

The name of the action that has been sent to the execution queue.


sendActionsList.stubref

string

The stubref that the action was sent to and will execute on.


sendActionsList.data

string

The data that was sent as the action data.


sendActionsList.stubref

string

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.

loading...