Use case:
The client software fires the workflow execution and needs to be know when the
workflow is complete. There is no good pool strategy as workflow can take
arbitrary time from ms to days. Callback notification is needed.
Solution is a webhook
Option 1: pass callback URL as part of starting workflow execution:
POST /executions
workflow_name=flow
callback= {
events: [[on-task-complete, on-execution-complete]
url: http://bla.com
method:POST
headers: {}
… other stuff to form proper HTTP call, like API tokens, etc ...
}
…..
Option 2: webhook endpoint
Mistral exposes /webhook controller
Client creates a webhook and receives events for all executions for selected
workflows.
{
"name": "web",
"active": true,
"events": [ ]
“workflows”: [wf1, wf2]
"url": "http://example.com/webhook",
}
Opinions:
DZ: my opinion:
Option 1 for it is simple and convenient for a client.
It seems like an optimal solution for “tracking executions and tasks” use case.
Option 2 is an overkill: makes it harder for a client (post workflow, post
webhook, post execution, delete workflow, delete webhook) introduces lifecycle
management problems (e.g., workflow deleted -> webhook orphaned).
I vaguely recall someone from Heat compared these options and regretted one of
them for security reasons, but can’t remember details.
_______________________________________________
OpenStack-dev mailing list
[email protected]
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev