arvo-event-handler
    Preparing search index...

    Interface IArvoEventHandler

    Interface for Arvo event handlers.

    Defines the contract for all event handlers in the Arvo system, including orchestrators, resumable handlers, and custom handlers. Each handler must implement event execution logic and provide system error schema configuration.

    interface IArvoEventHandler {
        source: string;
        systemErrorSchema: ArvoContractRecord;
        execute(
            event: ArvoEvent,
            opentelemetry?: ArvoEventHandlerOpenTelemetryOptions,
        ): Promise<
            {
                events: ArvoEvent<
                    Record<string, any>,
                    Record<string, string | number | boolean | null>,
                    string,
                >[];
            },
        >;
    }

    Implemented by

    Index

    Properties

    Methods

    Properties

    source: string

    Unique identifier for the event handler's source system. Used for event routing and tracing throughout the system.

    systemErrorSchema: ArvoContractRecord

    Schema configuration for system error events.

    Defines the structure and routing for error events emitted when unexpected errors occur during event handling. System errors are sent to the workflow initiator to signal terminal failures that cannot be automatically recovered.

    Methods

    • Executes the event handling logic for an incoming Arvo event.

      Processes the event according to the handler's business logic and returns resulting events to be emitted. The handler may emit multiple events as outcomes of processing a single input event.

      For violation errors (transaction, execution, contract, config), implementations typically throw the error to enable retry mechanisms. For non-violation errors, implementations typically emit system error events to the workflow initiator.

      Parameters

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

      Promise resolving to an object containing emitted events

      When retriable errors occur (lock failures, validation errors, etc.)