# Durable webhooks, delayed tasks & workflows

> Verify and persist inbound webhooks before responding, schedule one-shot delayed invocations, run crons and pull-queue workers, and execute multi-step workflows with automatic retries and dead-letter recovery.

Category: Async & workflows · Maturity: GA & Beta · Plans: Hobby, Pro, Scale · Updated 2026-11-26

External webhook providers time out or fail deliveries if a sleeping backend takes too long to respond or hits a transient error. Gregale combines signature verification, durable queuing, delayed tasks, batch jobs, crons, and multi-step workflow recovery natively on the same platform.

## Register a durable Stripe webhook and inspect dead-letter entries

```bash
curl -X POST https://api.gregale.dev/v1/apps/my-api/inbound-webhooks \
  -H "Authorization: Bearer $GREGALE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "stripe-primary",
    "provider": "stripe",
    "signing_secret": "whsec_...",
    "delivery_path": "/internal/stripe"
  }'

# Inspect failed deliveries or delayed tasks in the unified dead-letter ledger
gregale dlq list my-api
```

## Key capabilities

- **Persist-before-ack inbound webhooks:** Verifies Stripe or generic HMAC-SHA256 signatures, deduplicates on X-Gregale-Event-ID, persists to the durable queue, and returns 202 Accepted before waking your app.
- **Delayed one-shot execution:** Schedule a durable future invocation directly on Gregale without provisioning a separate Redis queue, cron daemon, or external scheduler.
- **Built-in jobs, crons & pull leases:** Run HTTP crons or command tasks alongside your app, process large batches with jobs and artifacts, or lease messages directly from workers without an HTTP listener.
- **Stored & code-first durable workflows:** Orchestrate multi-step execution with retries, waits, dependencies, scheduled triggers, workflow insights, and configurable recovery policies.

## Typical PaaS vs. Gregale

| Capability | Typical PaaS | Gregale |
|---|---|---|
| Webhooks arriving while backend sleeps | May time out on cold boot or drop on 503 | Signature checked and queued durably before 202 Accepted |
| Delayed tasks, crons & retries | Requires Upstash QStash, Inngest, or Temporal add-ons | Built into the core API with unified dead-letter ledger |
| Pull-queue worker model | Manage SQS/RabbitMQ separately | Pull leases with capacity-controlled worker acks/nacks |

## Documentation

- [Inbound webhooks](https://gregale.dev/docs/inbound-webhooks.md)
- [Event-driven workloads](https://gregale.dev/docs/event-driven.md)
- [Stored workflows](https://gregale.dev/docs/stored-workflows.md)
- [Code workflows](https://gregale.dev/docs/code-workflows.md)
- [Jobs](https://gregale.dev/docs/jobs.md)
- [Scheduled crons](https://gregale.dev/docs/crons.md)
- [Pull-queue leases](https://gregale.dev/docs/queue-pull-leases.md)

## Related guides

- [durable-inbound-webhooks-scale-to-zero](https://gregale.dev/articles/durable-inbound-webhooks-scale-to-zero.md)
- [durable-code-workflows-scale-to-zero](https://gregale.dev/articles/durable-code-workflows-scale-to-zero.md)
- [stored-workflow-recovery-missed-schedules](https://gregale.dev/articles/stored-workflow-recovery-missed-schedules.md)
- [scale-to-zero-cron-jobs-event-triggers](https://gregale.dev/articles/scale-to-zero-cron-jobs-event-triggers.md)
- [pull-queue-workers-workload-identity](https://gregale.dev/articles/pull-queue-workers-workload-identity.md)

## Runnable starters on GitHub

- [Durable Stripe & HMAC Webhooks](https://github.com/gregale-dev/durable-stripe-webhooks) (Node 22 · Inbound Webhooks): Stripe and generic HMAC-SHA256 inbound webhook receiver validating X-Faas-Invocation-Source, event deduplication, retries, and DLQ replay while parked.
- [Node.js API + Private Worker Queue](https://github.com/gregale-dev/node-api-worker) (Node 22 · Docker Compose · Postgres 17): Multi-service Compose starter pairing a public Express API with a private worker and Postgres FOR UPDATE SKIP LOCKED job queue without Redis.
- [FastAPI + Postgres Background Jobs](https://github.com/gregale-dev/fastapi-postgres-jobs) (Python 3.13 · FastAPI · Postgres 17): FastAPI HTTP API with a durable PostgreSQL job queue, leases, and exponential retries that scales both compute and database to zero when idle.

Browse all starters: https://gregale.dev/templates.md

## Frequently asked questions

### Which webhook providers are supported out of the box?

Inbound webhook endpoints support stripe (verifying Stripe signatures with sealed secrets) and generic HMAC-SHA256 senders using X-Gregale-Event-ID, X-Gregale-Event-Type, X-Gregale-Timestamp, and X-Gregale-Signature headers.

### What happens if my app returns an error when delivering a queued webhook?

Failed deliveries retry according to your plan policy (3, 10, or 25 attempts on Hobby, Pro, and Scale) and land in the app dead-letter queue (gregale dlq list) for inspection and replay.

### Can I share one workflow recovery policy across scheduled and manual runs?

Yes. Stored workflows, delayed tasks, and async invocations expose run history, status insights, and policy-based recovery in both the dashboard and CLI.

Canonical URL: https://gregale.dev/features/durable-webhooks-and-workflows
