Skip to content

Operations & observability

Run the outbox worker, deliver webhooks and email, and inspect audit data.

Commerce mutations write an audit entry and outbox rows in the same transaction. A separate Worker delivers the work asynchronously. This page is the operator’s view; the Observability module explains the business model.

Outbox worker

apps/edgecart/workers/outbox runs:

  • as a queue consumer for edgecart-outbox,
  • on a one-minute cron,
  • with a dead-letter queue (edgecart-outbox-dlq) after five retries.

It delivers:

  • webhook subscriptions,
  • order-confirmation email,
  • async plugin action hooks (order:created, order:paid, order:fulfilled, order:cancelled, refund:created).

Deploy the outbox worker

pnpm --filter edgecart outbox:deploy

The Worker needs its own email configuration. The main app’s SMTP secrets are not shared automatically.

Webhooks

  • Endpoints subscribe to exact event names or ["*"].
  • Deliveries are signed with x-edgecart-signature: t=...,v1=... over <timestamp>.<body>.
  • Delivery is at least once; deduplicate by event ID.
  • A 410 Gone response deactivates the endpoint.
  • Inspect attempts with GET /api/webhook-deliveries.

See Webhooks & events for the receiver-side guide.

Email

The outbox Worker supports Cloudflare Email Sending (send_email binding) or SMTP secrets. Locally, sent mail is captured in the Workers local explorer and nothing leaves the machine.

Audit and retention

  • Mutations record an audit entry with actor and request context.
  • Plugin invocation and audit history is purged by the outbox scheduled job.
  • Plugin delivery rows are fanned out per active installation, claimed with a lease, retried with backoff, and purged after 30 days.

Health checks

  • Confirm the queue has a consumer and a DLQ in the Cloudflare dashboard.
  • Check the Worker’s scheduled runs and queue metrics.
  • Inspect GET /api/webhook-deliveries for failed attempts.
  • Check the plugin invocation log when a plugin action hook is not firing.

Type to search…

↑↓ navigate↵ selectEsc close