- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
- User Guide
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
- User Guide
View Workflow Executions in Medusa Admin
In this guide, you'll learn how to view workflow executions in the Medusa Admin.
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 Execution Status#
In the list, you can view the status of each workflow execution. A workflow's execution 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, invoking its steps. |
Done | The workflow execution has finished 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 ran as part of another workflow and the parent workflow failed. |
View Workflow Execution Details#
To view a workflow execution's details:
- Go to Settings → Workflows.
- Click on the workflow execution to view it.
On the workflow execution's page, you'll find multiple sections with the execution's 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:
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'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.