cs-icon.svg

Utility

The Utility action connector helps to manage your automation workflow. With the wait action, you can put your automation on hold for some time before the following automation action runs.

Set up Utility

Perform the following steps to set up the Utility connector. You can set up three actions: Wait, Continue Automation If, and Continue Repeat If.

Note: Continue Repeat If action can be used only inside the Repeat Path step.

  1. Click Configure Action Step from the left navigation panel.
  2. Click Action Step to configure third-party services.
  3. Within the Configure Action Step, click the Utility connector.
    Select_the_Utility_Connector
  4. You will see three actions under the Choose an Action tab: Wait, Continue Automation If, and Continue Repeat If (inside Repeat Path only).

Let's look at each of them in detail.

Wait Action

  1. Under Choose an Action tab, select the Wait action.
    Select_the_Wait_Action
  2. In the Wait dropdown, select the timeout value to delay the automation execution.
    Select_Wait_Fields
  3. Click the Proceed button.
  4. To test the configured action, click the Test Action button.
    Test-Action
  5. On successful configuration, you can see the below output. Click the Save and Exit button.
    Click_the_Save_and_Exit_Button

Let’s see a simple use-case of the Utility connector using Repeat Path.

Wait action is useful while working with bulk data. Previously, if the number of API requests exceeded the defined limitation, the automation failed automatically due to rate limiting.

In this example, we are sending bulk data through the HTTP action with a limitation of 5 API requests per second, and we will use the Wait action to delay the API request per second in order to create multiple entries in Contentstack. We will also see how the user receives an error message in the Execution Log section for exceeding the rate limit.

Note: Rate Limit is organization based and needs to be set as per the requirement.

  1. Configure the HTTP Trigger connector. For more details, refer to the HTTP Trigger connector documentation.
  2. Once the trigger is configured, configure an Action Step and click the HTTP action connector.
    HTTP.png
  3. Under Choose an Action step, select the HTTP Request action.
    Select_the_HTTP_Request_Action
  4. Provide a URL to fetch the bulk data. In this example, we have set the limit to 20, i.e. the URL will fetch the data as per the limit.

    Note: You can provide any URL that can fetch bulk data from a source.

    HTTP_Action_URL
  5. Click the Proceed button.
  6. Click the Test Action button.
    Click_the_Test_Action
  7. You will be able to see the entire data in the output. Click the Save and Exit button.
    Save_and_Exit_Button

Once the data is fetched, configure the Repeat Path step to bring the data from the HTTP action. To do so, follow the steps below:

Note: The specific use of Repeat Path in this use-case is to iterate through the bulk data and create multiple entries in Contentstack. It will help if you define your content type schema as per the data fetched in the HTTP action.

  1. Click + Add New Step to add a new step.
  2. Click Configure Action Step from the left navigation panel.
  3. Click Repeat Path to configure repeat path.
    Select_Repeat_Path_Step
  4. In the Repeat Path Configurations, select the Data source to fetch the array of data configured previously.
    Select_the_Output_For_Repeat
  5. Click Save Configuration to save the Repeat Path configuration.

On successful completion, use the Create Entry action inside Repeat Path. Follow the steps below:

  1. Click + Add Step.
  2. In the Configure Action Step, click the Contentstack connector.
    Select_Connector.png
  3. Under Choose an Action step, select the Create Entry action.
    Select_Create_Entry_Action
  4. Add your Contentstack account. For more information, refer to the Contentstack action connector document.
  5. Select the Stack, Branch, Content Type, and Entry Data to create an entry in Contentstack.
    Select_Different_Fields
  6. Click the Proceed button.
  7. Click the Test Action button to test the configured action.
  8. Navigate to your stack. An entry will be created. Click the Save and Exit button.

Let’s see what happens if we do not configure the Wait action.

  1. Activate the automation.
  2. Hit the HTTP trigger URL.
  3. Navigate to the Execution Log section. You will see that the automation fails. Click to view the details of the failure.
  4. You will see the error message “Rate limit exceeded.”
    Rate_Limit

Note: Rate limit exceeds based on the organization plan. The user gets this error if the number of API calls made in a second exceeds the maximum limit defined in a particular organization.

Let’s see how to configure the Utility connector. To do so, follow the steps below:

  1. Click + Add Step.
  2. Click Configure Action Step from the left navigation panel.
  3. Click Action Step to configure third-party services.
  4. Within the Configure Action Step, click the Utility connector. Select the Wait action.
    Select_the_Wait_Action
  5. Select the timeout duration for each API request from the dropdown.
    Select_Wait_Fields
  6. Click the Proceed button.
  7. Click the Test Action button to test the configured action.
  8. Click the Save and Exit button.

Let’s see what happens when we configure the Wait action.

  1. Activate the automation.
  2. Hit the HTTP trigger URL.
  3. Navigate to the Execution Log section. You will see a success message. Click to view the details of the execution.
    Success_Message

Continue Automation If

Continue Automation If will execute the automation based on the defined conditions. It will exit out of automation completely if the condition(s) is not met or it will continue to execute the automation if the condition(s) is met.

  1. Under Choose an Action tab, select the Continue Automation If action.
    Select_Continue_Automation_If_Action.png

  2. Provide the conditions you want to set up in the input box.
    Suppose you want to continue the automation only if the entry title is John. If the condition matches, automation continues to execute; otherwise, the automation terminates.
    Select_the_Continue_Fields.png

  3. Click the Proceed button.
  4. To test the configured action, click the Test Action button.
    Test_Action.png
  5. On successful configuration, you can see the below output. Click the Save and Exit button.
    Save_and_Exit_button_Use_Case.png

Let's see a simple use case of the Continue Automation If action.

Note: Continue Automation If action can be used inside Repeat Path, Conditional Path, or as a separate Action Step.

In this use case, we send data via Postman and fetch the data in the HTTP trigger to create an entry in Contentstack. Once the data is fetched, you need to configure Continue Automation If action to provide the conditions for the automation. You need to configure the Transform action to execute, if the condition matches.

The condition(s) provided in the Continue Automation If is checked, and if it matches, the Transform action gets executed.

If the condition(s) does not match, the automation exits completely.

Sample data:

{
    "title": "Art 2323",
    "body": "body",
    "tags": ["tag1", "tag2"],
    "pdf": "yes"
}

Note: The primary differences between a Conditional Path Statement and Continue Automation If are:
- Conditional Path is a special action with a defined flow, which executes actions based on the condition, and Continue Automation If is a simple action to continue the execution of an automation only if the condition(s) is met.
- In the Conditional Path, conditions are checked, and if the condition matches, the IF block is executed; if not, the flow moves to the ELSE block. Whereas in Continue Automation If, if the condition is true, it executes the succeeding step, and if it is false, the automation exits completely.

  1. Configure the HTTP Trigger connector.

    Additional Resources: Refer to the HTTP Trigger connector documentation for more details.

  2. Under the Choose Trigger tab, select the HTTP Request Trigger action. Select HTTP Request Trigger. This trigger will be activated whenever you make an HTTP GET/POST request to a specific webhook URL.
  3. Select a Method, i.e., GET/POST.
  4. You will find the applicable input “URL.” This URL will be the webhook URL to trigger the automation. You can send your Postman data via this trigger URL.
    Test_HTTP_Trigger.png
  5. Click the Test Trigger button.
  6. You will be able to see the entire data in the output. Click the Save and Exit button.
    Save_and_Exit_Trigger.png

Once the data is fetched, configure the Create Entry action to create an entry in Contentstack with the data fetched in the trigger.

  1. Click + Add New Step to add a new step.
  2. Click Configure Action Step from the left navigation panel.
  3. Within the Configure Action Step, click the Contentstack connector.
  4. Under Choose an Action tab, select the Create Entry action.
  5. In the Configure Action tab, click + Add New Account to add your Contentstack account.

    Additional Resources: For more details on how to add an account, refer to the Contentstack Action documentation.

  6. Select a Stack, Branch, and Content Type from the Lookup list.
    In the Entry Data field, fetch the data output from the HTTP trigger.

    Note: In the Entry Data field, you can add a predefined schema template for your entry data. You must manually configure the entry data for JSON Rich Text Editor, Custom, and Experience Container fields.

    Select_Create_Entry_Fields.png
  7. Click the Proceed button.
  8. Click the Test Action button.
    Test_Action.png
  9. Click the Save and Exit button.
    Save_and_Exit_Create_Entry_Field.png

Once the entry is created, configure the Continue Automation If action inside the Utility connector.

  1. Under Choose an Action tab, select the Continue Automation If action.
    Select_Continue_Automation_If_Action.png
  2. Click + Add Condition. In the Select Input box, select the pdf field UID from the HTTP Request Body. Select Loosely Matches (Text), and provide the value “yes.”

    This means Continue Automation If checks the value for the pdf field based on the trigger data sent via Postman. If the value is yes, i.e.. the condition matches, the automation continues to execute. If the value is no, i.e., the condition does not match; the automation exits completely.

    Continue_Automation_If_Condition.png
  3. Click the Test Action button.
  4. You will see the output if the condition is met. Click the Save and Exit button.
    Save_and_Exit_button.png

Let's configure a Transform action to execute if the condition is true.

  1. Click + Add New Step to add a new step.
  2. Click Configure Action Step from the left navigation panel.
  3. Within the Configure Action Step, click the Transform connector.
  4. Under Choose an Action tab, select the Transform action.
  5. In the Transformation Box, provide a value as shown below:
    Select_Transformation_Box_Content.png
  6. Click the Proceed button.
  7. Click the Test Action button.
  8. Click the Save and Exit button.

Let's see what happens if the condition is true.

  1. Navigate to the Execution Log section.
  2. Click the Continue Automation If execution details.
  3. A pop-up appears. In the Additional Details section, you will see the number of steps executed for the automation. The succeeding step, i.e., the Transform action will run completely.
    Execution_Log_Output_For_True.png

Let's see what happens if the condition is false.

  1. Navigate to the Execution Log section.
  2. Click the Continue Automation If execution details.
  3. A pop-up appears. In the Additional Details section, you will see that the automation breaks completely after the Continue Automation If step without executing the Transform action step.
    Execution_Log_Output_For_False.png

Continue Repeat If

Continue Repeat If executes the automation based on the defined conditions. You must select the exit behavior to exit out of the Repeat Path or current iteration.

Note: Continue Repeat If action can be configured only inside a Repeat Path step.

  1. Under Choose an Action tab, select the Continue Repeat If action.
    Select_the_Continue_Repeat_If_Action.png
  2. Provide the conditions you want to set up in the input box.

    Suppose you want to execute succeeding steps inside of a Repeat Path only if the condition is true, i.e., the value of the pdf field is yes, then the succeeding steps after the Continue Repeat If action will execute inside the Repeat Path.
  3. Select the exit behavior in case the condition is not met. You can either exit the Repeat Path completely, i.e, the steps outside the Repeat Path will continue to execute or you can exit the current iteration and continue with the next iteration in the Repeat Path.
    Select_the_Configuration_Repeat.png
  4. Click the Proceed button.
  5. To test the configured action, click the Test Action button.
    Test_Action.png
  6. On successful configuration, you can see the below output. Click the Save and Exit button.
    Save_and_Exit_Current_Iteration.png

Let's see a simple use case of the Continue Repeat If action.

In this use case, we send bulk data via Postman and fetch the data in the HTTP trigger to create entries in Contentstack. On each iteration, an entry is created, and the conditions provided in the Continue Repeat If are checked; if it is true, the Transform action will execute.

If the condition(s) is not met, there are two exit ways to select. You can exit the current iteration or completely exit out of the Repeat Path. In the latter situation, the action outside the Repeat Path will execute.

Note: With the Continue Automation If action, if the condition is not met, the automation exits completely, whereas with Continue Repeat If, the flow breaks out of the Repeat Path (not terminating the entire automation).

Sample data to be sent via Postman:

{
    "entries": [
        {
            "title": "Article 183",
            "pdf": "yes"
        },
        {
            "title": "Article 184",
            "pdf": "no"
        },
        {
            "title": "Article 185",
            "pdf": "yes"
        }
    ]
}

  1. Configure the HTTP Trigger connector.

    Additional Resources: Refer to the HTTP Trigger connector documentation for more details.

  2. Under the Choose Trigger tab, select the HTTP Request Trigger action. Select HTTP Request Trigger. This trigger will be activated whenever you make an HTTP GET/POST request to a specific webhook URL.
  3. Select a Method, i.e., GET/POST.
  4. You will find the applicable input “URL.” This URL will be the webhook URL to trigger the automation. You can send your Postman data via this trigger URL.
    Test_HTTP_Trigger.png
  5. Click the Test Trigger button.
  6. You will be able to see the entire data in the output. Click the Save and Exit button.
    Save_and_Exit_Repeat_If_Trigger.png

Let's configure the Repeat Path to use Continue Repeat If action.

  1. Click Configure Action Step from the left navigation panel.
  2. Click Repeat Path to configure and select the Repeat Type.
  3. In the Repeat Path Configurations, select the Data source to fetch the entries data to iterate the array received in the trigger.
    Save_Repeat_Configuration.png
  1. Click the Save Configuration button.

After the Repeat Path configurations are done, configure the Contentstack connector within the Repeat Path step and configure the Create Entry action.

Configuring an action step inside the Repeat Path will iterate and run the action until the end of the data source is reached.

  1. Click + Add Step under the Repeat Path from the left navigation panel.
  2. Click Configure Action Step from the left navigation panel.
  3. Within the Configure Action Step, click the Contentstack connector.
  4. Under Choose an Action tab, select the Create Entry action.
  5. In the Configure Action tab, click + Add New Account to add your Contentstack account.

    Additional Resources: For more details on how to add an account, refer to the Contentstack Action documentation.

  6. Select a Stack, Branch, and Content Type from the Lookup list.
    In the Entry Data field, fetch the data output from the HTTP trigger as shown below:

    Note: In the Entry Data field, you can add a predefined schema template for your entry data. You must manually configure the entry data for JSON Rich Text Editor, Custom, and Experience Container fields.

    Select_Create_Entry_Fields_Repeat_If.png æ
  7. Click the Proceed button.
  8. Click the Test Action button.
  9. Click the Save and Exit button.
    Save_Exit_Create_Entry_Repeat_Path.png

Once the entry is created, configure the Continue Repeat If action present in the Utility connector.

  1. Under Choose an Action tab, select the Continue Repeat If action.
    Select_the_Continue_Repeat_If_Action.png
  2. Click + Add Condition. In the Select Input box, enter the UID of the pdf field from the HTTP trigger step. Select Loosely Matches (Text), and provide the value “yes.”

    This means Continue Repeat If will continue to iterate through the array data if the value for the pdf field is yes for an entry. If the value is yes, i.e., the condition matches, the Repeat Path will execute the succeeding action and continue to iterate through the array data.

    If the value is no i.e. the condition does not match, then based on the exit behavior defined in the configuration, Repeat Path will break and execute the succeeding action in the automation or it will break the current iteration and continue to create entries as per the defined conditions.

    Select_Repeat_If_Condition_PDF.png

  1. Click the Test Action button.
  2. You will see the output as shown below. Click the Save and Exit button.

Let's configure a Transform action to execute if the condition is true.

  1. Under Choose an Action tab, select the Transform action.
  2. In the Transformation Box, provide a value as shown below:
    Select_Transformation_Box_Content.png
  3. Click the Proceed button.
  4. Click the Test Action button.
  5. Click the Save and Exit button.
    Save_Exit_Transfor.png

Now, let's configure the Response connector to see what happens if the exit behavior is Exit the Repeat Path completely.

  1. Click + Add New Step to configure third-party services.
    Add_New_Step_Outside_Repeat_Path.png
  2. Click Action Step to configure third-party services.
  3. Within the Configure Action Step, click the Response connector.
    Select_Connector_Response.png
  1. Under Choose an Action tab, select the Response action.
    Select_the_Response_Action.png
  2. In the Response Body field, you can add the data that you want to send as the response.
    Select_Resonse_Field.png
  3. Click Proceed.
  4. To execute and test the configured action, click Test Action.
  5. On successful configuration, you can see the below output. Click Save and Exit.
    Save_and_Exit_Response_Action.png


Let's see what happens if the exit option is - Exit the Repeat Path completely

  1. Navigate to the Execution Log section.
  2. Click the Continue Repeat If execution details.
  1. A pop-up appears. In the Additional Details section, you will see the sequence of actions executed based on the array data as shown below:
    Exit_Repeat_Path_Completely.png

Let's see what happens if the exit option is - Exit Current Repeat Iteration

  1. Navigate to the Execution Log section.
  2. Click the Continue Repeat If execution details.
  3. A pop-up appears. In the Additional Details section, you will see that the third iteration for the Repeat Path is skipped and the loop exits the Repeat Path completely.

    Execution_log_Repeat_If_Exit_Iteration.png
    Exit_Repeat_Path_Iteration-2.png

As per the sample data, the pdf flag for second data is no. So the Repeat Sequence did not execute the Transform action and moved to the next iteration.

This sets the Utility action connector.

Was this article helpful?
^