Best Practice for showing workflow progress on Front end

Hi,
We are working on an solution where we want to integrate temporal workflow with frontend.

So flow goes like this-

  • User clicks on a button which will trigger a temporal workflow
  • User can see the workflow progress on the our website’s UI

I want to know what is the best practice to achieve this, currently we are thinking about using the workflow history to check which activity is completed.

Also is there any way I can trigger a Ably request whenever the workflow progress is updated
It would be greatly appreciated if anyone can please help me with this

I think depends on scale (how many executions you might be tracking across users) and at what rate you need to update the progress.

For smaller scale and update rate you could consider using visibility, as in upsert custom progress search attribute in your workflow code (before schedule a step / activity) which you can poll via DescribeWorkflowExecution api. Another option could be similar but storing current step info in workflow state and have client poll via workflow queries. Polling event history and parsing as you write can also be an option if it makes more sense to do for you.
Limitations of this these approaches are that visibility has smaller rps limits (so you should not poll at high rate) and is eventually consistent, and similarly high rate of workflow queries can put pressure on service and your workers. Polling possibly large event histories at high rate can put pressure on service as well.

For larger scale workloads and polling rate would look into writing update info (via local activity, can also look at doing this generically in workflow interceptor) to custom db and have your client poll updates from this db.