Skip to content

Instantly share code, notes, and snippets.

@Andarist
Created April 21, 2017 08:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Andarist/5fda8b72967018695acb3f832d200ca5 to your computer and use it in GitHub Desktop.
Save Andarist/5fda8b72967018695acb3f832d200ca5 to your computer and use it in GitHub Desktop.
trigger example:
{
type: "new_customer",
value: true
}
step: { action, outcomes }
action example:
{
type: "protocol_action",
value: {
action: "send_event",
payload: {
type: "notification",
text: "How can i help you?"
}
}
}
outcomes - { outcomeKey: nextStep }
outcomes example:
{
accept: 'step2',
decline: 'step3',
}
whole scenario:
{
step0: {
conditions: [{
type: "new_customer",
value: true
}],
action: {
type: "protocol_action",
value: {
action: "send_event",
payload: {
type: "notification",
text: "How can i help you?"
}
}
},
outcomes: {
reply: 'step1',
decline: 'step2',
},
},
step1: {
action: {
type: "protocol_action",
value: {
action: "send_event",
payload: {
type: "notification",
text: "Our support will reach you as soon as possible"
}
}
},
outcomes: {
reply: 'step4',
decline: 'step5',
},
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment