@ciptex-race/journey
v2.28.0
Published
@ciptex-race/journey
Downloads
68
Readme
Race Journey V2
Terminology
Journey: Journeys are individual workflows that you create. Journey definitions are expressed as instances of a JSON schema.
Execution: An `Execution`` represents a specific run through a Journey. An Execution is active while the user is in the Flow, and it is considered ended when the task is completed.
The Execution resource can be used to retrieve information about existing Executions or to create new Executions for outbound use cases (e.g. surveys, appointment reminders).
Get An Instance of Journey Manager
const manager = JourneyManager.getInstance();
Create a Journey
try {
const journey = await manager.journeys.create({ });
} catch (error) {
console.error(error);
}
Fetch an Existing Journey
try {
const journey = await manager.journeys("JFXXX");
} catch (error) {
console.error(error);
}
Create a new Execution
try {
const execution = await manager.journeys("JFXXX").executions.create({
taskSid: "TC123"
});
} catch (error) {
console.error(error);
}