Documents / @faasjs/workflow / fork
Function: fork()
fork(
children):ForkWorkflowInstruction
Mark the current step as waiting and create parallel child branch steps.
Parameters
children
Child steps to create.
Returns
Example
import { fork } from '@faasjs/workflow'
async function notifyTeams({ params }) {
return fork([
{
name: 'notifyWarehouse',
params: {
orderId: params.orderId,
},
},
{
name: 'notifyCustomer',
params: {
orderId: params.orderId,
},
},
])
}