Track execution origin

Registered by Winson Chan

If workflow contains several nested levels of subflows, it is really hard to query for all related tasks under the original workflow execution. Can we add a field in the execution and task DB to track the original workflow execution ID? And then add appropriate API/CLI query to filter by origin?

Blueprint information

Status:
Complete
Approver:
Renat Akhmerov
Priority:
High
Drafter:
Winson Chan
Direction:
Approved
Assignee:
ali abdelal
Definition:
Approved
Series goal:
Accepted for ussuri
Implementation:
Implemented
Milestone target:
milestone icon ussuri-2
Started by
Renat Akhmerov
Completed by
Renat Akhmerov

Related branches

Sprints

Whiteboard

rakhmerov: Seems like a very needed BP, I came across the same inconvenience and was trying to come up with a solution for that.

melisha: I agree with this concept but I don't think all sub-executions should be linked to the origin.

I suggest to add the "task_execution_id" to WF execution-list/get API response - this already exists in the DB and only need to be exposed in the API/UI.
This will allow building the execution graph from the execution list.

Another API that can be helpful for ease and performance is to add an "executions/{id}/executions" API which will list all the sub-workflow executions.
This API can also have a "nested_depth" query to get more than one level.

rakhmerov: melisha, I agree with those API additions. Great idea. As far as 'task_execution_id' also yes, it's easy to do.

12/23/2019, rakhmerov: so we now have "root_execution_id" that can be used to filter executions by the parent most execution. We need to make sure all it works well and exists in the API/CLI. And also implement other mentioned capabilities, if needed.

Gerrit topic: https://review.opendev.org/#/q/topic:bp/mistral-execution-origin

Addressed by: https://review.opendev.org/703402
    Added a new API to fetch sub-execution of an execution or a task

Addressed by: https://review.opendev.org/704245
    Add new CLI commands for sub-executions new API endpoints

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.