> ## Documentation Index
> Fetch the complete documentation index at: https://wiki.carewithemma.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Workflow Orchestration: Connect Emma via Your Platform

> Route events to Emma through n8n, Workato, MuleSoft, Boomi, or any integration platform that can receive webhooks and make authenticated HTTP calls.

If your organization already uses an integration or automation platform, you can route events to Emma through it rather than connecting systems directly. The orchestration layer receives events, transforms payloads, applies routing logic, and calls Emma's APIs — letting your existing platform stay responsible for connectivity and data transformation.

## What the orchestration layer does

<CardGroup cols={2}>
  <Card title="Receive events" icon="bell">
    Accepts webhook events from your EMR, forms platform, or other systems.
  </Card>

  <Card title="Transform payloads" icon="arrows-rotate">
    Reshapes and enriches data to match the format Emma expects.
  </Card>

  <Card title="Call Emma's APIs" icon="code">
    Forwards the processed event or request to Emma with the correct authentication headers.
  </Card>

  <Card title="Route outcomes" icon="route">
    Takes Emma's response and delivers it to CRM, EMR, or any downstream system.
  </Card>
</CardGroup>

## Compatible platforms

Any platform that can receive a webhook and make an HTTP call works with Emma. Commonly used platforms include:

* **n8n**
* **Workato**
* **MuleSoft**
* **Boomi**
* **Custom middleware** (Node.js, Python, etc.)

<Note>
  Emma provides ready-made relay templates for n8n. See the [Abandonment Recovery](/abandonment-recovery) guide for a step-by-step example of connecting a telehealth platform to Emma using the n8n relay template.
</Note>

## Example: n8n relay flow

The n8n relay template normalizes a platform webhook and forwards it to Emma. The flow passes through five nodes:

```text theme={null}
Webhook trigger  →  Switch (event type)  →  Set (normalize payload)  →  HTTP (call Emma + add secret)  →  Respond (200 OK to platform)
```

The relay handles three things your source platform may not support natively:

* Adding Emma's inbound secret header to every outbound request
* Normalizing the payload shape to match what Emma expects
* Distinguishing between `forms.abandoned` and `forms.completed` event types so each is routed correctly

Set the following environment variables in your n8n instance before activating the relay:

```bash theme={null}
EMMA_API_BASE_URL=https://api.emma.example
EMMA_CLINIC_ID=<your clinic ID from Emma Integrations>
EMMA_N8N_SECRET=<your inbound secret from Emma Integrations>
```

## When to use orchestration

<Tip>
  Use orchestration when you want your existing integration platform to own the routing and transformation logic. If you're connecting directly from a single system that can make HTTP calls, the [REST API](/rest-api) or a direct [webhook subscription](/webhooks) may be simpler.
</Tip>

## Related guides

<CardGroup cols={2}>
  <Card title="Abandonment Recovery" icon="cart-shopping" href="/abandonment-recovery">
    Full walkthrough using an n8n relay to connect a telehealth platform to Emma.
  </Card>

  <Card title="Choosing a Method" icon="list-check" href="/choosing-a-method">
    Decide when orchestration is the right fit versus a direct integration.
  </Card>
</CardGroup>
