Solo builder playbook
Turn a Browser Task Into a Reusable Workflow
Move from a one-off 'click through the portal' prompt to a script you can run every week.
For Operators who repeat work in portals that have no API.
Browser agents are expensive per step and inconsistent between runs. The durable version of the workflow keeps the deterministic parts in code and uses the model only where the page actually changes.
Playbook template
Turn a Browser Task Into a Reusable Workflow
Requirements:
- A workflow you repeat on a schedule, not a one-time task
- A test account or staging copy of the target system where possible
- A browser automation harness with saved step output
Checklist:
- [ ] The recorded flow includes stable selectors or accessibility roles.
- [ ] Only genuinely variable steps use model inference.
- [ ] Success is asserted against the output artifact.
- [ ] Failures produce a screenshot and step index.Requirements
- A workflow you repeat on a schedule, not a one-time task
- A test account or staging copy of the target system where possible
- A browser automation harness with saved step output
Record the happy path once
Run the task with an agent and save the trace. Playwright's MCP server exposes the accessibility tree, so the recorded steps map to stable roles and labels rather than pixel coordinates.
Replace every step that does not need a model
Navigation, login, and file downloads belong in code. Stagehand is built for that hybrid: deterministic Playwright calls for the parts you know, model-driven actions only for the parts that move.
Assert the outcome, not the clicks
A run is successful when the file exists, the row count matches, or the confirmation number is present. Assertions on intermediate clicks break the week the vendor redesigns a button.
Alert on the first failure, not the third
Vision-based runs fail slowly. Notify on the first failed assertion with the step screenshot attached, so the fix starts from evidence.
Checklist
- The recorded flow includes stable selectors or accessibility roles.
- Only genuinely variable steps use model inference.
- Success is asserted against the output artifact.
- Failures produce a screenshot and step index.