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

# Start n8n workflows from WhatsApp events

> Flowella Trigger node for n8n: the events it accepts, the fields each item carries, how it checks signatures and how to handle repeats.

**Flowella Trigger** starts an n8n workflow each time Flowella sends one of your outbound webhook events, such as an inbound WhatsApp message, a delivery status or an opt-out. It checks the signature on every request with the signing secret in your credential, keeps only the events you select and passes each event to the workflow as one item. To install the node and connect it, see [Set up](https://knowledge.flowella.io/integrations/n8n.md).

## How the trigger handles an event

```mermaid theme={null}
flowchart LR
    A["Event in Flowella"] --> B["Signed webhook to your n8n URL"]
    B --> C{"Signature valid?"}
    C -- "No" --> D["401: workflow doesn't start"]
    C -- "Yes" --> E{"Event selected?"}
    E -- "No" --> F["200: ignored"]
    E -- "Yes" --> G["Workflow starts with one item"]
```

The trigger answers Flowella as soon as it receives an event, so a long workflow doesn't make the delivery time out.

## Events

The trigger's **Events** list has these event types. The [webhooks reference](https://knowledge.flowella.io/api-reference/webhooks.md#event-types) explains exactly when each one fires and what its `data` holds.

| Event | When it fires |
| - | - |
| `message.received` | A contact sends a message to one of your WhatsApp numbers. |
| `message.sent` | Flowella sends a message, or Meta reports an outbound message as sent. |
| `message.delivered` | Meta reports that the message reached the recipient's device. |
| `message.read` | Meta reports that the recipient read the message. |
| `message.failed` | Meta reports that the message could not be delivered. |
| `conversation.opened` | An inbound message creates a new conversation. |
| `conversation.closed` | A conversation is closed. |
| `optout.created` | A contact opts out. Read the known issue in the [webhooks reference](https://knowledge.flowella.io/api-reference/webhooks.md#event-types) before you rely on it. |
| `template.status_updated` | Meta changes the status of one of your templates, for example to `APPROVED` or `REJECTED`. |
| `contact.created`, `contact.updated`, `contact.deleted` | A contact is created, updated or deleted with a single-contact API call. |

Two more event types can arrive:

* `webhook.test` is sent when you select **Send test event** on the webhook in Flowella. The trigger always passes it on, whatever you select under **Events**.
* `flow.status_updated` isn't in the **Events** list. To receive it, tick it on the webhook in Flowella and leave **Events** empty on the trigger.

## Choose which events start the workflow

You choose events in two places, and an event must pass both:

1. **On the webhook in Flowella.** Under **Events**, tick the events Flowella should send. Flowella sends nothing else. See [Webhooks](https://knowledge.flowella.io/settings/webhooks.md).
2. **On the trigger in n8n.** Leave **Events** empty to start the workflow for every event Flowella sends. Select one or more events to keep only those. The trigger answers the others with `200` and doesn't start the workflow.

> [!TIP]
>
> Use one webhook and one trigger for each job, with only the events that job needs. Each workflow stays simple, and a problem in one doesn't hold up the others.

## Output fields

Each event becomes one item with these fields:

| Field | What it holds |
| - | - |
| `eventType` | The event type, such as `message.received`. |
| `eventId` | The event's unique ID. It stays the same across retries and replays. |
| `occurredAt` | When Flowella created the event, as an ISO 8601 time in UTC. |
| `conversationId` | The conversation's ID, when the event has one. |
| `contactId` | The contact's ID, when the event has one. |
| `contactPhone` | The contact's phone number, when the event has one. Today only `optout.created` does. |
| `messageBody` | The message text, when the event has it. Flowella's message events carry IDs and not text, so this is `null`. |
| `organizationId` | The organisation's ID, when the event has one. Otherwise `null`. |
| `data` | The event's original `data` object, unchanged. |

A `message.received` item looks like this:

```json theme={null}
{
  "eventType": "message.received",
  "eventId": "evt_3f2b8c1d9a7e4f60b5c2d8e1a4f7b9c3",
  "occurredAt": "2026-10-21T09:30:00.000Z",
  "organizationId": null,
  "conversationId": "clxxxxxxxxxxxxxxxxxxxxxxxx",
  "contactId": "clxxxxxxxxxxxxxxxxxxxxxxxx",
  "contactPhone": null,
  "messageBody": null,
  "data": {
    "messageId": "clxxxxxxxxxxxxxxxxxxxxxxxx",
    "conversationId": "clxxxxxxxxxxxxxxxxxxxxxxxx",
    "contactId": "clxxxxxxxxxxxxxxxxxxxxxxxx",
    "direction": "INBOUND",
    "type": "TEXT",
    "metaMessageId": "wamid.HBgLMTU1NTEyMzQ1NjcVAgASGBQzQUY"
  }
}
```

### Get the phone number or the message text

Flowella's events tell you what happened and to whom, by ID. When a workflow needs the contact's details or what they wrote, fetch them with an **HTTP Request** node and your API key:

| You need | Request | Field in the response |
| - | - | - |
| The contact's phone number, name or opt-out state | `GET /v1/contacts/{contactId}` | `phone`, `name`, `isOptedOut` |
| The text of a message | `GET /v1/messages/{messageId}`, with the ID from `data.messageId` | `body`, which can be empty |

Both requests go to `https://api.flowella.io` with your API key in an `Authorization` header, as `Bearer` followed by the key. See the [API introduction](https://knowledge.flowella.io/api-reference/introduction.md).

## Signature checks

Flowella signs every webhook with the endpoint's signing secret. The trigger computes the same HMAC-SHA256 signature over the raw request body, using **Webhook Signing Secret** from your credential, and compares it with the `X-Flowella-Signature` header.

* If the signature doesn't match, or the credential has no signing secret, the trigger answers `401` and the workflow doesn't start.
* The trigger checks the current secret only. When you change the secret in Flowella, update the credential straight away, or every event fails until you do.
* If you use n8n's own **Webhook** node instead of **Flowella Trigger**, nothing checks the signature for you. See [Verify signatures](https://knowledge.flowella.io/api-reference/webhooks.md#verify-signatures).

## Retries, repeats and order

| Behaviour | What to do |
| - | - |
| Flowella waits up to 10 seconds for a `2xx` response and tries each event 3 times. | Keep the workflow active, so the trigger can answer. |
| After 10 events in a row fail, Flowella turns the webhook off. Events that happen while it is off are not sent later. | Turn the webhook back on in Flowella. See [Turn a webhook back on](https://knowledge.flowella.io/settings/webhooks.md#turn-a-webhook-back-on). |
| The same event can arrive more than once, for example after a retry or a replay. | Deduplicate on `eventId` before a step that must run once, such as a send. |
| One outbound message can produce two `message.sent` events with different IDs. | Use `data.messageId` to link them to the same message. |
| Events can arrive out of order. | Compare `occurredAt` when the order matters. |

For the full rules, see [Responses, retries and timeouts](https://knowledge.flowella.io/api-reference/webhooks.md#responses-retries-and-timeouts) and [Deduplicate events](https://knowledge.flowella.io/api-reference/webhooks.md#deduplicate-events).

## Related

> [card] [Set up the node](https://knowledge.flowella.io/integrations/n8n.md)
>
> Install the node, add the credential and connect the webhook.

> [card] [Flowella node](https://knowledge.flowella.io/integrations/n8n/flowella-node.md)
>
> Send messages and templates from the workflow the trigger starts.

> [card] [Webhooks reference](https://knowledge.flowella.io/api-reference/webhooks.md)
>
> Event types, request bodies, signatures and retries.

> [card] [Webhooks in Settings](https://knowledge.flowella.io/settings/webhooks.md)
>
> Add endpoints, send test events and read the delivery log.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.