Durably execute workflows in Convex

workflowskillsetup L40
get-convex/workflow
What it does

Durably execute long-lived workflows with pause/resume semantics

Best for

Building multi-step, asynchronous operations (onboarding, order fulfillment, polling) that can survive server restarts without consuming resources during wait periods.

Inputs
  • · Workflow handler function with step definitions
  • · Workflow arguments (type-safe)
Outputs
  • · Workflow completion result
  • · Step execution history
  • · Live reactive status query results
Requires
  • · Convex backend (database, queries, mutations, actions)
  • · @convex-dev/workflow package
  • · Workpool (parallelism control)
Preconditions
  • · Convex project initialized with workflow component installed
  • · Workflow handler defined with step.runQuery/runMutation/runAction/sleep/awaitEvent calls
Failure modes
  • · Step fails and no retry policy configured
  • · Non-deterministic code in handler (console.log patched, fetch blocked)
  • · Workflow exceeds resource limits during long sleep
  • · Event never arrives (awaitEvent blocks indefinitely)
Trust signals
  • · Determinism constraints documented (Date, crypto, fetch patched/blocked)
  • · Exactly-once mutation execution guarantee stated
  • · Step output carries through local variables and loops