arvo-event-handler
    Preparing search index...

    Class ArvoOrchestrator

    Orchestrates state machine execution and lifecycle management.

    Coordinates machine resolution, state persistence, event processing, and error handling for Arvo's event-driven orchestration workflows. Manages the complete lifecycle from event receipt through machine execution to emitting result events.

    Implements

    Index

    Constructors

    Properties

    defaultEventEmissionDomains: Required<
        NonNullable<ArvoOrchestratorParam["defaultEventEmissionDomains"]>,
    >

    Domains for routing events

    executionEngine: IMachineExectionEngine

    Engine responsible for executing state machine logic

    executionunits: number

    Computational cost metric associated with event handling operations

    Registry containing available state machines

    OpenTelemetry span configuration for observability

    syncEventResource: SyncEventResource<MachineMemoryRecord>

    Resource manager for state synchronization and memory access

    Accessors

    • get requiresResourceLocking(): boolean

      Whether this orchestrator requires resource locking for concurrent safety

      Returns boolean

    • get systemErrorSchema(): {
          schema: ZodObject<
              {
                  errorMessage: ZodString;
                  errorName: ZodString;
                  errorStack: ZodNullable<ZodString>;
              },
              "strip",
              ZodTypeAny,
              { errorMessage: string; errorName: string; errorStack: string
              | null },
              { errorMessage: string; errorName: string; errorStack: string | null },
          >;
          type: any;
      }

      Provides access to the system error event schema configuration.

      Returns {
          schema: ZodObject<
              {
                  errorMessage: ZodString;
                  errorName: ZodString;
                  errorStack: ZodNullable<ZodString>;
              },
              "strip",
              ZodTypeAny,
              { errorMessage: string; errorName: string; errorStack: string
              | null },
              { errorMessage: string; errorName: string; errorStack: string | null },
          >;
          type: any;
      }

    Methods

    • Executes state machine orchestration for an incoming event.

      Performs the complete orchestration workflow: resolves the appropriate machine, validates input, executes the machine logic, processes emitted events, and persists the new state. Handles both new orchestrations and continuation of existing ones.

      For violation errors (transaction, execution, contract, config), the error is thrown to enable retry mechanisms. For non-violation errors, system error events are emitted to the workflow initiator, and the orchestration enters a terminal failure state.

      Parameters

      Returns Promise<
          {
              events: ArvoEvent<
                  Record<string, any>,
                  Record<string, string | number | boolean | null>,
                  string,
              >[];
          },
      >

      Object containing emitted events from the orchestration or system errors

      When lock acquisition or state operations fail (retriable)

      When event data doesn't match contract schema (retriable)

      When machine resolution fails or version is missing (retriable)

      When workflow execution encounters critical errors defined by the handler developer