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

# Receive webhook events in FIFO order

> Configure a FIFO webhook endpoint to receive selected Novu events in ordered HTTP batches.

export const connectorName_0 = "FIFO Endpoint"

A FIFO endpoint sends Novu webhook events to an HTTP receiver in strict first-in, first-out order. Novu waits for a successful acknowledgement before sending the next batch.

<Note>
  Outbound webhooks are available on [Team and Enterprise plans](https://novu.co/pricing).
</Note>

Strict ordering limits throughput because one failed or slow batch blocks later batches. Use FIFO only when the receiver must process events sequentially.

## Prerequisites

* A publicly reachable HTTPS receiver
* A receiver that can process the entire request body and return a successful HTTP response
* Permission to manage webhook endpoints in the Novu environment

## Configuration

| Dashboard field    | Required | Description                                                                                                          |
| ------------------ | -------- | -------------------------------------------------------------------------------------------------------------------- |
| **Endpoint URL**   | Yes      | HTTP receiver that accepts each transformed batch.                                                                   |
| **Transformation** | Yes      | JavaScript that converts the batch into one raw request body string.                                                 |
| Batching controls  | No       | Dashboard controls for how many messages are grouped into a delivery and how long the endpoint waits before sending. |

Batching is configured on the endpoint rather than in the transformation. Use the labels and limits shown in your Novu Dashboard, and do not hard-code an assumed batch size in the receiver.

## Transformation contract

FIFO transformations run once per batch.

The handler receives one delivery batch:

* `input.events`, an array whose length is capped by the endpoint batch size
* `input.events[].eventType`, the Novu event type, for example `message.sent`
* `input.events[].payload`, the webhook body

The webhook body wraps the resource in an envelope. `payload.object` is the resource type as a string, such as `"message"`, and the resource itself is under `payload.data.object`. For message events, fields such as `subscriberId` and `channel` are therefore at `event.payload.data.object`. Other event families use different resource shapes, so guard extracted fields with defaults.

It must return:

```ts theme={null}
{
  requestBody: string;
}
```

This verified example collects the batch into a single JSON request body:

```js theme={null}
function handler(input) {
  const events = input.events.map((event) => ({
    eventType: event.eventType,
    payload: event.payload,
  }));

  return {
    requestBody: JSON.stringify({ data: events }),
  };
}
```

The receiver gets one HTTP request whose raw body has this shape:

```json theme={null}
{
  "data": [
    {
      "eventType": "message.sent",
      "payload": {
        "type": "message.sent",
        "object": "message",
        "data": {
          "object": {
            "subscriberId": "subscriber-123"
          }
        }
      }
    }
  ]
}
```

Your receiver must acknowledge the current batch successfully before the next batch can be delivered. The official FIFO documentation does not define a numeric batch default.

## Configure in the Dashboard

<Steps>
  <Step>
    ## Prepare the receiver

    Create an HTTPS route that reads the raw batch body, completes processing, and returns a successful response only when the batch is safe to advance.
  </Step>

  <Step>
    ## Add the endpoint

    Open **[Webhooks](https://dashboard.novu.co/webhooks)** in the Novu Dashboard, select **Endpoints**, click **Add Endpoint**, and choose **{connectorName_0}**.
  </Step>

  <Step>
    ## Enter connection details

    Enter the endpoint URL. Configure the batching controls shown in the Dashboard based on the maximum latency and batch size your receiver can handle.
  </Step>

  <Step>
    ## Configure the transformation

    Review the transformation. Ensure `handler(input)` handles every element in `input.events` and returns `requestBody` as a string.
  </Step>

  <Step>
    ## Select event types

    Choose the [event types](/platform/developer/webhooks/event-types) that require strict ordering. Avoid unrelated events that could block the same delivery sequence.
  </Step>

  <Step>
    ## Test the endpoint

    Create the endpoint. Send multiple examples from **Testing** and inspect **Logs**. Confirm the receiver gets each batch only after the preceding request succeeds and that the body matches the transformation output.
  </Step>
</Steps>

## Verify delivery

Confirm the receiver logged one request whose body matches the transformed batch. Send two tests in sequence and verify the second request arrives only after the first returns a successful response.

## Troubleshooting

* **Later events stop arriving**: Inspect the earliest failed or timed-out batch. FIFO delivery cannot advance until the current batch succeeds.
* **The receiver cannot parse the body**: Confirm the transformation returns `requestBody` as a string containing valid data for your receiver.
* **Throughput is too low**: Review the Dashboard batching settings and receiver latency. Strict acknowledgement sequencing limits throughput by design.
* **Events inside a batch disappear**: Ensure the transformation maps every `input.events` entry that the receiver needs.
* **Events arrive at the wrong endpoint**: Confirm the endpoint URL and Novu environment before replaying failures.

## Related

* [Webhook connectors overview](/platform/developer/webhooks/connectors)
* [Webhook event types](/platform/developer/webhooks/event-types)
* [Webhook delivery, retries, and recovery](/platform/developer/webhooks/webhooks#recovering-and-resending-failed-messages)

## Official references

* [Svix FIFO endpoints](https://docs.svix.com/advanced-endpoints/fifo-endpoints)
* [How FIFO webhook delivery works](https://www.svix.com/blog/fifo-ordered-webhooks-delivery/)
