Type Alias MachineMemoryRecord

MachineMemoryRecord: {
    events: {
        consumed: InferArvoEvent<ArvoEvent> | null;
        produced: InferArvoEvent<ArvoEvent>[];
    };
    initEventId: string;
    machineDefinition: string | null;
    parentSubject: string | null;
    state: Snapshot<any>;
    status: string;
    subject: string;
    value: string | Record<string, any> | null;
}

Represents the state record stored in machine memory.

Type declaration

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

      The event consumed by the machine in the last session

    • produced: InferArvoEvent<ArvoEvent>[]

      The events produced by the machine in the last session

  • initEventId: string

    The unique identifier of the event that originally initiated this entire orchestration workflow. This serves as the root identifier for tracking the complete execution chain from start to finish.

    • For new orchestrations: set to the current event's ID
    • For resumed orchestrations: retrieved from the stored state
    • Used as the parentid for completion events to create a direct lineage back to the workflow's origin

    This enables tracing the entire execution path and ensures completion events reference the original triggering event rather than just the immediate previous step.

  • machineDefinition: string | null

    Machine definition string

  • parentSubject: string | null

    Reference to the parent orchestration's subject when orchestrations are nested or chained. This enables hierarchical orchestration patterns where one orchestration can spawn sub-orchestrations. When the current orchestration completes, its completion event is routed back to this parent subject rather than staying within the current context.

    • For root orchestrations: null
    • For nested orchestrations: contains the subject of the parent orchestration
    • Extracted from the parentSubject$$ field in initialization events
  • state: Snapshot<any>

    XState snapshot representing the machine's current state

  • status: string

    Current execution status of the machine. The status field represents the current state of the machine's lifecycle. While commonly used values are:

    • 'active': Machine is currently executing
    • 'done': Machine has completed its execution successfully
    • 'error': Machine encountered an error during execution
    • 'stopped': Machine execution was explicitly stopped

    Due to XState dependency, the status can be any string value defined in the state machine definition. This allows for custom states specific to the business logic implemented in the state machine.

  • subject: string

    Unique identifier for the machine instance

  • value: string | Record<string, any> | null

    Current value stored in the machine state