View Workflow Executions in Medusa Admin

In this guide, you'll learn how to view workflow executions in the Medusa Admin.

Note: This guide is primarily useful for developers and technical teams building and debugging customizations of a Medusa application.

What are Workflow Executions?#

Workflows are a series of steps that perform a task. You build workflows in your source code to implement custom commerce flows and features.

When you execute a workflow, Medusa runs the steps in sequence to complete the task. If you've configured the workflow to store its executions in the database as explained in the Store Workflow Executions guide, you can view the workflow's executions and their details in the Medusa Admin. This is useful for debugging workflows and ensuring they run as expected.


View Workflow Executions#

To view workflow executions, go to Settings → Workflows. There, you'll find a list of custom and Medusa workflows that have been executed and are stored in the database. You can search through the list to find the one you're looking for.

Workflow executions list

Workflow Execution Status#

In the list, you can view the status of each workflow execution. A workflow execution's status can be:

Status

Description

Not Started

The workflow has been executed, but its steps haven't been invoked yet.

Invoking

The workflow execution is currently running and invoking its steps.

Done

The workflow execution has completed successfully.

Failed

The workflow execution has failed.

Compensating

The workflow execution is compensating its steps after a failure.

Reverted

The workflow execution has been reverted, which occurs when the workflow runs as part of another workflow and the parent workflow fails.


View Workflow Execution Details#

To view a workflow execution's details:

  1. Go to Settings → Workflows.
  2. Click on the workflow execution to view it.

On the workflow execution's page, you'll find multiple sections containing the execution's details.

Workflow executions details

Summary Section#

In the first section, you'll find a summary of the workflow execution, including:

  • A badge at the top end of the section indicating the execution's status.
  • The workflow's unique ID, which you specify when you create the workflow.
  • The transaction ID, which is a unique identifier for the workflow execution. This is useful for debugging, tracking, and changing step statuses of long-running workflows.
  • The workflow's progress, which shows a quick overview of the steps that have been executed.

Timeline#

The timeline diagram shows you the step-by-step execution of the workflow. You can zoom in and out, and drag the mouse to view the entire diagram. You can also click on a step to view its execution details in the History section.

Step Status

In the timeline diagram, each step node has a small box whose color indicates the step's status:

Color

Description

Orange

The step is currently being executed.

Green

The step has been executed successfully.

Red

The step has failed.

Gray

The step hasn't been executed yet, or it has been skipped, which can occur if the step is part of a when condition.

JSON#

The JSON section allows you to view the execution's details as a raw JSON object by clicking the icon. This is useful for advanced debugging to see all the details of the workflow execution.

History#

The History section shows you the execution of the workflow's steps in order of execution. You can see each step's name with a dot reflecting its status as explained in the Step Status section.

If you click on any executed step, you'll see its details, including:

  • Definition: the step's configurations that can be passed when you create the step. For example, the step's name, whether it has a compensation function, or whether it's asynchronous.
  • Output: the step's output, which is the result of the step's execution.
  • Compensation Input: if the workflow failed and the step has a compensation function, you can see the input that the compensation function received.
  • Error: if the step failed, you can see the error message.

Workflow executions history

Was this guide helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break