Deadwire
Failure intelligence and recovery control for durable workflows.
Why Deadwire ·
Quick start ·
Upstash integration ·
Recovery protocol ·
Security ·
Release materials
Upstash keeps workflows durable. Deadwire determines whether recovering them is safe.
Deadwire is an Upstash-first recovery-intelligence control plane. It sits above Upstash Workflow and QStash; it does not replace their execution model. Deadwire groups DLQ entries into operational incidents, assembles provenance and side-effect evidence, analyzes workflow-version compatibility, runs verifier-backed simulation, and gates recovery behind policy, approvals, flow control, canaries, and receipts.
The Upstash mark above is served from Upstash’s official domain and is used only to identify the supported integration. Deadwire is independent software and is not affiliated with, sponsored by, or endorsed by Upstash.
Table of contents
Why Deadwire
Retries solve transient faults. DLQs preserve failed work. Neither tells an operator whether retrying an execution after a deploy, an API contract change, or an uncertain payment side effect is actually correct.
Consider a checkout workflow with 8,147 failed executions. A deploy changes an external provider integration from payments-api/v2 to payments-api/v3; the response schema now differs. The operator has a bulk-resume button, but not the answers that matter:
- Are the 8,147 failures one incident or several independent problems?
- Which deployment and dependency boundary are shared?
- Would resume fail again under current code?
- Did an earlier attempt charge the customer, send the email, invoke the webhook, or provision infrastructure?
- Did any completed workflow step change before the failed boundary?
- Can recovery start with a low-risk canary rather than a full-scale replay?
Deadwire turns that ambiguity into an explicit, auditable decision.
incident: DW-193
affected_executions: 8147
common_failure_boundary: checkout.finalize → payments-api/v3
probable_change: payment provider response schema
recovery:
safe_resume: 6921
safe_restart: 811
manual_review: 304
external_side_effect_unknown: 111
The point is not a prettier DLQ. The point is recovery correctness.
Product capabilities
| Capability |
What Deadwire does |
Why it matters for Upstash workflows |
| Incident clustering |
Converts normalized DLQ failures into deterministic incident groups and shared dependency boundaries |
Thousands of retries become one operator-sized incident |
| Evidence graph |
Captures workflow provenance, source hashes, completed steps, sanitized shapes, trace identifiers, and side-effect metadata |
Recovery decisions have supporting facts rather than intuition |
| Replay-risk analysis |
Separates SAFE, UNSAFE, and UNKNOWN retry evidence |
Unknown effects cannot silently become duplicate payments or messages |
| Workflow compatibility |
Detects candidate code changes before completed workflow boundaries |
Protects persisted workflow state when code changes between failure and resume |
| Side-effect verification |
Supports payment, delivery, outbox, object-output, and HTTP-contract verifier adapters |
A replay can be proven or blocked per external boundary |
| Recovery policy |
Enforces required roles, independent approvals, batch ceilings, and canary policy |
Operational safety scales beyond a single person clicking resume |
| QStash recovery control |
Builds exact resume previews with retries and flow-control headers |
Uses Upstash control primitives rather than inventing a parallel runner |
| Recovery receipts |
Records approved recovery intent and maps original DLQ IDs to resumed workflow runs |
Provides a durable audit trail and reconciliation basis |
| Deployment intelligence |
Correlates GitHub/Vercel/CI deployment signals with failed runs |
Makes code-diff causality visible at the recovery boundary |
| Agent forensics |
Detects low-progress loops and estimates wasted model calls |
Extends recovery correctness to durable autonomous systems |
| Product demo |
Includes a static GitHub Pages site and deterministic CLI walkthrough |
Makes the product legible in a buyer, partner, or internal review |
Architecture
┌──────────────────────────────────────────────────────────────────┐
│ Customer application │
│ Upstash Workflow · QStash · Workflow Agents · external services │
└─────────────┬───────────────────────────────────────┬────────────┘
│ │
Deadwire SDK bridge failure callback / DLQ
│ │
└───────────────┬───────────────────────┘
▼
HMAC-signed evidence ingestion
│
▼
evidence graph → incident clustering → deployment / trace correlation
│
▼
compatibility gate + side-effect verifiers + simulation
│
▼
receipt → independent approval → 1% canary → observe → ramp → reconcile
│
▼
QStash resume with required flow-control configuration
Design boundaries
Deadwire is deliberately constrained in several important ways:
- Upstash remains execution authority. Workflow state, retries, DLQ retention, and resume are owned by Upstash.
- Deadwire is decision authority. Evidence, compatibility assessment, policy checks, receipts, and recovery state are owned by Deadwire.
- Ambiguity fails closed. If side effects, deployment provenance, or workflow compatibility cannot be established, automated recovery is withheld.
- No browser secrets. Upstash tokens, verifier credentials, and HMAC secrets belong only in trusted server-side workers.
- No raw sensitive evidence by default. Workflow evidence contains hashes and structural fingerprints, not payment IDs, customer records, raw payloads, or provider secrets.
Animated product walkthrough
The animated walkthrough is a compact visual presentation built for technical demos, acquisition conversations, and GitHub Pages. It shows the four product moments that distinguish Deadwire from a DLQ interface:
- individual failed runs accumulate without an operational answer;
- Deadwire clusters them into one shared deployment/dependency incident;
- side-effect evidence blocks an unsafe payment replay; and
- a verified fix proceeds through receipt, canary, observation, controlled ramp, and reconciliation.
Open the full-screen presentation to replay it, or press R inside the presentation to restart the animation. It uses fixture data only and does not depict a live customer incident.
Quick start
Requirements
- Node.js 20 or later
- npm
- No Upstash account is required for fixture-mode evaluation
Install and verify
npm install
npm run typecheck
npm test
The suite exercises incident clustering, retry safety, simulation gates, evidence signing, canary halting, deployment compatibility, trace correlation, agent loops, side-effect verification, Upstash DLQ normalization, and configuration diagnostics.
Start the local dashboard
npm run dev
Open http://127.0.0.1:8787. The dashboard is explicitly fixture-seeded. It does not present fixture data as a connected Upstash account.
Run the buyer demo
npm run demo
The command prints a compact incident summary, blast radius, recovery classifications, policy guardrails, and a deterministic decision ID.
Upstash integration
Deadwire integrates through documented, owned application boundaries. It does not monkey-patch Upstash SDK internals or impersonate an Upstash control plane.
1. Instrument owned workflow boundaries
Use UpstashEvidenceBridge next to callbacks you own. The bridge records source hash, ordering, completion state, declared side-effect type, idempotency-key hash, provider-transaction hash, and sanitized request/response shape hashes.
import { HmacEvidenceEmitter, UpstashEvidenceBridge } from "deadwire";
const bridge = new UpstashEvidenceBridge(
"tenant_acme",
context.workflowRunId,
{
workflow: "checkout",
workflowVersion: "v18",
deploymentSha: process.env.GIT_SHA!,
environment: "production",
},
new HmacEvidenceEmitter(
process.env.DEADWIRE_EVIDENCE_URL!,
process.env.DEADWIRE_INGEST_SECRET!,
),
);
await bridge.run(
"charge-customer",
chargeCustomer,
() => context.run("charge-customer", chargeCustomer),
{
sideEffect: "payment",
idempotencyKey,
providerTransactionId,
request: { customerId, amount },
},
);
await bridge.flush();
The bridge intentionally keeps context.run in your control. It records evidence around your callback; it does not alter retry semantics or make a payment safe merely because it was observed.
See the complete illustrative route.
2. Import and enrich DLQ evidence
UpstashWorkflowAdapter supports paginated DLQ reads, individual DLQ-message reads, normalized failures, and resume previews. A trusted worker supplies an account-scoped QStash token only at runtime.
const adapter = new UpstashWorkflowAdapter({
token: process.env.UPSTASH_QSTASH_TOKEN!,
});
const page = await adapter.listDlq();
const normalized = page.messages.map(normalizeUpstashDlq);
Normalization is deliberately conservative. Missing fields become unknown evidence, which pushes recovery toward manual review rather than an optimistic automatic classification.
3. Diagnose production configuration
npm run cli -- doctor
The diagnostic checks for a trusted QStash token, HMAC evidence secret, deployment SHA provenance, and production persistence. A missing evidence HMAC secret is a hard failure; missing optional integrations are warnings.
4. Prepare—not blindly execute—recovery
const preview = adapter.previewResume(dlqIds, {
key: "incident-DW-193",
parallelism: 5,
rate: 1,
period: "1s",
retries: 3,
});
The preview is not a mutation. An approved RecoveryReceipt, a recovery batch in the correct state, and a trusted control worker are required before the real QStash resume client can act.
For product-level integration detail, see Upstash integration blueprint.
Evidence model
WorkflowEvidence is the minimum trustworthy unit Deadwire needs to reason about recovery:
interface WorkflowEvidence {
tenantId: string;
runId: string;
provenance: {
workflow: string;
workflowVersion: string;
deploymentSha: string;
environment: string;
sourceCommit?: string;
traceId?: string;
spanId?: string;
};
steps: Array<{
step: string;
stepHash: string;
ordinal: number;
completed: boolean;
sideEffect: "payment" | "email" | "webhook" | "database-write" | "provisioning" | "object-write" | "none";
idempotencyKeyHash?: string;
providerTransactionIdHash?: string;
requestShapeHash?: string;
responseShapeHash?: string;
}>;
emittedAt: string;
}
Evidence handling rules
- Hash idempotency keys and provider transaction references before sending them to Deadwire.
- Emit payload shape fingerprints instead of raw request/response bodies where possible.
- Sanitize captured replay fixtures before any simulation.
- Scope evidence to a tenant and enforce tenant isolation in production persistence.