Long-Running Action Flow
A realistic background process with progress tracking, pause/resume, and final success or failure state.
Problem this solves
Some operations take seconds or minutes — CSV imports, bulk updates, data exports, report generation. Users need to know what's happening, how far along it is, and whether they can leave the page. This flow shows how to build a job queue UI with progress tracking, pause/resume, cancellation, and error recovery.
Use this pattern for any operation that takes more than 2–3 seconds: file imports, bulk email sends, data migrations, report generation. Always show progress, allow cancellation, and handle partial failure.
Interactive demo
Start an import job and watch it progress through each phase.
Click an import above to start a job.
Decision logic
| Status | What the user sees | Available actions |
|---|---|---|
| Running | Spinner + progress bar + row count | Pause, Cancel |
| Paused | Paused badge + progress preserved | Resume, Cancel |
| Success | Green check + completion summary | Dismiss |
| Failure | Red error + failure point + error count | Retry, Dismiss |
Leave and return
In a real implementation, the job runs server-side. The client polls for status updates. This means the user can navigate away and return — the progress bar picks up where it left off. Always tell users explicitly: "You can leave this page and come back." Never make users feel trapped watching a progress bar.