Exports durable workflow execution data in two formats:

Returns a DurableJobExport with five sections:

  • data — workflow input arguments (what was passed to workflow.start())
  • state — current workflow state: done flag, response, $error, timestamps (jc/ju)
  • status — HotMesh semaphore (0 = complete, > 0 = activities pending, < 0 = failed)
  • timeline — ordered list of idempotent operations: proxy activities, child workflows, sleeps, signals, and collated (Promise.all) results with per-entry timing and output
  • transitions — activity execution log with created/updated timestamps per dimension

Use allow/block options to limit which sections are returned (e.g., omit transitions to reduce payload size). Use values: false to strip result payloads from timeline entries.

Returns a WorkflowExecution — a Temporal-style event history with typed events (activity_task_scheduled, timer_fired, workflow_execution_signaled, etc.), chronological ordering, back-references between scheduled/completed pairs, and a summary with activity/child/timer/signal counts.

Supports sparse mode (default, no extra I/O) and verbose mode (recursively fetches child workflow histories up to max_depth). Use enrich_inputs to attach activity and child workflow input arguments to events.

Constructors

Properties

appId: string
logger: ILogger
symbols: Symbols | Promise<Symbols>

Methods

  • Export the raw workflow job as a structured DurableJobExport.

    The result contains five sections (filterable via options.allow / options.block):

    Section Contents
    data Workflow input arguments passed to workflow.start()
    state Current state: done, response, $error, timestamps
    status Semaphore value: 0 = idle, > 0 = pending, < 0 = error
    timeline Ordered idempotent markers: activities, children, sleeps, signals
    transitions Per-activity execution timestamps by dimension

    Parameters

    • jobId: string

      the workflow ID to export

    • options: ExportOptions = {}

      controls which sections to include and whether to include values

    Returns Promise<DurableJobExport>

    the exported workflow data

    // Full export
    const full = await handle.export();

    // Timeline only, without result payloads (smaller response)
    const slim = await handle.export({ allow: ['timeline'], values: false });
  • Export a workflow execution as a structured event history (WorkflowExecution).

    Returns a Temporal-style event list with typed events, chronological ordering, back-references (e.g., scheduled_event_id on completed activities), and a WorkflowExecutionSummary with counts by category.

    Event types produced:

    • workflow_execution_started / completed / failed — lifecycle bookends
    • activity_task_scheduled / completed / failed — proxy activity calls
    • child_workflow_execution_started / completed / failed — child workflows
    • timer_started / timer_firedworkflow.sleep() calls
    • workflow_execution_signaledworkflow.condition() signals received

    Modes:

    • sparse (default) — transforms the workflow's timeline markers into events. No extra database queries beyond the initial job export.
    • verbose — recursively fetches child workflow jobs and attaches their full event histories as nested children (up to max_depth, default 5).

    Options:

    • exclude_system — omit internal/interceptor activities (names starting with lt)
    • omit_results — strip result and input payloads from event attributes
    • enrich_inputs — attach activity/child workflow input arguments to events
    • allow_direct_query — fallback to raw DB queries for expired/pruned jobs

    Parameters

    • jobId: string

      the workflow ID

    • workflowTopic: string

      the task queue topic (used as workflow_type)

    • options: ExecutionExportOptions = {}

      controls mode, filtering, and enrichment

    Returns Promise<WorkflowExecution>

    // Sparse export with system activities filtered out
    const exec = await handle.exportExecution({ exclude_system: true });
    console.log(exec.summary.activities.user); // user activity count

    // Verbose export with full child workflow trees
    const deep = await handle.exportExecution({ mode: 'verbose', max_depth: 3 });
    console.log(deep.children); // nested WorkflowExecution[]
  • Inflate a raw Redis/Postgres job hash into a structured DurableJobExport.

    HotMesh stores workflow state as a flat hash with 3-character symbolized keys (e.g., aBC,0,0worker/output/data). This method decodes each entry and sorts it into one of four buckets:

    • Transitions (aBC,0,0 pattern) — activity start/stop timestamps by dimension
    • Data (_-prefixed keys) — workflow input arguments
    • Timeline (--prefixed keys) — idempotent operation markers (proxy, child, sleep, etc.)
    • State (3-char keys) — workflow metadata (done flag, response, error, timestamps)

    Use options.allow / options.block to limit which sections appear in the result.

    Parameters

    Returns DurableJobExport

    structured export with data, state, status, timeline, and transitions

  • marker names are overloaded with details like sequence, type, etc

    Parameters

    • key: string

    Returns {
        dimension?: string;
        index: number;
        secondary?: number;
    }

    • Optionaldimension?: string
    • index: number
    • Optionalsecondary?: number
  • Parameters

    • raw: string
    • withValues: boolean

    Returns string | number | Record<string, any>