Skip to content

Actions

Actions are the tasks that ECA performs when an event occurs and any associated conditions are met. They are the "do" part of the Events-Conditions-Actions pattern -- the components that actually make changes to your site.

What is an action?

An action is an operation that ECA executes as part of a model's processing flow. Unlike conditions (which only evaluate and never modify), actions carry out real work: creating content, sending emails, modifying entities, setting token values, and more.

Actions can be chained together. The output of one action (often stored as a token) can be used as input for the next, allowing you to build complex automated workflows step by step.

Common action categories

ECA provides a large number of actions. Here are some of the most frequently used categories:

Content actions
Create, update, save, or delete content entities. Examples include Save entity and Entity: set field value.
Token actions
Set, modify, or manipulate token values for use later in the process. The most common is Token: set value.
User actions
Manage user accounts -- assign roles, switch the current user context, block or unblock accounts. See also Permissions for how user context affects processing.
Notification actions
Send emails, display messages to the user, or write to the log.
Trigger actions
Trigger other ECA events, including custom events, to create modular, reusable workflows.
Form actions
Modify forms by setting field values, adding validation errors, or altering form elements.
External actions
Interact with external systems via HTTP requests, webhooks, or queue processing.

Browsing available actions

The full list of actions depends on which modules are installed. See the Plugins section for a complete reference, organised by module.

How actions work in ECA

When ECA reaches an action during processing, it:

  1. Evaluates any conditions on the incoming connection. If a condition returns FALSE, the action (and all its successors) is skipped.
  2. Executes the action with the configured parameters, replacing any token references with their current values.
  3. If the action produces a result (e.g. a loaded entity, a computed value), it stores that result as a token under the name you specify.
  4. Proceeds to any successor actions connected from this action.

Actions are processed sequentially in the order their connections were created.

Successors and chaining

An action can have one or more successor connections, each optionally guarded by conditions. This allows you to:

  • Chain actions: Connect actions in sequence to build multi-step workflows.
  • Branch based on outcome: Use conditions on outgoing connections to create conditional paths after an action.
  • Trigger sub-processes: Use the trigger custom event action to delegate work to another model.

Adding an action to a model

Workflow Modeler

  1. Open your model at Configuration > Workflow > ECA.
  2. From the toolbar or canvas, add an Action node.
  3. Select the action type from the categorised list.
  4. Configure the action's settings in the side panel (e.g. field values, token names, email recipients).
  5. Connect the action to its predecessor (event, gateway, or another action) using an edge.
  6. Optionally add conditions to the incoming edge.

You can also use the Quick-Add feature: click the + on any existing node to add a connected successor action directly.

BPMN.iO

  1. On the canvas, add a Task element (the rounded rectangle).
  2. Use the wrench icon to configure the task type as an ECA action.
  3. In the configuration panel on the right, select the action from the dropdown.
  4. Configure the action's settings.
  5. Draw sequence flows to connect the action to its predecessor and any successors.

Classic Modeler

  1. Use the form interface to add an action by selecting from the available action types.
  2. Fill in the configuration fields.
  3. Connect the action to its predecessor and any successors using the form-based interface.

Tokens and actions

Many actions interact with the token system:

  • Consuming tokens: Actions can use tokens in their configuration fields. Any field marked with "This property supports tokens." accepts token references like [node:title] or [myToken].
  • Producing tokens: Actions that produce a result (e.g. loading an entity, performing a calculation) typically offer a "Token name" field where you specify the name under which the result is stored.
  • Token replacement in non-ECA actions: Actions from Drupal core or other modules (not specifically developed for ECA) may have a "Replace tokens" setting at the bottom of their configuration. Set this to "yes" if tokens are not being replaced automatically. See Tokens for details.

Tips for working with actions

  • Order matters: Actions execute in the order they are connected. Ensure that any tokens or entities needed by an action have been made available by a preceding event or action.
  • Check the "Token name" field: When an action loads or creates something, always provide a meaningful token name so you can reference the result later.
  • Use "Switch account" for elevated permissions: Actions execute under the current user's permissions. If an action requires higher privileges, use User: switch current account before it. See Permissions.
  • Save entities explicitly: Modifying an entity's fields does not automatically save it. You typically need a separate Save entity action afterwards.
  • Debug with logging: Use the debugging tools to trace which actions executed, which were skipped, and what token values were available at each step.