Trigger a Slack notification when a Bolt run is overrunning
Introduction
This guide will show you how to set up an integration between Paradime and Slack using Paradime Webhooks and Zapier.
At the end of this tutorial, you will be able to trigger a custom Slack notification when a Bolt schedule is overrunning including details of the Bolt schedule.
Prerequisites
For this integration, make sure you have the following:
A Paradime Bolt schedule configured
Paradime Webhooks enabled
A Slack account
A Zapier account
Create a new Zap in Zapier
To trigger an action each time a webhook event is delivered in Zapier, create a new Zap with Webhooks by Zapier as the Trigger and Catch Hook as the Event.
Press Continue, and copy the webhook URL. You will need this to connect Zapier to Paradime.
Configure a new Webhook in Paradime
In Paradime navigate to Account Settings and select Webhooks from the left Panel. Now you can click on + Add Endpoint
to configure your webhook.
Enter the webhook URL generated by Zapier in the previews step
Add a description for your webhook integration (optional)
Filter to include in the event only the
bolt.run.
started
event
When done, click on Create
to setup the webhook.
Configure a Zapier delay
Now let's add a time delay before the pause the workflow for defined amount of time. Here we will set the threshold after which we will check if the Bolt schedule is still in progress.
Add a Delay by Zapier step in Zapier, choose the Delay For as the event type and configure your time delay. In the example below we are configuring to check the status of a Bolt schedule run after 120 minutes. Click Continue.
Store secrets
In the next step, to check the status of the Bolt schedule, you will need to generate the API credentials for your Paradime workspace.
Zapier allows you to store secrets. This prevents your keys from being displayed as plaintext in the Zap code. You can access them with the StoreClient utility.
Create a Storage by Zapier connection
Go to https://zapier.com/app/connections/storage, create a new connection and save the UUID secret you generate for later.
Add a temporary code step
Choose Run Python as the Event. Run the following code:
Add a Zapier code action
Now lets add a code action that will allow us to call the Paradime API and check the status of the Bolt run. Choose Code by Zapier for the application and select Run Python for the event.
In the Set up action section, you will need to add three Input Data that we will use the python code.
API_QUERY
: here you will add the Paradime API to check the status of the Bolt run and use theID
field from the previous Catch Raw Hook step as as below:
API_ENDPOINT
: here map this input to theApi Url
field from the previous Catch Raw Hook step as as below.START_DTTM
: here map this input to theStart Dttm
field from the previous Catch Raw Hook step as as below.
In the Code field, now lets add the following python code and replace YOUR_SECRET_HERE
with the secret you created when setting up the Storage by Zapier integration.
This code action, will called the Paradime API and check the status of the Bolt run and the elapsed time of the Bolt run.
Configure a Zapier filter
Now let's add a Zapier filter and let the Zapier workflow continue only if the Bolt run status == RUNNING
. This will ensure that the next step where we will be posting a Slack message, is not going to be triggered if the Bolt run completed.
Add a Only continue if... step in Zapier, choose the Status field from the webhook response and filter for the condition to filer when status exactly match RUNNING
.
Click Continue. If the example Bolt run for your Zap setup matches above state, a confirmation message will display, indicating the Zap will proceed.
Configure a Slack action
Finally lets setup the Slack integration and configure our Slack message. Select Slack as the App, and Send Channel Message as the Action.
In the Action section, choose which Channel to post to.
You can now configure the Message Text field and create your own template Slack message or use the one in the example below. You can use all the available input data from the Catch Raw Hook and the preview Zapier code action.
Configure the other options with:
Send as a bot:
Yes
Bot Name:
Paradime
Bot Icon using this
url:https://20146536.fs1.hubspotusercontent-na1.net/hubfs/20146536/logo-no-text-light-transparent-3x.png
Test and deploy your Zap
When done, you can click on Continue and Test your Zap, and finally click on the Publish button to go live. With this Zap, if a Bolt run is still Running after 120 minutes, a Slack notification will be posted to the selected Slack channel 🙌.
Last updated