docs: added workflow hooks docs + changed workflow response (#8364)
* docs: added workflow hooks docs + changed workflow response * Update page.mdx
This commit is contained in:
@@ -205,8 +205,11 @@ With the steps ready, you'll create the workflow that runs these steps to update
|
||||
|
||||
Change the content of `src/workflows/update-product-erp/index.ts` to the following:
|
||||
|
||||
```ts title="src/workflows/update-product-erp/index.ts" collapsibleLines="1-5" expandButtonLabel="Show Imports"
|
||||
import { createWorkflow } from "@medusajs/workflows-sdk"
|
||||
```ts title="src/workflows/update-product-erp/index.ts" collapsibleLines="1-8" expandButtonLabel="Show Imports"
|
||||
import {
|
||||
createWorkflow,
|
||||
WorkflowResponse,
|
||||
} from "@medusajs/workflows-sdk"
|
||||
import { UpsertProductDTO } from "@medusajs/types"
|
||||
import updateProduct from "./steps/update-product"
|
||||
import updateErp from "./steps/update-erp"
|
||||
@@ -219,10 +222,10 @@ const updateProductAndErpWorkflow = createWorkflow(
|
||||
const product = updateProduct(input)
|
||||
const erpData = updateErp(input)
|
||||
|
||||
return {
|
||||
return new WorkflowResponse({
|
||||
product,
|
||||
erpData,
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
export default updateProductAndErpWorkflow
|
||||
|
||||
Reference in New Issue
Block a user