I have successfully built a workflow using Temporal that is functioning well. Now, I’m looking to implement a UI that can:
- Visualize workflow results in near real-time
- Enable interactive features like user approvals
Currently, I’m considering two potential approaches:
Option 1: Polling
- Regularly send queries to fetch the current workflow state
- Pros: Simple to implement
- Cons: Potential performance overhead
Option 2: PubSub Model
- Have the workflow publish updates to a message queue
- Frontend subscribes to receive live updates
- Pros: More efficient, real-time updates
- Cons: Slightly more complex implementation
What are the recommended patterns for near real-time workflow UI interaction? Are there built-in Temporal features or best practices I might be overlooking?
Any insights or suggestions would be greatly appreciated!