# Use Orbit Flows with Make

> Send events from every satellite to a Make scenario, with a webhook or a flow step, check that they really came from Bifröst Orbit and use the booking, order or review in the next modules.

Source: https://docs.bifrostorbit.com/orbit/admins/flows-make/

Make runs scenarios: a trigger, then modules that act in other apps. With Orbit Flows and webhooks, the trigger can be anything that happens in your satellites. For example, Northwilds sends every Travel Orbit booking to a Make scenario that adds the traveller to its newsletter and creates a deal in its CRM.

You need an owner or admin role in your organisation, a paid satellite plan (see [Who can use webhooks](https://docs.bifrostorbit.com/orbit/admins/webhooks/)) and a Make account.

## Choose how to send

| | A webhook in Orbit | A flow step |
| --- | --- | --- |
| Set up under | **Webhooks** | **Flows**, as **Send to a webhook** |
| What is sent | Every event you tick, as it happens | Only when the flow's conditions are true |
| Before it is sent | Nothing | Anything a flow can do: conditions, an approval, an AI step |
| Signed | Yes | No |
| Body | The event itself | The flow, the run, the event, earlier steps and your message |

Use a webhook when Make should decide what happens. Use a flow step when Orbit should filter first, for example only bookings over €2,000 that the trip lead approved.

## 1. Get an address from Make

1. In Make, create a scenario and choose **+** to add the first module.
2. Search for **Webhooks** and choose **Custom webhook**.
3. Choose **Add**, name it, such as Orbit bookings, and choose **Save**.
4. Make shows an address like `https://hook.eu2.make.com/n7k2v4qz8wbookings`. Choose **Copy address to clipboard**.

Leave Make open: it is now waiting for the first message, so it can learn the data structure.

## 2. Send events to Make

### With a webhook

1. In Orbit, open **Organisations**, choose your organisation, then **Webhooks**, and choose **Add webhook**.
2. Name it, such as Bookings to Make, and paste the address from Make into **Address**.
3. Tick the events, such as `travel.booking.created` and `travel.booking.cancelled`, and choose **Add webhook**.
4. Copy the **signing secret** Orbit shows once and keep it somewhere safe. You need it to check the signature.

Choose **⋯** next to the webhook, then **Send a test**. Make shows **Successfully determined**, and the fields of the message are now available in later modules.

### Or from a flow

1. In Orbit, open **Flows** and open a flow, or choose **New flow**.
2. Under **Then**, choose **Add a step**, then **Send to a webhook**.
3. Paste the address from Make and choose **JSON for your own system**.
4. Write a message, such as `Booking {{event.data.reference}} is paid.`, and choose **Save flow**.

To send a first message for Make to learn from, choose **Run now** on the flow, or wait for the next event. **Test the flow** only shows what would be sent; it sends nothing.

## 3. Use the fields

In the next module, such as a CRM's **Create a deal**, pick fields from the webhook:

- From a webhook in Orbit: `event` is the event's type, and the details are in `data`, such as `data.reference`, `data.travellers` and `data.total`. Amounts are in cents, so 249000 is €2,490.
- From a flow step: the same event is in `event`, so the reference is `event.data.reference`. Your message is in `message`, and what earlier steps did is in `steps`, such as `steps.draft001.text` from an AI step.

Every field each event has is in the [event reference](https://docs.bifrostorbit.com/reference/events/).

When several kinds of event go to one scenario, add a **Router** after the webhook, with a filter on `event` for each route, such as `travel.booking.created` on one and `travel.booking.cancelled` on the other.

## 4. Check the signature

Messages from a webhook in Orbit carry `x-orbit-timestamp` and `x-orbit-signature` headers. Checking them stops anyone else who learns the address from sending fake bookings.

1. Open the Custom webhook's settings, choose **Show advanced settings**, and turn on **Get request headers** and **JSON pass-through**. The body then arrives as text, exactly as it was signed.
2. Add a filter after the webhook. Make the condition: `x-orbit-signature` equal to Make's `sha256` function over the timestamp, a full stop and the body, with your signing secret as the key and `hex` as the encoding.
3. Optionally, refuse messages whose `x-orbit-timestamp` is more than five minutes old.

The signature is the HMAC-SHA256 described in [Verify webhooks from Bifröst Orbit](https://docs.bifrostorbit.com/orbit/developers/verify-webhooks/). Flow steps are not signed, so treat their address like a password.

## 5. Switch the scenario on

Turn the scenario on with the switch at the bottom of Make's editor. Make's webhooks answer straight away, so Orbit counts each message as delivered. If Make is down, Orbit tries again for up to 24 hours; see [When your system is down](https://docs.bifrostorbit.com/orbit/admins/webhooks/).

## Ideas

- New Travel Orbit bookings to your CRM and newsletter.
- Commerce Orbit orders over 500 to your accounting system.
- Careers Orbit hires to your HR system.
- Presence Orbit one-star reviews to a ticket in your help desk, after an [Orbit Flows](https://docs.bifrostorbit.com/orbit/admins/flows/) approval.
