Actions

Actions are the core of automations. Actions can carry out updates on a table, send Slack notifications, call an external service, send emails, and much more.

Actions are the core of automations. Actions can carry out updates on a table, call to an external service, send emails, and so on. We have built our action system to be easily extensible so actions can be added to the system at any time! Your automation can have many actions, allowing you to perform many different tasks as part of a single trigger.

Below is a few examples of actions that exist today however there may be many more when you look in the builder. To get a full list install the builder and check it out!

  1. Create row - this will create a new row in a specified table
  2. Update row - can be used to update a row that was triggered upon
  3. Delete row - delete a specified row from a table, like something that was triggered upon
  4. Send email - as it suggests, send an email based on the specified inputs
  5. Send Discord notification - send a notification to Discord
  6. Slack - send a notification to Slack
  7. Connect to Integromat - connect to Integromat
  8. Connect to Zapier - connect to Zapier
  9. JS scripting - add JS scripts to an automation
  10. Query rows - query rows / records

The real power in actions is the ability to make use of outputs from previous steps; how to do this will be covered in the Contextual bindings section.

 


 

Looping

🚧

Iteration hard limit

Users who self-host can configure this by changing the AUTOMATION_MAX_ITERATIONS environment variable.

  • For docker-compose users, update docker-compose.yaml > app-service > environment.
  • For Kubernetes users update values.yaml > automationMaxIterations

Automation looping allows you to repeat an automation action across multiple records. For example, when an automation is triggered, delete the 10 last updated records in my database. Or, every Monday email my users with a usage update.

You can loop actions by clicking the 'Add looping' button.

By clicking the Add looping button, Budibase will add a special loop block to the automation, which is stored as a separate block but linked to the selected block using an ID.

As shown in the image above, several different configuration options can be provided. Bindings are also available.

Array

Array / String dropdown denotes what type of binding should be provided to the loop, and if a different type is passed, Budibase reports error at runtime stating this:
{ "items": [ { "success": true }, { "success": true } ], "iterations": 2, "success": false, "status": "INCORRECT_TYPE" }

Binding / Value

Binding / Value is the actual value that you want to loop over

Max loop iterations

Max Iterations is a soft limit that is set by the user that defines how many times that automation will run (this is superseded by a hard limit that we or the self-hosting user sets)
{ "items": [ { "success": true } ], "iterations": 1, "success": false, "status": "MAX_ITERATIONS_REACHED" }

Failure conditions

Failure Condition stops the loop whenever the currentItem equals the value provided in the failure condition, then loop is then broken at that particular point and the results up to then provided
{ "items": [ { "success": true }, { "success": true } ], "iterations": 2, "success": false, "status": "FAILURE_CONDITION_MET" }

This leads to how we provide the bindings for each step. A block that is being looped gets provided the following binding (in addition to any previous blocks):

Any blocks after the loop block get provided with the entire output, such as:

 


 

Adding logic

Sometimes it is necessary for your automation to make decisions as part of the process, for example, if you wanted to send an email to a customer when their order enters the shipped state then you would need a logical step to handle this. An automation can have as many logical steps as you require, if you wish to filter against multiple different outputs from previous steps then this can be done with multiple filters.

Currently, there are two actions that allow you to add logic to an automation

  1. Filter - Filtering against a specified field, with a particular operator and value to compare against
  2. Delay - waiting a period of milliseconds before continuing

Did this page help you?