How to create and use Programmatic Flows
Before you begin, ensure you have:
flow:trigger
or all
scopeWithin Quotient, you can set the Trigger type of a flow to
PROGRAMMATIC
. Additionally, you can restrict this trigger to apply
to a specific segment as you can with other triggers.
From within your app, you can add the following snippet to trigger a flow:
import { QuotientServer } from "@quotientjs/server";
const client = new QuotientServer({...});
const data = await client.flow.trigger({
flowId: `YOUR-FLOW-ID`,
personId: `PERSON-FOR-FLOW`
});
import { QuotientClient } from '@quotientjs/client';
const client = new QuotientServer({...});
const data = await client.flow.trigger({
flowId: `YOUR-FLOW-ID`,
personId: `PERSON-FOR-FLOW`
});
That's it!