Articles in this section

Send flow step error count to a Slack channel

You can get notified of error counts in important flows by building custom flows. This article focuses on sending open error counts from a single flow step to a Slack channel using a custom flow. (If required, you can consolidate errors into a single report before you send them to a Slack channel.)

Note

You can also create custom flows to get specific errors for further analysis or resolution.

Now, let's build the flow to get the open errors from a flow step using a generic HTTP connection and then send the error count to a Slack channel so that your team can review and prioritize them.

Example flow

send-errors-to-slack.png

Building this flow consists of the following two steps:

Steps

What to do...

Step 1 – Export

Get open errors for a flow step 

  • Create an export to get errors from a flow step.

  • Transform the exported data to get the error count using a script before it is passed to the import step.

Step 2 – Import

Send error count to Slack 

  • Create an import to send the error count to a Slack channel.

  • Map the fields, as required, so that the error information is posted to the Slack channel making it easy for the experts to effectively act on them.

Before you start

At the start, create the connections that you require because this will allow you to save time later when you create your exports or imports. This example requires creating the following two connections:

  1. An HTTP connection to connect to a Celigo integrator.io flow /flow step and get the error details.

  2. A Slack connection to import the error details into a Slack channel for your team to work on the errors.

Step 1: Create an export to get the open errors from a flow step

  1. In the left navigation pane, select Resources > Export.

  2. In the Exports page, click + Create export in the top-right corner.

  3. In the Edit export page, configure the settings as shown in the below image.

    http-export-step-errors-1-updated.png
  4. For Export type, select All to always export all open errors or Delta to get only the new open errors since the last run, based on your requirements. For more information on export types, see Export data from an HTTP source application

  5. Add custom fields such as flow id and step id to your export so that you can specify these details to get the errors. To do this, In Custom settings, click Launch form builder. (Or, you can go to the flow from which you want to export errors and click Settings .) Then add the following code

    Important

    You can define custom settings only for resources to which you have Manage (write) access, and when you are in Developer mode.

    Now, Flow id. and Step id. will be shown in your export under Custom settings.

  6. In Custom settings, enter the ID of your flow and flow step from which you want to export the errors.

    http-export-step-errors-2.png
  7. Click Save or Save & close.

Transform the exported error details

After you create the export, transform the error details as required. In this example, we want to transform the data so that it shows the count of errors based on unique error codes before they are passed to Slack so that it's easy for the team to decide priorities later.

  1. Click the plus sign (+) next to the export, then click the transform icontransform.svg. The Define transformation advanced field editor (AFE) opens.

  2. Select JavaScript.. Then add a transformation script to get the error count as shown in the below example.

  3. .Click Save and close. after checking if the exported error details are shown as required.

    http-transform-error-messages.png

Step 2. Create your import to Slack

Make sure that you've already created a Slack connection so that it's quick to add it in your import.

  1. In the left navigation pane, select Resources > Import.

  2. In the Imports page, click + Create import in the top-right corner.

  3. In the Edit import page, configure the general details and other required settings as shown in the below image.

    slack-import-1.png
  4. Click Save and close.

Map the fields

After this, map the details as shown. Configure mapping to set the channel where the error count should be sent, for example, "testflows", as well as any text that you'd like to be added as shown. The mapping message can be modified based on your requirement.

slack-import-mapping.png

Note

You can edit the content of error messages using handlebars expression in the source field. In this example, count against error codes is shown, but you can also set up count against error messages.

Run the flow

After you've created and checked your export and import, schedule your flow runs to run at regular intervals so that you can manage errors quickly and effectively, In this example, when the flow is run, you will receive a message with the overall count, as shown, if you are a member of the Slack channel.

slack-message.png
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.