Creates a new ArvoMachine instance.
A unique identifier for the machine. This ID must be unique within the scope of an orchestrator and is used for routing and logging.
The semantic version of the machine. Must follow semver format and match the version specified in the contract.
Configuration object containing contract definitions
The contract defining this machine's interface and capabilities
Record of contracts for services this machine can interact with
The XState actor logic that defines the machine's behavior, including states, transitions, and actions.
Optional
requiresResourceLocking: boolean = trueOptional flag indicating if the machine needs distributed locks. False when machine has no parallel states and executes sequentially. Defaults to true.
Readonly
contractsConfiguration object containing contract definitions
Readonly
idA unique identifier for the machine. This ID must be unique within the scope of an orchestrator and is used for routing and logging.
Readonly
logicThe XState actor logic that defines the machine's behavior, including states, transitions, and actions.
Readonly
requiresOptional flag indicating if the machine needs distributed locks. False when machine has no parallel states and executes sequentially. Defaults to true.
Readonly
versionThe semantic version of the machine. Must follow semver format and match the version specified in the contract.
Gets the event type that this machine accepts, as defined in its contract.
Validates an event against the machine's contracts and data schemas. Performs validation for both self-contract events and service contract events.
The event to validate
A validation result object:
Represents an ArvoMachine object that can be consumed by an Arvo orchestrator. ArvoMachine encapsulates the logic and metadata required for an Arvo-compatible state machine. It combines XState's actor logic with Arvo-specific contracts and versioning information.
Remarks
It is strongly recommended to use
setupArvoMachine(...).createMachine(...)
instead of creating this object directly. The setup function provides additional type safety and validation that helps prevent runtime errors.