I am trying to come up with a JSON representation of workflow that is composed of both synchronous and asynchronous tasks.
For example:
Run A then B
When B is done
Execute C and D at the same time
wait for C and D to finish
Execute E
Wait for E to finish
execute F and G at the same time
Wait only for G and then
Execute H
I am not aware if there is a standard way to represent this.
This is my attempt :
{
"tasks":[
{"A":""},
{"B":""},
[{"C":""},{"D":""}],
{"E":""},
[{"F":""},{"G":""}]
]
}
Every {} runs serially/synchronously after the previous in the same array.
ie B will run only after A is done.
C and D will run together at same time after B is done.
E will run only when C and D are done.
F and G will run at the same time after E is done.
Now I want to wait only for G and don’t care about F before executing H. That I am not sure how to represent.
2
Answers
I would go with more explicit approach – for every task, include list of tasks on which its execution depends on:
Yet another way to describe the steps