Loading...
Was this page helpful?
This documentation provides a reference to the parallelize
. It belongs to the Workflows SDK.
This function is used to run multiple steps in parallel. The result of each step will be returned as part of the result array.
1import {2 createWorkflow,3 parallelize,4 WorkflowResponse5} from "@medusajs/framework/workflows-sdk"6import {7 createProductStep,8 createPricesStep,9 attachProductToSalesChannelStep10} from "./steps"11 12interface WorkflowInput {13 title: string14}15 16const myWorkflow = createWorkflow(17 "my-workflow",18 (input: WorkflowInput) => {19 const product = createProductStep(input)20 21 const [prices, productSalesChannel] = parallelize(22 createPricesStep(product),23 attachProductToSalesChannelStep(product)24 )25 26 return new WorkflowResponse({27 prices,28 productSalesChannel29 })30 }31)
steps
TResultTResult
TResult