<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Winson,<div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On 02 Dec 2014, at 09:10, W Chan <<a href="mailto:m4d.coder@gmail.com" class="">m4d.coder@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">To clarify on the shortcut solution, are you saying 1) we add an adhoc event subscription to the workflow spec OR 2) add a one time event subscription to the workflow execution OR both?</div></div></div></blockquote><div><br class=""></div><div>Not sure what you mean by “adhoc” here. What I meant is that we should have 2 options:</div><div><ul class="MailOutline"><li class="">Have an individual REST endpoint to be able to subscribe for certain types of events any time. For example, “Notifications about all workflow events for workflow name ‘my_workflow’” or “Notifications about switching to state ‘ERROR’ for workflow ‘my_workflow’”. Using this endpoint we can also unsubscribe from these events.</li><li class="">When we start a workflow (“mistral execution-create” in CLI and start_workflow() method in engine) we can configure the same subscription and pass it along with “start workflow” request. For such purposes, engine method “start_workflow” has keyword parameter “**params” that can take any kind of additional parameters needed for workflow start (for example, when we start a reverse workflow we pass “task_name”). This way we can start a workflow and configure our subscription with a single request. In the first approach we would have to make two requests.</li></ul></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">I propose a separate worker/executor to process the events so to not disrupt the workflow executions. What if there are a lot of subscribers? What if one or more subscribers are offline? Do we retry and how many times? These activities will likely disrupt the throughput of the workflows and I rather handle these activities separately.</div></div></div></blockquote></div></div><div class=""><div class=""><br class=""></div><div class="">Yeah, I now tend to agree with you here. Although it still bothers me because of that performance overhead that we’ll have most of the time. But generally, yes, you’re right. Do you think we should use same executors to process these notifications or introduce a new type of entity for that?</div><div class=""><br class=""></div><div class="">Thanks</div><div class=""><br class=""></div><div class="">Renat Akhmerov</div><div class="">@ Mirantis Inc.</div></div><div class=""><br class=""></div></body></html>