cs-icon.svg

Get Started with Automation Hub

The basic steps of working with Automation Hub can be broadly classified into the following:

  1. Create Project
  2. Create Automation
  3. Test Automation
  4. Activate Automation

Let’s look at the steps in detail.

  1. Create Project

  2. To get started with the Automation Hub, you need to create a project. Projects help you keep everything related to your automation set up under one location in an organized manner.

  3. To create a project, perform the steps given below:

    1. Log in to your Contentstack account.
    2. On the left navigation panel, click Automation Hub.
    3. Click + New Project.
      Create_New_Project.png
    4. In the New Project modal, enter the Project Name (for example, Slack-automation), an optional Description, and click Create.
      Create_Project.png
  4. The above steps open the Automations page, which is the next step in the process.

    Create Automation

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

  6. 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.

  7. First, perform the following steps to create an Automation:

    1. On the Automations page, click + New Automation.
      No_Automation_Found.png
    2. Provide an Automation Name and an optional Description. Click Create.
      Create-new-Automation
    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 Step

      Note: You can now throttle the execution for your automations to avoid rate limit. For more information, refer to the Throttle Execution document.

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

      Configure Trigger

      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. Click Configure Trigger from the left navigation panel.
        Configure_Trigger.png
      2. 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 HTTP.
        Select_HTTP_Trigger.png

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

      3. Choose 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.
        Choose_Trigger.png
      4. 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 the displayed Method, i.e., GET/POST. You can also enable the Secure HTTP Trigger using the toggle to add security to the HTTP trigger and click Proceed.

        Note: For more information, refer to the HTTP Trigger documentation.

        Select_Method_Secure_Trigger.png

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

        Note: You will see a similar URL, even If you update the configuration before testing the trigger.

      5. 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 automation working. Click Test Trigger.
        Test_Trigger.png

        You should be able to see the output as follow:

        Output_Error.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="john" and hit enter. You should see an output similar to the following:
          {"result":"The automation is currently being tested or not activated","rule_id":"1111ababa11111","trigger_id":"1111ab1c1ab11111ca11b111111ca1bc"}
        3. Return to your Test Trigger setup page and click Test Trigger again. In the output, you will see your query parameter as follows:
          query:
          name:"john"

          Here’s what you see

          Save_and_Exit-trigger.png

        4. The Apply Trigger Conditions section 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 + Add Trigger Condition 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 Exit (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 "Working with Automation Hub" section.

    4. Configure Action Step

      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 Step and perform the following steps to set up the corresponding action:

      1. Click Action Step to configure third-party services.
        Select_Action_Step.png

        Note: Conditional Paths allow you to customize your automations by setting a condition and configuring different actions within the If and Else blocks.

      2. Choose Connector: Click 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 Slack.
        Select_Slack_Connector.png
      3. Choose 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.
        Select_Slack_Action.png
      4. 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 + Add New Account (add Slack account).
          Add_New_Account.png
        2. You will see a list of permissions that you can choose to Authorize.
          Slack_Authorize.png
        3. Next, you will see a window open with access requests from the app. Click Allow to proceed further.
          Allow-Access-Slack
        4. Enter a Title for this account, say “Allow-Slack-access” and click Save.
          Save_an_Account.png
        5. Next, click the Channel textbox. It displays a Lookup list containing all the channels in your Slack account. Click Load More until you locate your channel.
          For our example, select the sample channel, and its name is displayed in the entry box.
          Select_Channel.png
        6. Click the Message textbox. You will see all the values related to the “1.HTTP Request trigger” you set up earlier. Click a parameter, say query.name, that you want to send as a message to the selected Slack channel.Query_Name.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”.
          Message_Body.png
        7. Once done, click Proceed.
      5. 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.png Check your Slack channel. You will see the message delivered to the Slack channel as below:
        Slack_App.png

        Once it works as expected, click Save and Exit.

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

    5. You can add multiple actions in an automation if needed. To do so, click the + Add New Step icon below the added action.

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

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

    Automation_Steps.png

    Note: You will find more details on how to edit automation details, how to delete an automation, and other actions in the Additional functions on Triggers and Actions section.

    You can add a new step in between the configured automation steps. Suppose, you want a add a new action step in between two configured actions, then hover over the line between the two steps and click the + sign as shown below:

    Add_Step_Between.png

  10. Test Automation

    Now that you have tested and verified that the automation is working as expected, test out its working in the respective connector you have added as trigger or action.

    If you see the changes you incorporated in the above processes are working fine. You are ready to activate the automation for use. If not, revisit all the above steps.

  11. Activate Automation

    Once your automation is ready for use, you need to activate it to use it in your projects.

    To do this, click on the toggle button at the top-left corner:

    Activate_Automation_Toggle.png

    You can also configure another Action Step, Repeat Path or a Conditional Path quickly and easily. The quick select screen appears after each trigger and action step.

    Note: You cannot view the quick select screen if you configure the Response action connector.

    Special_Actions.png

    You can also activate an automation on the Automations homepage as follows:

    Draft_Mode.png
Was this article helpful?
^