Type Alias ArvoResumableState<T>

ArvoResumableState<T>: OrchestrationExecutionMemoryRecord<{
    events: {
        consumed: InferArvoEvent<ArvoEvent> | null;
        expected: Record<string, InferArvoEvent<ArvoEvent>[]> | null;
        produced: InferArvoEvent<ArvoEvent>[];
    };
    initEventId: string;
    parentSubject: string | null;
    state$$: T | null;
    status: "active" | "done";
    subject: string;
}>

State structure persisted in memory for ArvoResumable workflows.

Extends base orchestration state with resumable-specific fields including event collection, workflow status tracking, and custom state management.

Type Parameters

  • T extends Record<string, any>

Type declaration

  • events: {
        consumed: InferArvoEvent<ArvoEvent> | null;
        expected: Record<string, InferArvoEvent<ArvoEvent>[]> | null;
        produced: InferArvoEvent<ArvoEvent>[];
    }

    Event history for the current invocation. Transient collection tracking events consumed, produced, and expected.

    • consumed: InferArvoEvent<ArvoEvent> | null

      Event consumed in the last handler invocation

    • expected: Record<string, InferArvoEvent<ArvoEvent>[]> | null

      Service response events awaiting collection.

      Keyed by the emitted event's ID (parent ID of responses). Responses are collected when their parentid matches a produced event's id. Collected events are passed to the handler via collectedEvents parameter.

    • produced: InferArvoEvent<ArvoEvent>[]

      Events produced (with domain resolution) in the last invocation

  • initEventId: string

    ID of the event that initiated this workflow.

    Root identifier for tracing the complete execution chain. Used as parentid for completion events to maintain lineage.

    • New workflows: current event's ID
    • Resumed workflows: retrieved from stored state
  • parentSubject: string | null

    Parent orchestration subject for nested workflows.

    Enables hierarchical orchestration where one workflow spawns sub-workflows. Completion events route back to this parent subject.

    • Root workflows: null
    • Nested workflows: parent's subject identifier
    • Source: parentSubject$$ in initialization events
  • state$$: T | null

    Custom workflow state managed by the handler. Accessible via the context parameter in handlers and persisted between invocations.

  • status: "active" | "done"

    Current workflow status.

    Determines whether the workflow can process additional events:

    • 'active': Workflow is running and accepts new events for processing
    • 'done': Workflow has completed (handler returned output). No further events are processed.
  • subject: string

    Unique identifier for the workflow instance. Serves as the key for state persistence in the memory store.