Verity
/Docs

Verity Documentation

Verity guarantees that external side effects — payments, refunds, infrastructure provisioning, emails — execute exactly once, even when your workflow engine or retry logic re-runs your code. Works with Temporal, Trigger.dev, Inngest, or standalone.

New to Verity? Start with the Quickstart to protect your first action in under 5 minutes.

Why Verity?

Temporal, Trigger.dev, and Inngest retry your activity when it fails. But if that activity already called Stripe before the crash, the retry calls Stripe again. The workflow engine has no way to know the external call already succeeded — so it re-executes it.

The Problem

Your Temporal activity calls Stripe, then the worker crashes:

// Temporal activity
async function processPayment() {
  const charge = await stripe.charges.create({ ... });  // ✓ Succeeds
  // [CRASH HERE]
  return charge;  // Never reached
}

What happens:

  1. Stripe charge succeeds
  2. Worker crashes before returning
  3. Temporal doesn't know it succeeded
  4. Temporal retries the activity
  5. Stripe gets called again → double charge

With Verity

async function processPayment() {
  return await verity.protect('charge-order-123', {
    observe: () => stripe.charges.list({ metadata: { orderId } }),
    act: () => stripe.charges.create({ amount: 5000 }),
  });
}

What happens:

  1. Stripe charge succeeds
  2. Worker crashes
  3. Temporal retries the activity
  4. Verity checks Stripe first (observe)
  5. Finds existing charge → returns it without calling Stripe again
Temporal handles when to retry. Verity handles making each external call safe to retry. Use both.

Not Using a Workflow Engine?

Verity works just as well standalone. Any time your code performs a real-world action that can't be undone — payments, emails, infrastructure provisioning — wrap it in verity.protect() and get exactly-once guarantees, crash recovery, and a complete audit trail.

  • Double charges — an agent retries a payment after a timeout, charging the customer twice
  • Ghost infrastructure — a VM gets provisioned but the commit crashes, leaving zombie resources
  • Duplicate notifications — five identical emails sent because the worker restarted mid-batch
  • Zero audit trail — when something goes wrong, there's no way to know what actually happened

Verity solves this with a simple protocol: Lease → Observe → Act → Commit. Every action is fenced, tracked, and safe to retry — even across crashes, concurrent agents, and network failures.

How It Works

Verity wraps your side effects in a protection protocol:

  1. Lease — acquire exclusive ownership of an action using a unique key
  2. Observe — if a prior attempt crashed, check the external system to see if the action already completed
  3. Act — execute the real-world action (charge, email, provision, etc.)
  4. Commit — record the result in Verity's ledger, making the action permanent and idempotent

All of this is handled by a single SDK call: verity.protect(). You provide the action and (optionally) an observe function. Verity handles leasing, fencing, retry coordination, and audit logging.

SDKs

Verity provides official SDKs for TypeScript and Python with identical behavior:

Key Features

FeatureDescription
Exactly-once executionFence tokens prevent duplicate actions, even across retries and concurrent agents
Crash recoveryIf an agent crashes mid-action, the next attempt checks what actually happened before acting
Audit trailEvery lease, observe, act, and commit is logged with timestamps, fence tokens, and agent IDs
Workflow orchestrationGroup multiple effects into named workflows with case and run tracking
Explorer UIVisual dashboard to observe effects, trace failures, and manage workflows in real-time
Cross-system safetyWorks across any external system — Stripe, AWS, email providers, databases, and more

Architecture

Your Agent / Worker


  ┌──────────┐
  │ Verity   │  ← SDK (TypeScript / Python)
  │ SDK      │
  └────┬─────┘
       │  HTTPS

  ┌──────────┐
  │ Verity   │  ← REST API (lease, commit, fail, renew)
  │ API      │
  └────┬─────┘
       │  SQL (RLS)

  ┌──────────┐
  │ Postgres │  ← Effect ledger + audit log
  │ (RLS)    │
  └──────────┘

Verity sits on the critical path — between your agent and the external world — and that's exactly where reliability belongs.

What's Next?

  • Quickstart — protect your first action in 5 minutes
  • Core Concepts — understand effects, leases, and fence tokens
  • Workflows — orchestrate multi-effect business processes
  • Error Handling — understand every error the SDK can throw
  • Explorer UI — observe and manage your effects in real-time