Suppose someone reopens a processing page and sees “5%.” Is the job still running, or is that simply the last progress update the application received? I’m trying to decide how a Temporal-backed app should answer that question without treating every percentage change as a durable Workflow event.
The scenario came from a small browser test on Video2X: I uploaded a five-second clip, saw queued and intermediate progress states, and later downloaded the completed result. I did not test a Temporal integration or verify that Video2X provides an API, job IDs, or callbacks. I’m considering the general case of an external processor that does report progress.
One option is to keep the latest percentage in an application database for the UI and tell the Workflow only when the job completes or fails. Another is to signal the Workflow at a few meaningful milestones. If the UI and Workflow receive updates separately, though, how should the app reconcile them when one update is delayed or missed? In particular, what would you use to prevent an old percentage from remaining on screen after the job has actually finished?
I’d be interested in how you divide live progress, durable state, and recovery checks in a real Temporal implementation.
You can pass progress of an activity as details to activity heartbeat. The DescribeWorkflowExecution API contains the list of pending activities with the last heartbeat value.
Treat “5%” as the last observed progress, not proof that the processor is still running. Store the percentage, an observation timestamp and a job/run identifier in the application projection. Show its age and mark it stale after a defined interval. Keep the Workflow’s business state separate: use Signals for meaningful external milestones or completion/failure, and a Query to read the state the Workflow currently knows. A Signal is asynchronous, so sending it is not itself proof that the handler has finished.
For reconciliation, check the Workflow execution status when reopening a stale projection and periodically while it is open. While the Workflow is running, query its state. If it is terminal, replace the displayed progress with the terminal outcome, even if the last percentage was 5%. If it is still running but the progress observation is old, say “running; progress last updated …” rather than implying 5% is current. Make projection updates conditional on the run identifier and a monotonic version so a delayed progress update cannot overwrite a newer terminal state. A failed or unavailable check should remain “unknown/stale,” not be treated as running or finished.