LetsFlow
Search…
State
The state a process that's instantiated from this scenario can be in.

State scenario

All the possible states are described in the states section. Each state describes through which action it can transition to a new state
YAML
JSON
1
:initial:
2
action: complete
3
transitions:
4
- response: ok
5
transition: :success
6
- response: cancel
7
transition: :failed
Copied!
1
{
2
":initial": {
3
"action": "complete"
4
"transitions": [
5
{
6
"response": "ok",
7
"transition": ":success"
8
},
9
{
10
"response": "cancel",
11
"transition": ":failed"
12
}
13
]
14
}
15
}
Copied!
or
YAML
JSON
1
:initial:
2
actions:
3
- complete
4
- next
5
transitions:
6
- action: complete
7
transition: :success
8
- action: next
9
transition: next-state
Copied!
1
{
2
"initial": {
3
"actions": [
4
"complete",
5
"next"
6
],
7
"transitions": [
8
{
9
"action": "complete",
10
"transition": "success"
11
},
12
{
13
"action": "next",
14
"transition": "next-state"
15
}
16
]
17
}
18
}
Copied!

State Schema

https://specs.letsflow.io/v0.2.0/scenario/schema.json#state

title

A short title for the state.

description

A long description for the action that is shown when if the state is current or part of the golden flow.

instructions

Instructions that can be specific per actor. This is an object where the keys correspond with the actor keys.
YAML
JSON
1
instructions:
2
employee: Fill out this form
3
employer: Waiting for employee to fill out the form
Copied!
1
{
2
"instructions": {
3
"employee": "Fill out this form",
4
"employer": "Waiting for employee to fill out the form"
5
}
6
}
Copied!

actions

An array with the keys of all actions that may be performed in this state.
The order of the actions matter, especially for automated actions. The first available action is considered to be the default action. This action is followed when determining the golden flow.
If there is only one action available action, you may replace the actions property with an action property with a single action key as value.

transitions

Dynamic transitions from this state to the next.

Transition schema

https://specs.letsflow.io/v0.2.0/scenario/schema.json#transition
A transition defines the change from one state to the next. State transition definitions are more dynamic than the transition you can set in the response object.
Transitions are evaluated in order. If multiple transitions apply, only the first one is used.

action

Key of the action that must be performed for this transition to be selected.

response

Key of the response for which this transition would be selected.

condition

A boolean that must be true for the transition to be selected. This is typically a data instruction.

transition

Key of the state where to transition to.