Waits and durability
Tappet persists execution state as it goes. This page covers pausing an execution on purpose with a Wait node, and what happens when the process stops unexpectedly.
Wait node
The Wait node pauses an execution and resumes it later. Modes:
| Mode | Resumes when |
|---|---|
| After a time interval | The interval has elapsed (for example 2 hours). |
| At a specified time | The given date-time is reached, in the workflow timezone. |
| On webhook call | An HTTP request arrives at the execution’s resume URL. |
| On form submission | A person submits the form shown at the resume URL. |
While waiting, the execution has status waiting and holds no worker, memory or connection. A
workflow can have thousands of executions waiting at once.
Resume URLs
In webhook and form modes, the resume URL is available as $execution.resumeUrl in nodes before
the Wait node. Send it to whoever needs to continue the process:
Webhook (new expense) -> Slack: "Approve: {{ $execution.resumeUrl }}?approved=true"
-> Wait (on webhook call, limit 3 days)
-> IF ($json.query.approved == 'true') -> ...
Resume URLs have the form <TAPPET_PUBLIC_URL>/webhook-waiting/<token>. The token is random and
unguessable, so treat the URL as a secret. Once the execution has resumed, the URL no longer
resumes anything.
The request that resumes the execution (method, headers, query, body) becomes the Wait node’s
output. You can set a time limit after which the execution resumes (or fails) without a call.
Durability
Waits are stored in the database, not in memory:
- The resume time or resume token is persisted before the execution is released.
- A timer service wakes executions when their time comes. In HA mode one leader process runs the timers, elected with a Postgres advisory lock; if it stops, another process takes over.
- Restarts, upgrades and failovers do not lose waiting executions. An execution whose resume time passed while Tappet was down resumes shortly after startup.
Checkpoints
By default every production execution is checkpointed after each node: the node’s output (item counts and references to stored data) is persisted before its successors are scheduled.
| Policy | Persists | Use when |
|---|---|---|
every_node (default) | After every completed node | You want resumable executions and full run data. |
wait_only | At Wait nodes and at the end | Very high throughput workloads where a crash may re-run whole executions. |
Set the instance default with TAPPET_CHECKPOINT.
Crash recovery
Each running execution is held by a worker under a lease that the worker renews while it runs.
If the process dies (crash, kill -9, node failure), the lease expires and another worker (or the
same one after restart) reclaims the execution:
- The execution resumes from its last checkpoint.
- Nodes that had completed are not run again; their stored output is reused.
- The node that was running when the process died runs again.
This is an at-least-once per node guarantee. In the worst case a node with side effects runs twice. To make that harmless:
- Connectors for APIs that support idempotency keys (Stripe, for example) send a key derived from the execution ID, node name, run index and item index, so the vendor discards the duplicate.
- For your own APIs, pass
{{ $execution.id }}and{{ $runIndex }}in a header or field and deduplicate on the receiving side. - Write to databases with upserts rather than plain inserts where possible.
The lease duration is set with TAPPET_LEASE_TTL (default 60 s): shorter leases recover faster,
longer leases tolerate longer pauses (for example stop-the-world snapshots of a VM).
Webhook ingest and backpressure
Production webhooks in “respond immediately” mode are durable before they are acknowledged:
- The request body is streamed to the blob store when it is larger than 64 KB.
- An execution is enqueued in the database.
- Only then does the caller get its response.
If the process dies after step 3, the execution still runs. If the queue is deeper than
TAPPET_QUEUE_MAX_DEPTH (default 100,000) or the spill budget is exhausted, Tappet answers
503 Service Unavailable with a Retry-After header instead of accepting work it cannot hold.
Most webhook senders retry on 503.
Webhooks that respond with the workflow’s result (“when last node finishes” or a Respond to
Webhook node) hold the connection until the result is ready, up to
TAPPET_SYNC_WEBHOOK_TIMEOUT (default 300 s).
Graceful shutdown
On SIGTERM, Tappet stops accepting new work, lets running executions finish or checkpoint, and
releases their leases, within TAPPET_SHUTDOWN_TIMEOUT. Container orchestrators should allow at
least that long before sending SIGKILL (the Helm chart sets terminationGracePeriodSeconds
accordingly).