Advanced
Programmatically completing a step
There are two ways to programmatically mark a step within a Flow as completed via the SDK:
- Use the
completionCriteria
property on a step to automatically mark the step as completed when a user meets the criteria.
data:
- id: example-step
stepName: Example step
...
completionCriteria: user.properties.connectedBank == true
- Call the
markStepCompleted
method from the useFlows hook in the SDK.
import { useFlows } from '@frigade/react';
const { markStepCompleted } = useFlows();
markStepCompleted('flow_1A23BC45D', 'example-step');
Additional Methods
You can also mark steps completed in your backend via the flowResponses endpoint and/or our Javascript SDK.