# @medusajs/orchestration

> Medusa utilities to orchestrate modules

Latest version **2.22.7** (published 2026-11-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @medusajs/orchestration
pnpm add @medusajs/orchestration
yarn add @medusajs/orchestration
bun add @medusajs/orchestration
```

## Health

**Score 80/100 (A)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score; popular repo.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.22.7 |
| Published | 2026-11-13 |
| First published | 2023-06-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22.22.0 |
| Dependencies | 3 |
| Unpacked size | 310.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 36796 |
| Author | Medusa |
| Maintainers | sebrindom, nicolas-gorga, sradevski, olijuhl, shahednasser |

## Links

- npm: https://www.npmjs.com/package/@medusajs/orchestration
- Repository: https://github.com/medusajs/medusa
- Homepage: https://github.com/medusajs/medusa#readme
- Issues: https://github.com/medusajs/medusa/issues
- npm.io page: https://npm.io/package/@medusajs/orchestration

## Dependencies (3)

- [ulid](https://npm.io/package/ulid.md) ^3.0.2
- [@medusajs/deps](https://npm.io/package/@medusajs/deps.md) 2.22.7
- [@medusajs/utils](https://npm.io/package/@medusajs/utils.md) 2.22.7

## Recent versions

- 2.22.7 (latest) — 2026-11-13
- 2.22.8-preview-20261117142131 (preview) — 2026-11-17
- 2.22.7-snapshot-20261113105900 (snapshot) — 2026-11-13
- 2.16.0-options-preview-20260605124754 (options-preview) — 2026-06-05
- 2.0.0-rc-20241022183311 (rc) — 2024-10-22
- 0.5.8-next-20240505114610 (next) — 2024-05-05
- 0.1.0-canary-20230727091428 (canary) — 2023-07-27
- 0.0.2-beta-20230705211101 (beta) — 2023-07-05
- 2.22.7-preview-20261113113415 — 2026-11-13
- 2.22.7-preview-20261113102906 — 2026-11-13
- 2.22.7-snapshot-20261113095001 — 2026-11-13
- 2.22.7-preview-20261113085903 — 2026-11-13
- 2.22.7-preview-20261113084204 — 2026-11-13
- 2.22.7-snapshot-20261112111749 — 2026-11-12
- 2.22.7-snapshot-20261111153147 — 2026-11-11
- … 305 more at https://npm.io/package/@medusajs/orchestration/versions

## README

<p align="center">
  <a href="https://www.medusajs.com">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/59018053/229103275-b5e482bb-4601-46e6-8142-244f531cebdb.svg">
    <source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/59018053/229103726-e5b529a3-9b3f-4970-8a1f-c6af37f087bf.svg">
    <img alt="Medusa logo" src="https://user-images.githubusercontent.com/59018053/229103726-e5b529a3-9b3f-4970-8a1f-c6af37f087bf.svg">
    </picture>
  </a>
</p>
<h1 align="center">
  @medusajs/orchestration
</h1>

<h4 align="center">
  <a href="https://docs.medusajs.com">Documentation</a> |
  <a href="https://www.medusajs.com">Website</a>
</h4>

<p align="center">
  Building blocks for digital commerce
</p>
<p align="center">
  <a href="https://github.com/medusajs/medusa/blob/develop/LICENSE">
    <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="Medusa is released under the MIT license." />
  </a>
  <a href="https://github.com/medusajs/medusa/blob/develop/CONTRIBUTING.md">
    <img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat" alt="PRs welcome!" />
  </a>
  <a href="https://discord.gg/xpCwq3Kfn8">
    <img src="https://img.shields.io/badge/chat-on%20discord-7289DA.svg" alt="Discord Chat" />
  </a>
  <a href="https://twitter.com/intent/follow?screen_name=medusajs">
    <img src="https://img.shields.io/twitter/follow/medusajs.svg?label=Follow%20@medusajs" alt="Follow @medusajs" />
  </a>
</p>

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

- [Workflows](https://docs.medusajs.com/learn/fundamentals/workflows)
- [Long-running workflows](https://docs.medusajs.com/learn/fundamentals/workflows/long-running-workflow)

---
_Source: https://npm.io/package/@medusajs/orchestration · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
