---
title: "Framework"
url: https://medusajs.com/framework
last_updated: 2025-10-16T20:11:00Z
---

# Framework

### Build any feature,
integrate with any system

A built-in backend framework that lets you create customizations and integrations in hours, not weeks.

### With the Medusa framework, the only limit is your imagination.

##### Sync product data from ERP

##### Inject custom price data to cart

##### Extend data schemas

##### Add custom endpoints

##### Hook into existing workflows

##### Manage complex storefront queries

##### Build custom data models

##### Listen to webhooks from 3rd-party tools

##### Create advanced automations

##### Add human-in-the-loop workflows

#### Orchestrate actions across systems with Workflows

Workflows

Traditional commerce platforms force you to use separate servers, middleware, or applications for customizations. This is hard to manage, leading to long implementations and unreliable operations. In Medusa, you have a built-in foundation to build customizations natively.  
  
Our tools enable you to avoid hacky workarounds and instead build bespoke, scalable commerce applications fast. Let Medusa provide the framework, so you can focus on building the features that differentiate your business.

#### Define a step

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 you to build business logic involving Medusa’s core commerce modules, third-party systems, or custom systems.

#### Define a workflow

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.

#### Rollback on permanent failures

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.

#### Run your workflow

You can trigger your workflows anywhere in Medusa. Use your workflows in Subscribers to start them in response to an event. Start them in response to requests with API Routes. Or have them run on a defined schedule with Scheduled Jobs.

#### Build custom modules to support any commerce logic

Modules

Unlike other platforms that require separate applications for customization, Medusa enables you to write custom modules that integrate seamlessly into your application.  
  
You can define your own data models, endpoints, and logic for modules that work alongside Medusa's pre-built commerce modules.

#### Data Model

A data model represents a table in the database. You create data models using Medusa's Data Model API. It simplifies defining a table's columns, relations, and indexes with straightforward methods and configurations.

#### Service

You perform database operations on your data models in a service. Services provide methods, such as create, update, retrieve, list, and more, to manage your data models out of the box.

Additionally, services can hold custom methods for your business logic and/or integrate with third-party providers.

#### Container

Once services are defined, they can be resolved from Medusa's dependency container in API Routes, Subscribers, Scheduled Jobs, Workflows, and more.

#### Query

With multiple modules defined and linked to each other, you can use Query to retrieve data across all of them, including third-party systems. 

Similar to services, Query can be resolved from Medusa's dependency container across all the different application entry points.

Query gives you a single entry point to data across all systems in your stack. Create data relationships between modules with the new Link Modules and write queries that fetch data from multiple sources, including 3rd-party systems.

#### Query data across multiple systems.

Query

#### Powerful system for Admin
extensions.

Admin extensions

Extend existing Admin pages by adding widgets, which let you insert custom React components into predefined injection zones. Or go all the way and create new bespoke Admin pages using UI routes.

#### UI Widgets

Widgets allow you to add custom React components in injection zones spread across existing pages in the Admin Dashboard. For example, you can add a button on the order details page that links to the order in an integrated ERP system.

Widgets are easy to build, and Medusa automatically registers them when exporting a React component and its configuration from files placed in your Medusa project.

#### UI Routes

UI Routes allow you to add new routes to your admin dashboard. Similar to Widgets, Admin UI Routes are simply exported React components created in files in your Medusa project.

UI Routes can be added to the sidebar as new items or sub-items of existing routes.

#### Powerful system for Admin
extensions and customizations.

Admin extensions

Support your custom logic and unique business workflows with a powerful extension system and native UI.

#### Build any commerce application

Recipes

Don’t find the Starter your are looking for? Don’t worry, you can use some of our recipes to help build your own custom use case.

[Marketplace](https://docs.medusajs.com/v2/resources/recipes/marketplace)

[B2B](https://docs.medusajs.com/v2/resources/recipes/b2b)

[Commerce Automation](https://docs.medusajs.com/v2/resources/recipes/commerce-automation)

[Digital Products](https://docs.medusajs.com/v2/resources/recipes/digital-products)

[Ecommerce](https://docs.medusajs.com/v2/resources/recipes/ecommerce)

[Integrate Ecommerce stack](https://docs.medusajs.com/v2/resources/recipes/integrate-ecommerce-stack)

[Multi-Region Store](https://docs.medusajs.com/v2/resources/recipes/multi-region-store)

[Omnichannel Store](https://docs.medusajs.com/v2/resources/recipes/omnichannel)

[OMS](https://docs.medusajs.com/v2/resources/recipes/oms)

[Personalized Products](https://docs.medusajs.com/v2/resources/recipes/personalized-products)

[POS](https://docs.medusajs.com/v2/resources/recipes/pos/)

[Subscriptions](https://docs.medusajs.com/v2/resources/recipes/subscriptions)

[Start now](https://cloud.medusajs.com/signup)

#### Ready to build your
custom commerce setup?
