Under normal circumstances, will a workflow be executed by multiple workflow workers at the same time? Because multiple workflow workers can polldecision tasks to execute, if not, how does he do it?
Asked
Active
Viewed 159 times
2 Answers
1
No it will not.
There is only one pending workflow decision task at a time. When a workflow worker is working on a decision task, Cadence will not schedule another one until the current one completed, failed or timeout.
However, timeout is enforced by server, technically when a decision task timeout the worker is still working on it. But the results will not be accepted afterwards.

Long Quanzheng
- 2,076
- 1
- 10
- 22
-
On top of Long's answer, it would be good to understand some Cadence terminology to understand this. Server maintains decision tasks in these states: "scheduled", "started", "completed", "failed" etc. Workers only poll decision tasks when they are in "scheduled" state. When they successfully poll, the state becomes "started" so by definition they won't poll already polled tasks. If the task fails for any reason, it will go back to "scheduled" state to be retried/re-polled. – Ender Aug 25 '22 at 22:39
0
It depends on many factors. A workflow can be executed by a single worker if it is short. But it will be executed by many workers if it takes long enough to be pushed out of the worker cache or a worker fails/restarts.
But the same workflow is executed exactly once in all these situations.

Maxim Fateev
- 6,458
- 3
- 20
- 35