View Workflow Executions in Medusa Admin

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

NoteThis guide is mainly 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 a workflow in your source code to implement custom commerce flows and features.

When you execute a workflow, it runs the steps in sequence to complete the task. If you've configured the workflow to have its executions stored in the database as explained in this technical guide, you can view the executions and their details in the Medusa Admin. This is useful to debug workflows and ensure they ran as expected.


View Workflow Executions#

To view workflow executions, go to Settings → Workflows. There, you'll find the 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's execution status can be:

StatusDescription
Not StartedThe workflow has been executed, but its steps haven't been invoked yet.
InvokingThe workflow execution is currently running, invoking its steps.
DoneThe workflow execution has finished successfully.
FailedThe workflow execution has failed.
CompensatingThe workflow execution is compensating its steps after a failure.
RevertedThe workflow execution has been reverted, which occurs when the workflow ran as part of another workflow and the parent workflow failed.

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 with 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 right indicating its 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 and move 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 at its left whose color indicates its status:

ColorDescription

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's 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 by 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 which can be passed when you create the step. For example, the step's name, whether it has a compensation function, whether it's asynchronous, etc...
  • 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?
Edit this page
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