Add a root execution ID to workflow executions
There is no easy way to get all of the workflow executions, action executions or tasks for an initial workflow execution. For example, if a workflow starts sub-workflow executions you need to manually traverse the execution graph and make many queries to the API.
The mistral database also doesn't make this easy, as the lookup has to be recursive and this it would be very inefficient even with SQL.
The proposal is to add a root_execution_id to the workflow executions, this will be a reference to the root execution, unless it is the root execution, then it will be blank. With this information we can more easily discover which graph the executions are a member of. The end result is to allow the following commands.
$ mistral execution-get 4dfe0dbf-
+------
| Field | Value |
+------
| ID | 4dfe0dbf-
| Workflow ID | fe73b547-
| Workflow name | tripleo.
| Description | |
| Task Execution ID | <none> |
| State | SUCCESS |
| State info | None |
| Created at | 2017-08-11 13:10:00 |
| Updated at | 2017-08-11 13:13:19 |
+------
$ mistral execution-list --filter root_execution_
+------
| ID | Workflow ID | Workflow name | Description |
+------
| f7e9f429-
| 3a93556c-
| 6aea3251-
+------
As you can see in this example, with a workflow ID we are able to easily list all the sub-workflow executions it started.
Blueprint information
- Status:
- Complete
- Approver:
- Dougal Matthews
- Priority:
- Undefined
- Drafter:
- Dougal Matthews
- Direction:
- Needs approval
- Assignee:
- Dougal Matthews
- Definition:
- Approved
- Series goal:
- None
- Implementation:
- Implemented
- Milestone target:
- None
- Started by
- Dougal Matthews
- Completed by
- Dougal Matthews
Related branches
Related bugs
Sprints
Whiteboard
Gerrit topic: https:/
Addressed by: https:/
Allow filtering executions by their root_execution_id
Addressed by: https:/
Add root_execution_id to sub-workflow executions
Addressed by: https:/
Add root_execution_id to sub-workflow executions
Addressed by: https:/
Allow filtering executions by their root_execution_id