Step X is already defined in workflow Error
If you get the following error when you start the Medusa application:
Where X
is any step, such as create-remote-link
.
Why this Error Occurred#
This error indicates that you're re-using a step in a workflow, meaning that more than one step in the workflow have the same name.
How to Fix it#
To resolve this error, use the config
method of a step to specify a custom name within the workflow's scope. For example:
1const helloWorkflow = createWorkflow(2 "hello",3 () => {4 const { data: products } = useQueryGraphStep({5 entity: "product",6 fields: ["id"],7 })8 9 // ✓ No error occurs, the step has a different ID.10 const { data: customers } = useQueryGraphStep({11 entity: "customer",12 fields: ["id"],13 }).config({ name: "fetch-customers" })14 }15)
In the above example, you use the config
method on the second useQueryGraphStep
usage to change its name to fetch-customers
.
Make sure to change the name of every usage after the first one in a workflow.
Additional Resources#
Was this page helpful?