React to Healthie events with your own listener
Act on Healthie webhook events through the extension's built-in events, or build a custom listener when those are not enough.
An Awell care flow can react to a Healthie webhook event through the extension's built-in events, or through a custom listener that takes more work and gives more control.
Option 1: the Healthie extension's built-in events
Enable webhooks on the Healthie extension in Awell. These Healthie events can start a new care flow:
appointmentCreatedpatientCreated
If one of those is the trigger, nothing else is needed. See Integrate with extensions.
Option 2: a custom listener, for everything else
Build a listener that sits between Healthie and Awell and decides:
- which events should trigger anything at all
- what action to take against the Orchestration API, such as creating a patient
Use this for events the extension doesn't cover, or when the decision about what to do is more complicated than "start a flow".
A worked example with AWS Lambda
An HTTP request from Healthie invokes the function, which then:
- Receives the webhook. The handler is called with the incoming event and the Lambda context. The event carries the full webhook payload.
- Logs the event. Write the payload to the logs before doing anything with it, so there's a record of what actually arrived when the integration misbehaves.
- Decides whether to act, based on the event type and its contents.
- Calls the Orchestration API to do the thing, for example creating a patient or starting a care flow. See the API reference.
Verify that the request came from Healthie
A listener is a public endpoint, so check that a request is genuine before acting on it, the same way as for Awell's own webhooks.
Next steps
- Awell and Healthie for the wider integration.
- Receive webhook events for Awell's outbound side.