MonetizationOS Docs

Actions

Actions are workflows that execute in response to trigger events, enabling you to automate processes and integrate with external systems when specific events occur in MonetizationOS.

Actions allow you to respond to both system triggers fired automatically by MonetizationOS and triggers fired programmatically from within workflows by writing workflow logic that processes the event data.

Common use cases include sending emails after user plan changes, updating external systems like CRMs when users are created, or triggering analytics events after decisions are made.

To begin, navigate to the Actions section in the left-hand navigation menu. Your actions page shows a list of configured actions and allows you to edit and delete existing actions, or add new ones.

Create an Action

To add an action, click 'Add an Action'.

You will be prompted to give your action a name and optional description.

Next, you'll need to select which trigger event this action should respond to.

The following triggers are available as built-in MonetizationOS system triggers:

  • Counters Updated: Fires when writing any counter data for a user, triggered at the end of the request. Includes a list of counter updates.
  • Decision: Fires at the end of a surface decision or access check, including the same information from the API response.
  • Plans Changed: Fires when changing the brand record by adding or removing plans, triggered at the end of the request. Includes a list of plans added and plans removed.
  • User Added: Fires when writing data for a user for the first time for a brand, triggered at the end of a request.

In addition, you will be able to select any triggers you have previously configured in the Triggers section.

All triggers can be filtered to run for Authenticated Users, Anonymous Users, or all users.

If you have Brands enabled, you must link this action to a particular brand or brands, by clicking the 'Link Brands' button. This means the action will only be available in environments linked to that specific brand or brands.

Once done, click 'Create Action'. You will then be taken to the action management area. This is broken into two tabs: Workflow, and Manage.

Workflow

The Workflow tab is broken into two sections: Trigger Settings and Workflow.

Trigger Settings

The Trigger Settings section allows you to:

  • View the event that triggers the action workflow (read only)
  • Set the number of action retries (0-3) if the action fails
  • Configure whether the action fires for all users, anonymous users, or authenticated users

Click 'Update' when done.

Workflow

The workflow section allows you to write the code that will execute when the trigger fires. Your workflow will receive the trigger's event data according to the schema defined for that trigger.

You can enable or disable the workflow from the preview, or click 'Edit' to update it.

The workflow can optionally return a result and status that will be displayed in observability for monitoring and debugging.

Manage

The Manage tab allows you to edit the name, description, and linked brands of your action.

You can also delete your action from this tab.

Actions are processed asynchronously in the background, allowing your main workflows to continue without waiting for the action to complete. You can monitor action execution through the observability interface, which tracks when actions are triggered, their success/failure status, and any retry attempts.

Editing an Action

To edit an action, locate it in your action list, then click the 'Edit' icon in the actions column.

This will bring up the same screen you used to configure your action. Make any relevant changes to the workflow logic, retry settings, or other configuration, and click 'Update'.

Deleting an Action

To delete an action, locate it in your action list, then click the 'Delete' icon in the actions column.

You will be prompted to confirm you wish to remove the action. This action cannot be undone.

To continue, click 'Delete'. Otherwise, click 'Cancel'.