Advanced
Programmatically Completing a Step
There are few ways to programmatically mark a step complete within a Flow via the SDK and backend methods:
Completion Criteria
Use the completionCriteria
property on a step to automatically mark the step as completed when a user meets the criteria. See Targeting for more information.
data:
- id: example-step
...
completionCriteria: user.properties.connectedBank == true
Mark Step Completed
Call the markStepCompleted
method from the useFlows hook in the SDK.
import { useFlows } from '@frigade/react';
const { markStepCompleted } = useFlows();
markStepCompleted('flow_1A23BC45D', 'example-step');
Backend Methods
You can also mark steps completed in your backend via the flowResponses endpoint or our Javascript SDK.