# React to Healthie events with your own listener
URL: https://docs.awellhealth.com/docs/automate-with-events/react-to-healthie-events

> For the complete documentation index, see [llms.txt](https://docs.awellhealth.com/llms.txt).



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 [#option-1-the-healthie-extensions-built-in-events]

Enable webhooks on the Healthie extension in Awell. These Healthie events can start a new care flow:

* `appointmentCreated`
* `patientCreated`

If one of those is the trigger, nothing else is needed. See
[Integrate with extensions](/docs/connect-systems/integrate-with-extensions).

## Option 2: a custom listener, for everything else [#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 [#a-worked-example-with-aws-lambda]

An HTTP request from Healthie invokes the function, which then:

1. **Receives the webhook.** The handler is called with the incoming event and the Lambda context. The
   event carries the full webhook payload.
2. **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.
3. **Decides whether to act**, based on the event type and its contents.
4. **Calls the Orchestration API** to do the thing, for example creating a patient or starting a care
   flow. See [the API reference](/api-reference).

## Verify that the request came from Healthie [#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](/docs/automate-with-events/receive-webhook-events).

## Next steps [#next-steps]

* [Awell and Healthie](/docs/connect-systems/awell-healthie) for the wider integration.
* [Receive webhook events](/docs/automate-with-events/receive-webhook-events) for Awell's outbound side.
