Skip to main content
Subscriptions push real-time updates out of your factory straight to your backend over signed HTTPS webhooks—so your custom interface stays responsive without polling. (For how external events flow into your factory, see Event routing vs. outbound Subscriptions.) In the support example, subscribing to room.response and reviews.approvals.created lets your app post factory replies into your help desk the instant they arrive and alert a support lead the moment a refund needs sign-off.
Signed webhook delivery: factory events are signed with Standard Webhooks HMAC-SHA256, POSTed to your HTTPS endpoint for a 2xx within 10s, or retried with exponential backoff up to 7 attempts.Signed webhook delivery: factory events are signed with Standard Webhooks HMAC-SHA256, POSTed to your HTTPS endpoint for a 2xx within 10s, or retried with exponential backoff up to 7 attempts.

Event topics

A Subscription delivers every topic you subscribe to across all Rooms of the factory. In topic names, reviews.* refers to Reviews waiting on human input (questions, tool approvals, or app connections). Events submitted with delivery: "context" never trigger webhooks, and a steer Event arriving while a Room is already working does not emit a duplicate room.status transition. See Which webhooks an Event causes.

Create a Subscription

Create and manage Subscriptions either through the Factory API or in the Worklayer web app—both manage the same underlying resource.
Save the secret returned in the 201 Created response immediately—Worklayer displays it only once. See the Subscriptions API reference for list, update, delete, and rotation routes.

Endpoint URL requirements

Your destination URL must be a publicly reachable https:// URL up to 2,048 characters long:
  • No embedded username, password, or #fragment.
  • Cannot target localhost, *.localhost, or private/reserved IP ranges (including hostnames that resolve to private or reserved IPs).
Enabling/disabling a Subscription, firing webhook.test events, and inspecting delivery attempt logs are available in the Worklayer web app.

Webhook payload

Every delivery uses a consistent envelope:
  • id — unique event identifier.
  • environmentId — the ID of your factory.
  • data — topic-specific payload (linked from each topic in the table above).

Signing

Worklayer signs every webhook using the Standard Webhooks specification and includes three headers: Always verify the signature against the raw request body before parsing or acting on the payload:
Node.js
How verification works:
  1. Strip the whsec_ prefix from your secret and base64-decode the remainder to get the raw HMAC key.
  2. Construct the signed string: {webhook-id}.{webhook-timestamp}.{rawBody}.
  3. Compute the base64-encoded HMAC-SHA256 digest.
  4. Compare in constant time against every v1, entry in webhook-signature. Accept the request if any signature matches.
Never parse and re-serialize the JSON before verifying—whitespace or key-order changes will invalidate the signature. Rejecting timestamps older than 5 minutes (300 seconds) is recommended to guard against replay attacks.

Rotate the secret

Rotate a Subscription’s signing secret via Rotate the signing secret or the web app. The new secret is returned only once in that response. For 24 hours after rotation, Worklayer dual-signs every delivery with both the new secret and the immediately preceding secret (webhook-signature contains both space-separated signatures). Your handler should accept a webhook if any signature matches. Only one previous secret stays active—rotating a second time within 24 hours invalidates the oldest secret immediately.

Retries

Respond with any 2xx status within 10 seconds to acknowledge delivery. Offload heavy processing to a background queue after responding. Worklayer retries automatically on timeouts (> 10s), network errors, and 408, 425, 429, or 5xx responses using exponential backoff: If attempt 7 fails, delivery stops permanently. Other non-2xx responses (such as 400 or 3xx redirects) fail immediately without retrying. Updating a Subscription’s URL, disabling it, or deleting it cancels any pending retries. Worklayer retains webhook event logs for 30 days.

Deduplication and ordering

  • At-least-once delivery: retries can occasionally deliver the same event twice. Deduplicate using webhook-id.
  • Out-of-order arrivals: room.status and worker.status payloads include actorRevision and revision. To ensure stale updates never overwrite newer state, compare actorRevision first (higher is newer), then revision when actorRevision values match.

Subscription API reference

Create, update, rotate, and delete Subscriptions via HTTP.

Review

Handle approval, question, and connect-app webhooks end to end.