-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi step workflow #1201
Multi step workflow #1201
Conversation
5c411be
to
3765b02
Compare
5fab386
to
1aa2933
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow should be based on simple yet generic graph definition (nodes and edges).
The engine should check for the graph complexity (only directive and radius of 1).
panic("parent hash should be present if event is not") | ||
} | ||
if exec.ParentHash.Equal(exec.Hash) { | ||
panic("parent hash cannot be equal to execution hash") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should return the error, no?
} | ||
|
||
func (w *Workflow) triggerExecution(wf *service.Workflow, prev *execution.Execution, eventHash hash.Hash, data map[string]interface{}) error { | ||
height, err := w.getHeight(wf, prev) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, the calculation of the height bring a few problems mainly when the workflow is circular (or multiple workflow are).
The height could be saved directly in the Execution.
Also, height is only valid for mono-branch workflow, fine for now but big limitation for the future.
Fix #1197
TODO:
Testing:
Note that the CLI is not yet updated for that so you will need to use the GRPC API directly.
We will create the following workflow:
These services are just accumulator that take a message in input and return a message that is the concatenation of the input plus the task executed.
You can find the services here:
ServiceA:
ServiceB:
ServiceC:
Once these services are created and started you can write the following workflow:
Where
88YtHw3iZtjpAeDDUWHsDFg9MLvgircPzCFHxFqJ2ex9
: Hash of instance of serviceA8qKUdaMPAn35ozeUWVcT9BQ5gHNJYbJJ5rTCWqfnJgpW
: Hash of instance of serviceB7sTRCDpWCXYBSVgh7dKKV6pP69PHdYQY8kyBohumEWNu
: Hash of instance of serviceCNow if you execute taskX from serviceA all the tasks of the workflow will be triggered.
You can also try with events by calling the
emits
task fromserviceA
with no inputs