Recap 3
Workflows
Build custom commerce interactions. Integrate your systems. Automate your operations. Workflows orchestrate actions across your stack with built-in retries and rollbacks.
A Workflow Step performs a query or action in a system. Steps can receive inputs from previous steps and return data to be used in subsequent steps. You can resolve services in your steps allowing to quickly build business logic involving Medusa's core commerce modules or your 3rd party or custom systems.
To connect multiple steps together you create a Workflow. Creating a Workflow is like writing any other function. Behind the scenes Medusa generates a representation of your workflow that enables automatic retries of steps if they fail.
If step retries don't succeed, Medusa will rollback previous steps. A rollback will call a step's compensation method, ensuring your data is kept consistent across systems.
You can trigger your workflows anywhere in Medusa. Use your workflows in API Routes to start them in response to an API request or webhook. Start them in response to events with Subscribers. Or have them run on a defined schedule with Jobs.
accept-quote.ts
route.ts
src > workflows > accept-quote.ts
12345678910111213141516171819202122232425262728293031323334353637
A Workflow Step performs a query or action in a system. Steps can receive inputs from previous steps and return data to be used in subsequent steps. You can resolve services in your steps allowing to quickly build business logic involving Medusa's core commerce modules or your 3rd party or custom systems.
12345678910import { createStep, StepResponse, createWorkflow } from "@medusajs/workflows-sdk"const reserveInventory = createStep("reserve-inventory",async (cart, context) => {const inventoryService = context.container.resolve("inventoryService")await inventoryService.reserveInventory(cart.items)return new StepResponse({ success: true })})
To connect multiple steps together you create a Workflow. Creating a Workflow is like writing any other function. Behind the scenes Medusa generates a representation of your workflow that enables automatic retries of steps if they fail.
If step retries don't succeed, Medusa will rollback previous steps. A rollback will call a step's compensation method, ensuring your data is kept consistent across systems.
You can trigger your workflows anywhere in Medusa. Use your workflows in API Routes to start them in response to an API request or webhook. Start them in response to events with Subscribers. Or have them run on a defined schedule with Jobs.
Synchronize ads audiences
Synchronize your Customer Groups with Meta, Google, Klaviyo, and more.
Integrate your PIM system
Ensure product data is in sync across Medusa, CMS, ERP, Marketing tools, etc.
Long running workflows
Build human-in-the-loop Workflows, and keep track of asynchronous operations like return management, pre-orders, and much more.
New Standalone Commerce Modules
Use our standalone modules in any Node project, or in concert with Medusa.
Sales Channel Module
API Routes, Subscribers, and Scheduled Jobs
Trigger workflows and run custom logic in Medusa’s improved API Routes, Subscribers, and Scheduled Jobs.
Add Endpoints to your Medusa application with API Routes
Expose an endpoint in your Medusa application that will run as requests come in. Use API Routes to run custom logic or trigger workflows.
React to events from across your digital commerce stack with Subscribers
Use Subscribers to perform actions every time an order is created, a new customer signs up, or anything else. Subscribers, like API Routes, can run custom logic or trigger workflows.
Perform scheduled jobs to automate repetitive work
Need to share a weekly sales report every Monday in Slack or perform an inventory audit every night? Scheduled Jobs can be configured to perform tasks on a specific schedule.
Improved and more extensible Admin
Medusa’s Admin dashboard is more customizable than ever. Add custom Widgets and UI Routes to support your business workflows to always have the full picture of your digital commerce operations.
Showcase: AI Order Assistant
Medusa UI on Figma Community
We have open sourced our design file for Medusa UI. This allows you to use Medusa UI in your own designs. Go grab your copy.
Medusa keeps improving
Throughout the past months, we have shipped numerous improvements. Here are some highlights.
Improved API Reference Docs
Medusa’s API reference has been updated with a fresh design and is more performant than ever.
Better Price Lists
Use Price Lists to differentiate prices based on conditions such as customer groups, sales channels, regions, and more.
New Authentication Methods
Medusa has new authentication methods and stronger security foundation.
Bulk Editor
Speed up your data management processes with a spreadsheet-like UX.
Improved Import / Export
Load data into Medusa faster. Use custom strategies for parsing your files.
Powering commerce in +40 countries
From fast-growing startups to complex global corporations. New users across the globe are trusting Medusa to power and orchestrate their commerce infrastructure.
What can you build with Medusa?
Our modules are built to be used in any type of application that needs commerce logic. Check out our recipes and learn how to get started.
Agilo
Tekla PoS + ecom & Palmes global shop
Alpha Solutions
Nordic Semiconductor ecom
icansee
Grassland & other Magento migrations
Lambda Curry
Foraged marketplace & multiple US ecom
Oak Digital
Airtox global ecom
Rigby
Patyna marketplace, Flora P. & Unitra ecom
Typed Development
B2B ecom for Visionary & Ora Drinks
Webbers
Mitsubishi, Mattsleeps & Good Chef ecom