Skip to main content

Container Workflow Activity

The container activity is used to execute a step with a subsequence of steps (SequentialStep).

import { SequentialStep } from 'sequential-workflow-model';
import { createContainerActivity } from 'sequential-workflow-machine';

interface BlockStep extends SequentialStep {
type: 'block';
componentType: 'container';
/* ... */
}

const blockActivity = createContainerActivity<BlockStep, MyGlobalState, MyActivityState>('block', {
init: () => ({}),
onEnter: async (step: BlockStep, globalState: MyGlobalState, activityState: MyActivityState) => {
/* ... */
},
onLeave: async (step: BlockStep, globalState: MyGlobalState, activityState: MyActivityState) => {
/* ... */
}
});