npm.io
2.22.7 • Published 4d ago

@medusajs/orchestration

Licence
MIT
Version
2.22.7
Deps
3
Size
310 kB
Vulns
0
Weekly
0
Stars
36.8K

Medusa logo

@medusajs/orchestration

Documentation | Website

Building blocks for digital commerce

Medusa is released under the MIT license. PRs welcome! Discord Chat Follow @medusajs

Low-level transaction orchestration for Medusa: the engine that executes workflow steps, tracks their state, and runs compensation when a step fails. It powers the Workflows SDK and the Workflow Engine modules; to build workflows, use @medusajs/framework/workflows-sdk instead. When you need its classes or types directly, such as when building a custom workflow engine, import them from @medusajs/framework/orchestration, which re-exports this package; importing @medusajs/orchestration directly is discouraged.

At a glance

Package @medusajs/orchestration
Type Core library
Import from @medusajs/framework/orchestration

Features

  • TransactionOrchestrator and DistributedTransaction to run a flow of steps and track its state.
  • LocalWorkflow, GlobalWorkflow, and WorkflowManager to register and run workflow definitions.
  • DistributedTransactionStorage and DistributedSchedulerStorage abstract classes that workflow engines implement to persist executions and scheduled workflows.
  • Step error classes, such as PermanentStepFailureError and SkipStepResponse, and state enums, such as TransactionState.

Installation

No separate installation is needed in a Medusa application. It's installed with @medusajs/framework.

Resources