Guides

Automatic Journaling


Automatic journaling is the foundation of Orcher's durable execution model. Every step in a workflow is recorded to PostgreSQL, enabling workflows to survive crashes and resume exactly where they left off — without re-executing completed steps.

When a workflow runs, Orcher records every step's result to two storage layers:

  1. Execution Log — A step-level idempotency cache keyed by (workflow_id, step_name). Stores the result, status, and attempt count for each step.
  2. Workflow Execution Journal — An append-only event log ordered by event_id. Records the full history of the workflow execution as a sequence of typed entries.

On replay (after a crash, timeout, or server restart), the SDK receives the journal entries, converts them into cached results, and injects them before the workflow handler runs. Completed steps return their cached result instantly — the original code never re-executes.

Key Benefits

  • Zero Data Loss — All progress is persisted to PostgreSQL
  • No Repeated Steps — Completed tasks return their journaled result instead of re-running on replay; make external calls idempotent, since a task retried before it records its result can run again
  • Crash Recovery — Workflows resume from the last checkpoint

Explore Journaling