The unique identifier for the orchestration actor.
The current state of the machine.
The snapshot of the machine, providing a detailed view of its current state.
Optional
data?: Record<string, any>An object containing the type of the event, and optionally, additional data. The type ideally must be the topic of the event e.g. cmd.books.fetch, evt.books.fetch.success, notif.orch.done
// Example middleware function for handling orchestration based on state and snapshot.
const onOrchestrationState: OnOrchestrationState = (id, state, snapshot) => {
return {
type: 'evt.books.fetch.success',
data: { orchestrationId: id, status: 'completed', snapshot },
};
};
Generated using TypeDoc
Middleware function type for handling orchestration logic based on state and snapshot data. This function takes the current state and a machine snapshot, and returns data to create a CloudEvent representing the necessary actions or information for cloud-based orchestration.