Articles in this section

Use the "Error automation via integrator.io APIs" template

The Error automation via integrator.io APIs template that is available in the Celigo marketplace has the following two flows:

  1. A flow to auto-resolve errors
  2. A flow to auto-retry errors

These sample flows help to automate your error management using integrator.io error APIs.

You can use this template to automatically resolve or retry errors that do not require any user intervention, that is you don't have to edit or correct any data. In such cases, you can configure the template and run the flows to automate error management of errors, let's say, based on a specific error message or error code.

Contents

Scenarios for using the template

Flows Scenarios

Auto-resolve flow

Consider a flow that

  • Has errors you want to temporarily ignore or resolve because:

    • You're working on a fix for the issue

    • You'd like to analyze them carefully later

    Running the auto-resolve flow in such cases helps to manage errors based on your priorities.

Auto-retry flow

Consider a flow that

  • Syncs the refund status of Shopify to NetSuite orders which has a few errors because the “refund status” of some orders is shown as “not paid". Only 2-3 days after the refund, the status of such orders is updated on Shopify. Running the auto-retry flow in such cases helps to retry the errors and keeps the data in sync.

  • Has Salesforce “unable_to_lock_row” errors. When multiple jobs run to update the same set of records, Salesforce has a feature to ensure the same record is not being updated by more than one job at any time, and this sometimes results in errors. Running the auto-retry flow in such cases helps to resolve the errors as the conflicting jobs disappear when it is automatically retried after a while.

Installing the template

  1. In the left navigation pane, click Marketplace. And, under By type, select either All or Templates.

  2. In the Search box, type "Error automation" to find the "Error automation via integrator.io APIs" template quickly.

  3. Click Preview and review the Readme and Components.

  4. Click Install now. The installation consists of two steps.

    template-install-steps.png
  5. In step 1 – Connect to integrator.io via "Full access" scope API token - Error API, click Configure.

    1. In What would you like to do?, select Set up a new connection. (If you have an existing connection, use the existing connection.)

    2. In Name, use the default name or enter a new name. The default name is "Connect to integrator.io via "Full access" scope API token - Error API".

    3. In Base URI, enter https://api.integrator.io.

    4. In Media type, the default value is JSON.

    5. In Token, enter a token.

      Tip

      If you have the required permissions, click ResourcesAPI tokens , then click Create new token and create a token with full access permissions. For more information, see Managing API tokens.

    6. In Send token via, select HTTP header.

    7. In Header name, enter Authorization if it's not provided by default.

    8. In Header scheme, select Bearer.

    9. Click Save & close.

  6. In step 2 – Copy resources now from template zip, click Install.

The template is successfully installed with the flows.

Understanding the template flows

The two flows, Error Mgmt 2.0 - Auto-retry and Error Mgmt 2.0 - Auto-resolve, in the template have an export and an import step that are explained below.

Flow names Flow steps Step descriptions

Error mgmt 2.0 - auto-resolve

Both flows have the following steps:

  1. Export: Get open errors for a given flow step

  2. Import: Auto-resolve errors that satisfy conditions
    – or –
    Import: Auto-retry  errors that satisfy conditions

  1. Export step: Gets open errors from a flow step that you specify, based on the UI settings or script hook. 

  2. Import step: Posts errors in the flow step after resolving/retrying them.

    • For the Auto-resolve flow, the import step calls the integraror.io /resolve API endpoint to resolve errors.

    • For the Auto-retry flow, the import step calls the integraror.io /retry API endpoint to retry errors

You must configure the export and import steps before you run any flow.

Error mgmt 2.0 - auto-retry

Since the Error mgmt 2.0 - auto-retry flow might be more commonly used, let's start with configuring a few essential settings in the export and import steps of the Auto-retry flow and running it.

A. Configuring and running the Auto-retry flow

template-auto-retry-flow.png

Step 1: Configuring the export to get flow errors

  1. Click the export step, Get open errors for a given flow step, to edit the settings. The general and export settings have default values that you can leave as is.

    Note

    The export step gets errors from a flow based on the Handlebars expression in the Relative URI. For example, 

      /v1/flows/{{settings.export.Flow_id}}/{{settings.export.Step_id}}/errors?occurredAt_gte={{{encodeURI lastExportDateTime}}}

  2. Under Custom settings, replace values based on your requirements.

    1. in Flow id, replace the default value with the flow ID from where you want to get errors and automatically retry them.

    2. In Step id, replace the default value with the export ID or the flow step from where you want to get errors and automatically retry them.

      Tip

      You can find the IDs from the URL. For example,

      https://integrator.io/integrations/64e3•••eca6d•••ddda7e28d/flowBuilder/64e3•••3b••e641c70d93a32/edit/exports/64e3•••2be8e090••••f947c

    3. In Error Message, preview the errors and replace the value based on what type of errors you want to move to the next step to retry. Or, leave the field blank and enter the Error Code below only.

    4. In Error Code, preview the errors and replace the value based on what type of errors you want to move to the next step to retry.

      Tip

      You can use the Error Message and Error Code settings to decide and pass select errors to the next step for automatic retry. However, if you don't provide the values here, you can use the hook script to filter the errors and automatically retry select errors.

  3. Click Preview here (or in the Script hook) to view the errors that are passed to the import step. Here, you should see the errors from a flow step.

  4. Click Save.

(Optional) Editing the script to filter or preview errors

  • Click the hook icon (​​hook.svg​​) next to the export to filter errors and then auto-retry them.

The template includes a script to filter errors via API. The script has preSavePage and ErrorsShouldBeReprocessed functions that you can edit as required so that only errors that meet specific conditions are passed to the import step. (If you've already provided the error message or error code in your export settings earlier, then you don't need to edit the script but you can click Preview and view the errors that are passed to the next step to be retried.)

template-filter-error-message-script.png

Step 2: Configuring the import to auto-retry flow errors

  1. Click the import step, Auto retry errors that satisfy conditions, to edit the settings. The general and export settings have default values that you can leave as is. 

    Note

    The import step posts errors back to the same flow step after retrying them by calling the retry integrator.io API endpoint based on the Handlebar expression in the Relative URI. For example,

    /v1/flows/{{settings.import.Flow_id}}/{{settings.import.Step_id}}/retry

  2. Under Custom settings, replace values based on your requirements.

    1. in Flow id, replace the default value with the flow ID where you want to auto-retry and post errors.

    2. In Step id, replace the default value with the export ID or the flow step where you want to post auto-retry and post errors.

      Tip

      You can find the IDs from the URL. For example,

      https://integrator.io/integrations/64e3•••eca6d•••ddda7e28d/flowBuilder/64e3•••3b••e641c70d93a32/edit/exports/64e3•••2be8e090••••f947c.

  3. Click Save.

After configuring the export and import steps, click the Enable button and run () the auto-retry flow. Then, go to the specific flow step and view the error count in Flow builder to check if the error count is less than it was earlier. Consider tweaking your configuration if required.

B. Configuring and running the Auto-resolve flow

template-auto-resolve-flow.png

The steps to configure the auto-resolve flow are the same as mentioned above in the auto-retry flow. See the above section. In this flow, the only difference is that in the import step, the integrator.io resolve API endpoint is called instead of the integrator.io retry API endpoint. The Handlebars expression in the Relative URI setting of the import step will be, for example,  

/v1/flows/{{settings.import.Flow_id}}/{{settings.import.Step_id}}/resolve

Configure your flows and try the Error automation via integrator.io APIs template to manage your open errors.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.