2

I'm using the AWS PHP library. My problem is that my decider never gets any of the closure events. When calling "pollForDecisionTask", I never receive any of these completion events:

WorkflowExecutionFailed WorkflowExecutionTimedOut WorkflowExecutionCanceled WorkflowExecutionTerminated WorkflowExecutionCompleted

They are logged as per the "Management console" but my decider never gets them. All other ones are working fine.

Anybody seen this? any ideas?

Daniel
  • 1,531
  • 13
  • 16

2 Answers2

1

All these events are used to terminate workflow and are initiated by a decider through a correspondent decision. So sending them back to a decider doesn't provide any aditional benefit.

Maxim Fateev
  • 6,458
  • 3
  • 20
  • 35
  • I'm not sure that's accurate. The decision uses "respondDecisionTaskCompleted" and sends commands like "FailWorkflowExecution" or "CompleteWorkflowExecution". SWF does create the events mentioned in my question when these decisions are processed by the system. At least they show up in the history when looking at it using the AWS Management Console. I just never get them to my decider when I poll. – Daniel Mar 28 '14 at 23:57
  • It's also possible to terminate a workflow execution using the Management Console, through a timeout or a external cancellation request. The decider should get notified about these but doesn't – Daniel Mar 28 '14 at 23:58
  • By SWF design decider makes decisions in the form of respondDecisionTaskCompleted requests. As no new decisions are accepted for closed workflows calling decider in this case is meaningless. I agree that there are use cases when some external entity wants to get notified about workflow termination, but this should rely on some other mechanism, not the decider. Currently parent workflows get notification about child workflow termination. So common pattern is to have parent "nanny" workflow that performs actions upon child completion. – Maxim Fateev Mar 29 '14 at 21:47
1

Responding to Maxim Fateev up there.

As per the documentation: http://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-workflow-exec-lifecycle.html

We clearly see that the last "event" is "WorkflowExecutionCompleted". This event should logically be received by the Decider so it is aware that the Workflow has correctly completed. How can I ensure the WF has properly completed if I don't receive this event?

I like you idea of "nanny" workflows but that's surprising to have to implement such things when SWF could just send the event back to the Decider and THEN mark the workflow as closed. Also who watches the "nanny" workflow? It's an endless battle ...

Daniel also marks a point saying that actions from the AWS console wouldn't be reflected back in the Decider.

I would like an official source from Amazon to comment on this. There is a post on the AWS forum about this problem: https://forums.aws.amazon.com/thread.jspa?messageID=542382&#542382

Cheers

koxon
  • 818
  • 1
  • 10
  • 12
  • The question is what decider is supposed to do when WorkflowExecutionCompleted is received? By definition the only action that decider is allowed to do is to emit some decisions. But in case of the WorkflowExecutionCompleted it is not possible. I don't understand what "WF has properly completed" means in the context of a decider. Could you give the concrete use case when it is necessary? – Maxim Fateev Jul 28 '14 at 18:28