Skip to content

Instantly share code, notes, and snippets.

@fantonangeli
Created June 13, 2023 06:54
Show Gist options
  • Save fantonangeli/9ce405871a2fff8b557990e052130a84 to your computer and use it in GitHub Desktop.
Save fantonangeli/9ce405871a2fff8b557990e052130a84 to your computer and use it in GitHub Desktop.
Greeting workflow
{
"id": "jsongreet",
"version": "1.0",
"specVersion": "0.8",
"name": "Greeting workflow",
"description": "JSON based greeting workflow",
"start": "ChooseOnLanguage",
"functions": [
{
"name": "greetFunction",
"type": "custom",
"operation": "sysout"
}
],
"states": [
{
"name": "ChooseOnLanguage",
"type": "switch",
"dataConditions": [
{
"condition": "${ .language == \"English\" }",
"transition": "GreetInEnglish"
},
{
"condition": "${ .language == \"Spanish\" }",
"transition": "GreetInSpanish"
}
],
"defaultCondition": {
"transition": "GreetInEnglish"
}
},
{
"name": "GreetInEnglish",
"type": "inject",
"data": {
"greeting": "Hello from JSON Workflow, "
},
"transition": "GreetPerson"
},
{
"name": "GreetInSpanish",
"type": "inject",
"data": {
"greeting": "Saludos desde JSON Workflow, "
},
"transition": "GreetPerson"
},
{
"name": "GreetPerson",
"type": "operation",
"actions": [
{
"name": "greetAction",
"functionRef": {
"refName": "greetFunction",
"arguments": {
"message": ".greeting+.name"
}
}
}
],
"end": {
"terminate": true
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment