Skip to content

Instantly share code, notes, and snippets.

@Zonalds
Last active October 11, 2022 11:20
Show Gist options
  • Save Zonalds/c674df116a516d0a4092e344a7c07418 to your computer and use it in GitHub Desktop.
Save Zonalds/c674df116a516d0a4092e344a7c07418 to your computer and use it in GitHub Desktop.
This is just the sample data of the campaign flow
// We can just store the flow as a JSON. That is an array on mongoose.
const sampleFlow = [
{
type: "trigger", //This is what triggers entry to the flow
eventId: "random_auto_generated",
eventName: "Change in customer attribute", //Other option might include customer submited a form, Performed an action
//Other data
},
{
type: "send-message",
eventName: "Send Email",
},
{
type: "wait-until",
eventName: "Wait until [user perform another account]",
},
{
type: "conditional",
eventName: "User opened email",
},
{
type: "update_record",
sourceNode: 1, //The conditional releases 2 nodes, a yes and a no. 1 can be yes, 2, can be no
eventName: "Change user attribute", //if user opened email as in the previous step
},
{
type: "send-message",
sourceNode: 2, //This will be the no node returned form the conditional 2 indexes away.
eventName: "Send Push",
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment