Add a root execution ID to workflow executions

Registered by Dougal Matthews

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-4d21-4de7-8721-a72c01671a1e
+-------------------+--------------------------------------------------+
| Field | Value |
+-------------------+--------------------------------------------------+
| ID | 4dfe0dbf-4d21-4de7-8721-a72c01671a1e |
| Workflow ID | fe73b547-4274-4fbd-a539-c88462f0eb08 |
| Workflow name | tripleo.baremetal.v1.introspect_manageable_nodes |
| 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=4dfe0dbf-4d21-4de7-8721-a72c01671a1e
+--------------------------------------+--------------------------------------+----------------------------------+------------------------+
| ID | Workflow ID | Workflow name | Description |
+--------------------------------------+--------------------------------------+----------------------------------+------------------------+
| f7e9f429-155e-4056-8a79-6bb75ec5db81 | e9ca7c8b-8404-4346-a2da-0b889896a9fa | tripleo.baremetal.v1.introspect | sub-workflow execution |
| 3a93556c-7507-41ea-bcf5-4aa23f6e4cf6 | b14a85d8-cf06-4354-8be8-2204a5de5513 | tripleo.baremetal.v1._introspect | sub-workflow execution |
| 6aea3251-173a-4ee9-a29f-d88c71ca3b29 | b14a85d8-cf06-4354-8be8-2204a5de5513 | tripleo.baremetal.v1._introspect | sub-workflow execution |
+--------------------------------------+--------------------------------------+----------------------------------+------------------------+

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

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/mistral-root-execution-id,n,z

Addressed by: https://review.openstack.org/490562
    Allow filtering executions by their root_execution_id

Addressed by: https://review.openstack.org/490063
    Add root_execution_id to sub-workflow executions

Addressed by: https://review.openstack.org/512528
    Add root_execution_id to sub-workflow executions

Addressed by: https://review.openstack.org/527640
    Allow filtering executions by their root_execution_id

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.