Workflow Errors

When-Then Error: Handler for action X Not Found#

The following error may occur in production if you use a when-then block in your workflow:

Code
custom-workflow:when-then-01JE8Z0M1FXSE2NCK1G04S0RR2:invoke - Handler for action \"when-then-01JE8Z0M1FXSE2NCK1G04S0RR2\" not found...

This occurs if the when-then block doesn't return a step's result and doesn't have a name specified. You can resolve it by passing a name as a first parameter of when:

Code
1const result = when(2  "custom-when-condition"3  // ... rest of the parameters4)

Learn more about passing a name for when-then in this documentation

Was this page 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