E-commerce
Medusa.js: Workflows - What Are They Used For?
- 5 minutes reading
- 22.01.2025
- Krzysztof Polak
From version 2.x, Medusa.js introduced a new feature called Workflows. It was introduced to manage more complex and repeatable processes in an e-commerce project.
From this article you will learn:
- What the Workflows feature is
- How it is defined on the back end
- How you can monitor every step
Introduction
In the post here I described what the Medusa.js framework is and why it is becoming more and more popular.
In this post I would like to write about a new feature: Workflows.
When I first read about what it would be, my first thought was: order. As a developer, I pay close attention to keeping every project organized (as much as project time allows).
What is the Workflows feature?
Workflows allow you to define sequences of tasks (so-called steps) that can be executed automatically based on predefined rules.
Thanks to them you can easily organize processes, and in my opinion this approach brings a lot of order to the code and speeds up work.
How do we define a Workflow?
Workflows are defined in the Medusa.js back end. Each of them consists of a series of steps that represent tasks to be performed.
Steps
Each step in a workflow defines a single task or action that needs to be executed. Examples include sending an email to the user or an external system, updating an order status, or adding a product to favorites.
Automation
Workflows can be configured to be triggered manually or automatically based on events in Medusa.js, for example order creation, payment status changes, or shipment status changes.
Modularity
Because the steps are modular, each one can be easily customized and extended depending on requirements. At each stage you can run something completely different.
Monitoring
Workflow progress can be tracked easily. This way you know which steps have been completed and which are still waiting to be executed. Then you can react appropriately if something does not work.
We can monitor them in several ways, including:
-
Using the panel: In the panel, in a visual and clear way, you can see all running Workflows as a list. You can open each one and check all details.
How do you get there?
- log in to the back-end panel
- go to the "Settings" page (bottom left corner)
- on the left side find the Developer section and open the Workflows page
-
Using the API: Medusa.js provides an API that can be used to fetch the list of Workflows along with details.
This is enabled by the "WorkflowService" method.
import { WorkflowService } from "@medusajs/workflows";
In summary...
By introducing this feature, Medusa.js added new possibilities to the framework. We can conveniently control the flow of actions we want to use in the store. Additionally, I really like the idea of presenting all details in a visual way. Thanks to that, we can quickly check the state of each step.
Let's talk about collaboration!
We help businesses build scalable solutions with Medusa.js, Next.js, and Payload.

Krzysztof Polak
owner at Codee, a developer with many years of experience


