Verdict
Verdict
The browser should be a worker, not the source of truth. Persist intent and progress outside the browser so a closed tab or crashed process does not erase the job.
Browser state is temporary
A tab can crash, a selector can move, a session can expire, and an anti-bot challenge can appear after nine successful steps. If the only record of progress lives inside the browser process, recovery means starting over and risking repeated actions.
Persist the business state separately: target, current phase, external IDs, evidence, retry count, and next allowed action.
- Workflow instance owns business progress
- Browser worker owns a short-lived session
- Artifact storage owns screenshots and downloads
- Credential service owns secrets
- Human queue owns unresolved decisions
Create durable boundaries around effects
Do not checkpoint after every click. Checkpoint after meaningful transitions: authenticated, record located, draft created, submission confirmed, artifact downloaded.
Before repeating a submission, inspect the target system for evidence that it already happened. Browser actions rarely provide clean idempotency keys, so reconciliation matters more than blind retry.
- Stable target URL or entity ID
- Screenshot before and after the effect
- Confirmation text or provider reference
- Hash of downloaded artifact
- Timestamp and session identity
Classify failures before retrying
A missing selector may be temporary, a changed page, a permissions problem, or a bad assumption. Retrying all four with the same script wastes time and can lock accounts.
Use bounded retries for navigation timeouts. Refresh selectors or models for layout drift. Escalate captchas, legal confirmations, unexpected charges, and ambiguous destructive actions to a human.
- Transient: retry with jitter
- Session: re-authenticate once
- Layout: collect evidence and re-plan
- Policy: stop and request approval
- Permanent: fail with a repair reason
Keep API work outside the browser
Use APIs for reliable data transfer whenever an API exists. Use the browser for the step that truly requires a UI. This reduces selector exposure and gives external writes cleaner status codes and identifiers.
A durable sequence can call an API worker, invoke a browser worker for one constrained task, pause for human review, then continue through another API. The orchestration remains readable even if the browser implementation changes.
Design the human handoff
A human should receive the current page, screenshot, intended action, reason for escalation, and allowed responses. ‘Agent needs help’ is not a handoff.
After the decision, emit a signal carrying the chosen action. The workflow resumes from its durable boundary instead of replaying the entire session.
- Approve the proposed action
- Provide corrected input
- Mark the target already complete
- Cancel safely
- Retry with a fresh session
Measure browser reliability honestly
Task completion rate alone hides repeated effects and manual rescues. Track completion without intervention, intervention rate, duplicate prevention, median recovery time, and cost per successful outcome.
The goal is not a browser agent that never fails. The goal is a system that fails visibly and resumes safely.
Implementation checklist
- 01Persist business progress outside the browser
- 02Checkpoint meaningful transitions
- 03Capture evidence around irreversible effects
- 04Classify failures before retrying
- 05Prefer APIs for data transfer
- 06Escalate ambiguous actions to humans
- 07Resume through signals
- 08Track intervention and duplicate-prevention rates