Documentation

Durable Jobs overview

Durable Jobs is the reliable execution engine for backend work on StackShift. Deploy the app. Offload the work.

Search Docs

Durable Jobs

Durable Jobs overview

Live

Durable Jobs is the reliable execution engine for backend work on StackShift. Deploy the app. Offload the work.

Goal

Understand when to move backend work into Durable Jobs and what StackShift guarantees after a job starts.

Current status

Live

This area is documented as current, user-reliable behavior.

Workflow

  1. 1Define a job handler in code.
  2. 2Start the work once with an idempotency key.
  3. 3Break longer work into steps so completed work is remembered.
  4. 4Pause for external events when the flow needs user, webhook, or payment confirmation.
  5. 5Use the run timeline, logs, attempts, and status to inspect what happened.

What Durable Jobs is

StackShift Durable Jobs is a reliable execution engine for backend work. It runs jobs outside the request path and keeps enough durable state to retry, resume, and finish safely.

Use it for work that should not disappear when a request times out, a process restarts, or an external system is slow.

Start the work once. StackShift makes sure it completes safely.

Short example

Start a job from an API route, webhook, or backend service. StackShift stores the run and invokes your handler.

Start a job

import { StackShift } from '@stackshift-cloud/jobs'

const stackshift = new StackShift({
  apiKey: process.env.STACKSHIFT_API_KEY!,
})

await stackshift.start('send-verification-email',
  { userId: 'user_123', email: 'ada@example.com' },
  {
    queueName: 'emails',
    idempotencyKey: 'verify:user_123',
    idempotencyTtl: '30d',
  }
)

Mental model

  • Jobs execute work.
  • Steps break work into durable units.
  • State remembers progress across retries and resumes.
  • Events let a job pause without running compute, then resume when the right signal arrives.
  • Idempotency keys make duplicate starts safe.

Expected result

You can explain Durable Jobs as one product concept: jobs execute work, steps divide it, state remembers progress, and events resume paused runs.