ReadonlycontractsContract definitions for the resumable's event interface. Defines accepted events, emitted events, and service integrations.
Self contract defining initialization input and completion output structures.
Service contracts defining external service interfaces.
ReadonlydefaultOptional domains for routing events
ReadonlyexecutionunitsComputational cost metric for workflow operations
ReadonlyhandlerVersioned handler map for processing workflow events.
ReadonlysourceSource identifier from the first registered machine
ReadonlyspanOpenTelemetry span configuration for observability
ReadonlysyncResource manager for state synchronization and memory access
The contract-defined domain for the handler
Memory interface for state persistence and retrieval
Whether this resumable requires resource locking for concurrent safety
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.
Executes the workflow handler for an incoming event.
Processes initialization events or service responses through the versioned handler, manages state persistence, tracks expected events, and generates output events. Workflows in 'done' status ignore subsequent events without processing.
For violation errors (transaction, config, contract), the error is thrown to enable retry mechanisms. For non-violation errors, system error events are emitted to the workflow initiator, and the workflow enters a terminal failure state.
The incoming event triggering handler execution
Optionalopentelemetry: ArvoEventHandlerOpenTelemetryOptionsOptional OpenTelemetry configuration for tracing
Object containing emitted events from the handler or system errors
ProtectedvalidateValidates incoming event against self or service contracts.
Resolves the appropriate contract (self for initialization, service for responses), validates schema compatibility, and ensures event data matches contract requirements.
See validateInputEvent for more infromation
Optionalspan: Span
ArvoResumable complements ArvoOrchestrator by providing imperative handler functions for orchestration logic instead of declarative state machines. While ArvoOrchestrator excels at complex static workflows with deterministic branching, ArvoResumable handles dynamic orchestrations where branching logic depends on runtime context and event data.
Use this for dynamic orchestrations with context-dependent branching or when preferring imperative programming patterns over state machines.