Skip to Content
ProvidersBuilt-in providers

Replicate webhooks

Receive and verify Replicate webhooks with Trigger.dev. Check the Standard Webhooks signature and run a task for each Replicate event, filtered on event.status.

webhooks.replicate() verifies the Standard Webhooks signature Replicate sends in the webhook-* headers on every request.

/trigger/replicate.ts
import { ,  } from "@trigger.dev/sdk";

export const replicate = ..define({
  : "replicate",
  : .replicate(),
});

export const replicateEvents = ({
  id: "replicate-events",
  : replicate,
  : async ({  }) => {
    .();
  },
});

To run a subscriber only for some events, add a filter on event.status.

SettingValue
Sourcewebhooks.replicate()
VerificationStandard Webhooks (webhook-id, webhook-timestamp, webhook-signature)
CredentialSigning secret issued by Replicate
Event typeevent.status
Replicate docsReplicate webhook docs

Set up Replicate

  1. Start trigger dev or deploy, then copy the endpoint's Webhook URL from the Webhooks page.
  2. Replicate has no webhook settings page. Pass the webhook URL as webhook when you create a prediction, with webhook_events_filter set to the events you want (start, output, logs, completed).
  3. Get your signing secret from GET https://api.replicate.com/v1/webhooks/default/secret. It starts with whsec_ and is the same for every webhook on your user or organization. Choose Set signing secret on the Trigger.dev endpoint and paste it.
  4. Create a prediction with the webhook set, or use the endpoint's Test tab, and check the endpoint's Deliveries tab. See Verify the connection if nothing arrives.

Was this page helpful?

Last updated

Edit on GitHub

On this page