Skip to content

Using Merlin

Webhooks

Start automations from Stripe, PostHog and other products, with each product's setup steps.

A webhook lets a product such as Stripe or PostHog start an automation the moment something happens there. Merlin gives each product one webhook URL in your workspace, the product sends its events to it, and every automation that listens to that product starts from them.

Merlin only receives events. A webhook can't read or change anything in the product that sends them.

Set up a webhook

  1. In the web app, open Automations, choose New automation, pick When something happens and select Continue.
  2. Under Source, choose the product and select Set up. The product's webhook page opens.
  3. Select Generate in the Webhook URL row and copy the URL from the field under it.
  4. Follow the product's steps below to add the URL there.
  5. Sort out the secret, which proves each event really came from the product:
    • Statsig, incident.io, Stripe and Granola make a signing secret once you save the URL there. Paste it into Signing secret on the webhook page and select Save secret. Until you do, Merlin turns every event away.
    • PostHog takes a token from Merlin instead. Select Show in the Token row, copy it, and add it in the product as the Authorization header with the value Bearer followed by the token.
  6. Send a test event from the product. The webhook's status reads Waiting until the first event arrives and turns Active once Merlin checks it. Then go back to New automation and pick the event to listen for.

Right after Generate the webhook waits: paste the URL into Stripe, paste Stripe's signing secret here, and the First event row turns over once an event arrives.

Any member can generate a webhook. Its URL and secret are managed by whoever set it up and by owners and admins. Event history on the webhook page lists every event from the last seven days and what each automation did with it, including events Merlin turned away and why.

Set up each product

Every product below follows the same five steps. Only the names change.

Statsig

Statsig's own guide: Event webhook.

  1. In Statsig, open Settings → Integrations and choose the Webhook card under Events.

The Webhook card sits under Events in Settings → Integrations.

  1. Paste the webhook URL into Webhook URL, select Generate New Key under Webhook Signing Secret, then select Enable. Statsig first checks the URL with a url_verification request, which Merlin answers by itself.

Statsig sends the URL verification request when you select Enable. Merlin answers it, so there is nothing to set up for it.

  1. Event Filtering opens once the webhook is enabled. Clear Exposures, tick Configuration Changes, leave All Notifications and Custom Events off, and select Save. Merlin starts automations from gate and experiment changes, not exposures.

Only Configuration Changes is ticked. Exposures would send an event every time a user is checked against a gate.

  1. Copy the key under Webhook Signing Secret (it starts with webhook-) and paste it into Signing secret in Merlin. The key stays on the Webhook card after you enable it, with a copy button next to it.

Copy the key with the button next to it. Generate New Key replaces it, and Merlin then needs the new one.

  1. Change a gate or experiment to send the first event, and watch the webhook turn Active.

incident.io

incident.io's own guide: Webhooks.

  1. In incident.io, open Settings → Webhooks (under Extend) and select Add Endpoint.

Webhooks lives under Extend in incident.io's settings. Endpoints lists every URL incident.io sends to.

  1. Paste the webhook URL into Endpoint URL.
  2. Under Subscribe to events, tick public_incident.incident_created_v2, public_incident.incident_status_updated_v2, public_alert.alert_created_v1 and public_incident.follow_up_created_v2. With nothing ticked, the endpoint receives every event.

Tick only the events Merlin starts automations from. The rest of the catalog can stay unticked.

  1. Select Create. On the endpoint's page, reveal Signing Secret, copy it and paste it into Signing secret in Merlin.

The signing secret stays masked until you reveal it. It is the value Merlin checks every request against.

  1. Declare a test incident to send the first event, and watch the webhook turn Active.

Stripe

Stripe's own guide: Webhooks.

  1. In Stripe Workbench, open Webhooks and select Add destination. Keep Your account as the event destination scope and choose the Snapshot payload style, not Thin: a thin event carries no details for Merlin to read, so Merlin turns it away.

Keep Your account and Snapshot selected. The event list is further down the same step.

  1. Under Events, tick the events Merlin can start from: invoice.paid, invoice.payment_failed, customer.created, customer.subscription.created, customer.subscription.updated, charge.refunded and charge.dispute.created. Select Continue.

Selected events lists what the destination will send. Its count should read 7.

  1. Choose Webhook endpoint as the destination type and select Continue.

Merlin receives events over HTTPS, so pick Webhook endpoint.

  1. Name the destination Merlin, paste the webhook URL into Endpoint URL and select Create destination. Copy its signing secret (it starts with whsec_) from the destination's page and paste it into Signing secret in Merlin.

The summary at the top repeats the scope, payload style and event count chosen in the earlier steps.

  1. Trigger one of the chosen events, such as a test-mode checkout, to send the first event, and watch the webhook turn Active.

PostHog

PostHog's own guide: Webhook destination.

  1. In PostHog, open Destinations under CDP in the sidebar. Under Create a new destination, search for HTTP Webhook and select Create on its row.

Destinations lists the ones you have, then every template you can create from. Search the second list for HTTP Webhook.

  1. Paste the webhook URL into Webhook URL and keep the default JSON body.
  2. Under Match events and actions, select Add event matcher and pick each event the destination should send, such as registration_completed. Without a matcher it sends every event.
  3. Under Secret headers, select Add entry and add Authorization with the value Bearer followed by Merlin's token, then select Create & enable.

The URL, the event matcher and the token all sit on this one form. The token goes under Secret headers so PostHog keeps it out of its logs.

  1. Under Testing, select Start testing, then Test function to send an example event, and watch the webhook turn Active.

Test function sends the example event to Merlin, which is enough to turn the webhook Active.

Granola

Granola's own guide: Webhooks.

  1. In the Granola app, open Settings → Connectors → Webhooks and select Set up a webhook. To send only one folder's notes, open the folder and choose Integrations → Webhooks instead.

Webhooks sits at the bottom of Connectors in Granola's settings.

  1. Keep My workspace as the owner, so the webhook keeps working if you leave the workspace, and choose which notes it covers.
  2. Under When should we send an event?, keep the events to start automations from ticked: A new note is ready (note.generated), A note is edited (note.edited) and A note is shared (note.access_granted).

All three events are ticked by default. Untick any you will not start an automation from.

  1. Paste the webhook URL into Destination URL and select Create webhook.

The URL is the last step. Granola shows the signing secret once you create the webhook.

  1. Copy the signing secret Granola shows only once (it starts with whsec_) and paste it into Signing secret in Merlin.
  2. Let Granola finish the notes of a meeting to send the first event, and watch the webhook turn Active.

A Granola event names the note but carries none of its content. Connect Granola's MCP server on the runtime the automation runs on, so the run can read the note it was started for.

Fix a webhook that turns events away

When Merlin turns an event away, the First event row says why. Before the first event arrives the webhook stays Waiting; once it is Active, a refused event changes its status to Needs attention. Check that the URL in the product matches the one on the webhook page and that the secret is the current one, then send another event.

Event history, further down the webhook page, lists every event from the last seven days, one row per automation that saw it. Started a run links the run it started. Skipped names the check the event failed, such as a filter the event does not match. Turned away gives the reason Merlin refused the request, such as a signature that does not match the secret. Rate limited, Paused and Duplicate rows explain themselves the same way.

Each row says what one automation did with one event and why. A turned-away row never reached an automation, so its reason is about the request itself.

Regenerate issues a new URL and stops the old one at once, so update the product right away. Replace does the same for the secret.