Skip to main content
Send an alert to the assignee’s Inbox, text them if it sits for 5 minutes, and text the on-call 5 minutes later. That’s an escalation policy built as one Journey, and your app stops it with one API call when someone takes the alert. It escalates alerts your product sends to its own users, such as clinicians, field technicians, or account owners. Each message names where the alert is and links to your app, so the details stay behind sign-in. For healthcare alerts, that keeps PHI out of the message. See HIPAA and BAAs.

Prerequisites

Build the Journey

1

Create the Journey and its trigger

Open Journeys, select New Journey, name it alert-escalation, and choose the API Invoke trigger.Add four fields to the trigger schema:
  • alert_id: your ID for the alert
  • unit_id: the team, unit, or service the alert belongs to
  • unit_name: its display name, like Unit 4B
  • alert_url: the alert’s page in your app
2

Send the alert to the assignee's Inbox

Add a send node on the In-app / Inbox channel and select + Create to write the template. Name the location and nothing about the patient or the finding:
Below the text, add a Button block labeled Review alert with its link set to {{alert_url}}. The Inbox shows it as an action on the message, so the assignee goes straight to the alert. See Button.The run’s user is the assignee, so the message lands in their Inbox.
3

Wait 5 minutes

Add a delay node set to Duration, 5 minutes.To set the wait per alert, such as shorter for critical ones, add an escalate_after field to the trigger schema. Turn on Dynamic Interval, select data.escalate_after, and send an ISO 8601 duration like PT2M in that field. See Delay node.
4

Text the assignee

Add an SMS send node with the link in the text, since SMS has no buttons:
It goes to the phone number on the assignee’s profile.
5

Wait 5 more minutes

Add a second delay of 5 minutes.
6

Look up who's on call

Add a fetch data node and select Setup Request. Set the method to GET and the URL to your on-call endpoint, such as https://api.example.com/oncall/{{data.unit_id}}, and add your API’s auth header. Keep the merge strategy at Soft Merge.The endpoint returns the on-call’s number, which Courier merges into the run’s data:
Select Execute Step with a test unit_id so oncall_phone appears in the field list.A fetch that fails ends the run before the on-call text. Send unit_id on every invoke, because a URL variable with no value fails the fetch. Have the endpoint always return a number, such as a charge nurse or a team lead when nobody’s scheduled. See When a fetch fails.
7

Text the on-call

Add another SMS send node with the same text as the assignee’s. Next to Recipient Override, select Add and choose data.oncall_phone. This text goes to the on-call instead of the assignee.
8

Set a cancelation token and publish

In the Journey’s settings, set the cancelation token to alert-{{data.alert_id}}. Each alert’s run carries its own token, so acknowledging one alert stops only that alert’s escalation. Always pass alert_id, because a token that references missing data isn’t set.Publish the three templates, then select Publish on the Journey and copy its ID.

Trigger it from your app

1

Start the escalation when the alert fires

Call POST /journeys/{templateId}/invoke with the assignee as the user. Replace alert-escalation with your Journey ID.
Build the idempotency key from the alert’s ID and the time it fired. A retried request returns the same run, so one firing never starts two escalations. An alert that fires again later gets a new key and a new escalation, instead of the earlier, canceled run.
2

Cancel the run when someone acknowledges

In the code that records the acknowledgment, call POST /journeys/cancel with the alert’s token. Steps still waiting in a delay never fire, so nobody gets paged for an alert that’s already handled.
Canceling a run that already finished changes nothing, so you can call it on every acknowledgment without checking first.

Verify

1

Run a fast copy

Duplicate the Journey for testing, set both delays to 1 minute, and change its cancelation token to alert-test-{{data.alert_id}}. Publish the copy.Point the on-call lookup at yourself. Have your endpoint return your own number for a test unit, such as unit_test, and invoke the copy with that unit_id. With a real unit, the test texts whoever is on call.Invoke the copy for a test user whose profile has your phone number.
2

Let it escalate

Leave the alert alone. The Inbox message arrives right away, the first text a minute later, and the on-call text a minute after that. Open the Journey’s Logs tab and select the run to see each step and the fetch response.
3

Acknowledge one

Invoke the copy again with a new alert_id, and run the cancel call with its test token right away, inside the first minute. No text goes out, and the run reads Canceled in the Logs tab.

FAQ

An Inbox open means the assignee opened the message, which doesn’t mean they took the alert. Taking the alert happens in your app, so the cancel call belongs in the code that records it.
A Slack or Teams send node can post to your on-call channel as another step, or in place of the on-call text. Set its destination as described in Slack recipients and Microsoft Teams recipients.
Each level is another delay, fetch, and send node at the end of the chain. The cancelation token covers every step, so one cancel call stops the whole escalation.