Optional
context?: ((params) => TContext)Initial context or a function to generate context based on input. Represents the initial data or state of the orchestration machine. It can be a static object or a function that dynamically generates the initial context based on the input parameters.
Initial context or a function to generate context based on input. Represents the initial data or state of the orchestration machine. It can be a static object or a function that dynamically generates the initial context based on the input parameters.
Optional
description?: stringThe description of the machine
Optional
executionThe execution units which are assigned to this machine. This is the execution cost of the logic executed by the orchestration machine
The unique identifier for the orchestration machine. Used to distinguish between different machines.
Optional
initial?: stringInitial state if the state type is not 'parallel'. Specifies the initial state that the orchestration machine enters when it is first instantiated. Required if the machine is not of type 'parallel'.
The states of the orchestration machine, defining its behavior and structure.
A dictionary where keys are state names and values are configurations for each state.
Each state configuration is of type OrchestrationStateConfig
.
Optional
type?: Exclude<OrchestrationStateType, "final">Type of the state machine, can be 'parallel'. If not specified it will be synchronous For 'parallel' type, multiple states run together simultaneously.
// Example orchestration machine configuration:
const machineConfig: OrchestrationMachineConfig<MyContext> = {
id: 'myOrchestrationMachine',
context: { initialData: 'default' },
initial: 'initialState',
states: {
initialState: { emit: 'startOrchestration' },
subState1: { type: 'final', emit: 'finalizeState1' },
subState2: { initial: 'nestedInitialState', entry: 'initializeNestedState', states: { nestedInitialState: { ... } } },
},
};
Generated using TypeDoc
Configuration for an orchestration machine. This defines the machine. It is a subset of xstate machines XState Documentation.