Internal Events

App Events

App Events let Membrane know when something happens in your app. They can be used to trigger Flows using App Event Trigger.

App Event Types

To use App Events, you need to define one or more App Event Types. You can do it on the App Event Types page.

Each App Event Type has:

  • Schema – a Data Schema describing the event's contents.
  • Example – an example of the event's contents matching the Schema. You can use Example to generate schema.

Global Webhook

Use Global Webhook to send app events to Membrane in a centralized (not per-user) way.
Simply make an HTTP request of any type to the webhook URI and the event will be captured and processed.

Associating Events with Customers

When you send an event to the Global Webhook, Membrane needs to know which customer (tenant) the event belongs to. There are three ways to specify this, in order of priority:

  1. Authentication Token (Recommended) – Include the customer's authentication token in the Authorization header of the webhook request. Membrane will automatically extract the tenant ID from the token.

    curl --request POST \
      --url https://api.integration.app/{GLOBAL_WEBHOOK_URI} \
      --header "Authorization: Bearer {CUSTOMER_TOKEN}" \
      --header "Content-Type: application/json" \
      --data '{"event": "data"}'
  2. Tenant ID Formula – Configure a formula in the App Event Type settings that extracts the tenant ID from the event payload. This is useful when you cannot include an authentication token in the request.

  3. User ID Formula (Legacy) – For backward compatibility, you can use the older "User ID Formula" field which works the same way as Tenant ID Formula.

If none of these methods provide a tenant ID, the event will be rejected.

Per-customer Subscriptions

If instead of a Global Webhook, you want to use per-user webhooks or if you already have API that allows per-user event subscriptions, you can configure subscriptions for your App Event.

To do this, configure the Subscription Request:

You can use Customer Fields and webhookUri variables to configure the request.

The request will be called the first time this App Event Type is used for a given User.
You can find the subscription request and response, as well as other information about subscriptions on the Subscriptions page.

Batch Events

If the body of the request your app sends to membrane is an array, it will be treated as multiple events.

If global webhook is used, each event can have a different customer id and it will be processed as events for different customers.