Introduction

The Automations V2 API allows you to manage automations on user sites. Automations are workflows that let users automate tasks they would otherwise have to perform manually. For example, a user with an online store can set up an automation to send an invoice to a customer after they make a purchase.

Learn more about Automations.

Using the Automations V2 API, you can:

Note: Learn more about an automation's architecture and data flow.

Automation setup

When creating an automation, you must configure it with 1 trigger and at least 1 action for it to run. The trigger and action must already exist, as you can't create them using this API.

In addition, any apps that added a trigger or actions to your automation must be installed on the site you're creating the automation on.

Note: You can create an automation without configuring an action, but such an automation is saved as a draft and cannot run.

Configure a trigger

To configure a trigger, specify the ID of the app that created the trigger, as well as the trigger key. You can further configure the trigger as necessary.

Add and configure actions

To add actions to your automation, provide each action's key and configuration details. Additionally, you must configure your root actions. These are the first actions to run when the automation trigger occurs.

Note: You can currently only specify 1 root action.

In addition to defining the trigger and actions, you must configure the automation's origin and activation status when added to the site. An automation can have 1 of 3 possible origins:

  • User: A Wix user built the automation in their site dashboard.
  • App: An app created the automation as part of its logic. This type of automation is specific to a site, and isn't necessarily created for every user who has installed the app.
  • Pre-installed: An app added the automation when it was installed on a site. Pre-installed automations aren't specific to one site, but are added to every site that installs the app.

When you create the automation, set its activation status as either active or inactive. This determines the automation's status when it's added to the site.

Use cases

  • Create an automation to respond to site events: Run an automation whenever a particular site event occurs. For example, when a site visitor sends the owner a chat message, you can create an automation that responds to this event.
  • Deactivate an automation: Stop an automation from responding to site events.
  • Adding a delay to an existing automation: Update an automation to include a time delay between two actions.
Did this help?