Before you get started, you may want to consider setting up a Slack integration using Zapier as an alternative setup.
Slack has the following limitations to consider when using webhooks to send data:
Slack can't process nested JSON objects. Therefore no information about the pathway is available in Slack webhook messages as this is embedded in a nested object.
Slack can't process numeric fields.
These limitations lead to Slack messages containing a limited amount of details.
Setup
This tutorial outlines the steps to set up a Slack workflow to receive webhook payloads. We'll use Slack's Workflow Builder to create a workflow that can be triggered by sending a message to a webhook endpoint.
Prerequisites:
You have a Slack workspace
You have created a channel (or have an existing channel) where you want to post messages to
Create a Slack workflow
Detailed documentation on how to create workflows in Slack can be found here.
Type
/workflow
in any Slack channel and select "Open Workflow Builder" and then press "Create" in the upper right corner.
Give your workflow a name
Select "Webhook" as the trigger to start the workflow
Add a "text" variable. We can then use this variable to pass some text when calling the Webhook (see below).
Add an additional step to your workflow which sends a message to a Slack channel.
Select a channel to post the message to and print the text variable in the message.
Publish your workflow and grab the webhook endpoint URL generated by Slack.
Configure the API call action in your care flow
The last step is configuring the API call action in your care flow to send messages to the webhook that will trigger our custom workflow in Slack.
Add an "API call" action to your care flow
Configure the endpoint. Paste the webhook URL generated by Slack here (see step 7 of the previous section)
Configure your HTTP body according to the schema you have defined in the workflow.
Test your webhook
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.