Create an Automation

Automation is the process of creating a workflow that sets up a connection between two or more web apps or services, including Contentstack.

Automations help you set up specific steps that will perform based on the specified conditions. Once you define these steps, Contentstack Automations will automate the executions of the steps.

First, perform the following steps to create an Automation:

  1. On the Automations page, click on + New Automation.
    Create-New-Automation.png
  2. Provide an Automation Name and an optional Description. Click on Create.
    Create-New-Automation-Button.png
  3. After entering the basic details of the automation in the above step, the next set of actions can be broadly classified into the following two main steps:
    1. Configure Trigger
    2. Configure Action

    Let’s look at the above steps ‌in the next section.

  1. Configure Trigger

  2. Triggers are conditions or invocation points that fire off an Automation when an event occurs in Contentstack or an external app or service. They help automate a business workflow to accomplish required tasks.

    Configuring a trigger can be broken into the following steps:

    1. Choose Connector: Here, you can select Contentstack or an available third-party app or service which will serve as the trigger connector. For example, click on HTTP.
      Configure-Trigger.png

      Note: For more details on the “HTTP” Connector and other available connectors, refer to Automation Hub Connectors.

    2. Select a Trigger: Select the Trigger or the webhook event listed under the selected connector. In our case, you will select the HTTP Request Trigger. This trigger will be activated whenever you make an HTTP GET/POST request to a specific webhook URL.HTTP-Trigger-Event-Action.png

    3. Configure a Trigger: Here, you need to provide additional details with respect to the trigger you selected in the above step. This section will differ for each trigger. For our example, click on the displayed Method, i.e., GET/POST, and click on Proceed.
      HTTP-Request-Configure-Trigger.png

      You will find the applicable Input methods and an Input URL in the Test Trigger section.

      Note: Once you configure your trigger, you cannot make changes in the first two steps, i.e., you can’t change the connector and its corresponding trigger event. To make any kind of changes, you will need to delete the trigger you set up and configure a new one with the new connector.

    4. Test Trigger: The final step is to test the trigger you created. The Input URL you find here will be the webhook URL that you can use to see the trigger working. Click on Test Trigger.
      HTTP-Test-Trigger.png

      You should be able to see the output as follows:

      Output-Error-Trigger.png

      Note: The output doesn’t appear because we haven’t tested the Trigger URL yet.

    Next, to try if the trigger is working real-time, perform the following steps:

    1. Copy the Input URL that you see above and paste it on a new browser tab.
    2. Pass a query parameter to the Input URL, for example, https://trigger_input_URL?name="scott" and hit enter. You should see an output similar to the following:
      {"result":"The automation is currently being tested or not activated","trigger_id":"1111ab1c1ab11111ca11b111111ca1bc"}
    3. Return to your Test Trigger setup page and click on Test Trigger again. In the output, you will see your query parameter as follows:
      query:
      name:"scott"

      Here’s what you see:

      Save-Exit.png
    4. The Filters section (see screenshot in the above step) lets you filter the data displayed in the output. For example, if you want your trigger to proceed further with the configured actions, under the condition that the name parameter (the one you passed in the above step) is “scott” in the output result, click on + Add Filter and pass the following filter condition:
      query.name | Matches (Text) | scott

    5. Lastly, you can either pass a new query parameter and Retest the trigger or hit Save and Continue (see screenshot in step 3).
    6. This completes your step of configuring your HTTP trigger.

      Note: You will find more details on how to rename a trigger and delete a trigger in the "More Articles" sections.

  3. Configure Action

  4. Action is the event that happens as a result of a triggered event.

    To understand the concept of Actions, let’s consider the above example where you set an HTTP Request trigger that is activated when a user fires a GET/POST request. And, you can set up an action that will notify a particular Slack channel when such an event occurs.

    After configuring the Trigger, click on Configure Action and perform the following steps to set up the corresponding action:

    1. Choose Connector: Click on the connector (Contentstack or a third-party app or service) where you want your workflow to perform the next set of actions. In our case, click on Slack.
      Select-Slack-Action-Connector.png
    2. Select an Action: Select the action listed under the selected connector, Slack. In our case, select Send Message that will send a message to a specific Slack channel that you choose.
      Slack-Send-Message-Action.png
    3. Configure Action: Here, you need to provide additional details for the action you selected in the above step. This section will differ for each action. For our example, we will add the Slack account.
      1. Click on + Add New Account (add Slack account).
        Add-New-Slack-Account.png

      2. You will see a list of permissions that you can choose to Authorize.
        Slack-Account-Authorization.png

      3. Next, you will see a window open with access requests from the app. Click on Allow to proceed further.
        Automation-Authentication.png

      4. Enter a Title for this account, say “Allow-Slack-access” and click Save.
        Set-Account-Name.png

      5. Next, click on the Channel textbox. It displays a LOOKUP list containing all the channels in your Slack account. Click on Load More until you locate your channel.
        For our example, select the sample channel, and its name is displayed in the entry box.
        Select-Slack-Channel.png

      6. Click on the Message textbox. You will see all the values related to the “1.HTTP Request trigger” you set up earlier. Click on a parameter, say query.name, that you want to send as a message to the selected Slack channel.Select-Slack-Message.png

        For example, if you want to send the name param, select query.name and type ahead a message if needed, say “1.query.name has sent a GET/POST request”.Select-Message-Body.png

      7. Once done, click on Proceed.
    4. Test Action: Finally, you can test the configuration you have set up by clicking on the Test Action button.
      Test-Action.png

      The output shows the message that will be sent on the linked Slack channel.
      Save-Exit-Action.png

      Check your Slack channel. You will see the message delivered to the Slack channel as below:Output-Slack.png

      Once it works as expected, click on Save and Exit.

      The action is now tested. If you hover over the number (2), the message “Step Tested” will be displayed.
      24._Step_Tested.png

You can add multiple actions in an automation if needed. To do so, click on the “+” (Add new step) icon below the added action

25._Add_New_Step.png

Then, perform all the steps similar to steps that were covered in the Step 2.2 - Configure Action section.

Once done, on the left panel of the page, you will see an outline summarizing the trigger and actions used in the automation.

Outlline.png

Note: To automate the process, you must enable the automation.

Was this article helpful?

Thanks for your feedbackSmile-icon

On This Page

^