This is an alternative setup to send messages from a care flow to Slack via Zapier. To see a native implementation directly via Slack, click here.
The benefits of using Zapier over a native Slack integration are:
Slack cannot work with nested objects where Zapier can. This can be useful because to every outgoing API request we append a
pathway
object to the body containing the pathway definition id, pathway id, patient id, and start date. You cannot access that object via Slack workflows, but you can via Zapier.Working with Zapier does unlock other functionalities than just sending messages to Slack. Think about integrations with Google Sheets, Google Docs, Google Calendar, and many more.
Setup
We'll use Zapier to create a Zap that can be triggered by a webhook and post a message to a Slack channel.
Prerequisites:
You have a Zapier account. Triggering a Zap via a webhook is a premium feature. However, you can still configure and test premium webhooks for free.
You have a Slack workspace.
You have created a channel (or have an existing channel) on which you want to post messages.
Setting up your Zap
Go to https://zapier.com and login to your account
Create a Zap
Choose "webhook" as the trigger for your Zap
Select "Catch hook" as the webhook event.
Click on "Test trigger". Here you'll find the webhook URL.
Configure the API call action in your care flow
It's recommended to immediately test the trigger in Zapier as this will allow us to get an example response in Zapier which facilitates the configuration of the next steps in your Zap. So let's make sure we can trigger the webhook first.
Add an "API call" action to your care flow
Configure the endpoint. Paste the webhook URL generated by Zapier here (see step 5 of the previous section)
Configure your HTTP body with a message (and anything else you'd like to send to Zapier)
Test the webhook trigger
You can currently not test API call actions in Awell Studio (not in the builder, not in preview). However, we are working on making that possible. To test your API call action, publish your care flow and enroll a patient in it.
Press "Test trigger" in Zapier and you should see the incoming webhook and payload:
Finish the Zap
We'll now add additional actions to our Zap to send a message to Slack.
Add a Slack action to your Zap which uses the "Send channel message" event
Connect your Slack account to Zapier
Set up your action by choosing the channel to post the message in, the message body, and more
Note that you can insert variables coming from the response payload in your message.
Test your completed Zap
Go to the "Test action" section to test your Zap and see your message appearing in the Slack channel.