Surrey and Borders ESR Automation
It looked like Edge. It wasn’t. An unattended ESR reporting robot, fixed at the root and handed over as a pattern the Trust now builds on.
- 6
- Root causes found. None of them was the browser
- 4
- Further desktop flows the Trust built from the same template
- Daily
- Staff in Post extract, running unattended
Surrey and Borders Partnership NHS Foundation Trust was automating its ESR reporting with Power Automate. The daily Staff in Post flow kept failing, and the working diagnosis was that Edge was unstable. We traced every failure to its real cause, fixed each one, and handed over a pattern the Trust’s own team now uses to build more.
The Challenge
The Workforce Intelligence team wanted the daily Staff in Post report and other ESR extracts pulled overnight, with nobody logging in to do it by hand.
The daily flow failed often enough that the working diagnosis was “Edge is unstable”. Other flows were waiting on it.
The Constraint
The flow runs unattended on a virtual PC. Nobody is there to click retry, so every step has to recover by itself, or fail cleanly and record why.
It also drives the ESR Business Intelligence portal, which loads content in the background and is outside the Trust’s control.
The Approach
We left the browser alone and instrumented the failing actions. Every failure traced to one of six causes: selectors tied to dates or session tokens, clicks fired before the page had rendered, script-driven buttons that ignore a standard click, forced shutdowns that reopened old windows, renames that raced the download, and a pop-up that appeared a moment too late to be dismissed.
Each had a specific fix: stable selectors, readiness waits at each page transition, script-level clicks, a controlled browser launch and clean close, a wait-for-file before rename, and a bounded wait for the pop-up. Output now lands in SharePoint.
We then built a second flow, Education Staff in Post, by copying the stabilised one, and wrote the whole method up as build notes with a pre-go-live checklist. The Trust’s lead built alongside us from the first session, so the know-how stayed in the Trust.
We have achieved sustained reliability in our daily Staff in Post reporting, while successfully extending the same automation approach across additional workflows, establishing a scalable and repeatable foundation for future automation.
What changed
- Daily Staff in Post extract running unattended on schedule
- Six root causes found and fixed. None of them was Edge
- Second flow, Education Staff in Post, built from the same template
- Trust team built four further desktop flows from the pattern
- Trust replaced tab clicks with direct report links, using the build notes
- Extract lands in SharePoint and loads into SQL, ready for Power BI
- Build notes and pre-go-live checklist handed over for any unattended browser flow
Healthcare / NHS
Automations that keep failing?
We find why Power Automate and RPA flows fail, fix the causes, and leave your team able to build the next ones. Delivered. Not promised.
More case studies
Gloworm Festival App
The official app for the UK’s biggest family festival, built to work where the phone mast doesn’t reach.
Startups & Scale-upsVault Training Club
A production iOS fitness app with an AI coach in it, from concept to App Store in about two months.
Healthcare / NHSDigiCareCloud®
A FHIR-native community diagnostics platform, built to NHS standards and ready to pilot.
