Internal Demo Automation
Before a sales call, somebody had to build the demo by hand: create the cases, write the replies, attach the files, add the forms. I replaced that with a toolkit that drives the product's own API, and wrote it so the commercial team could run it without me.
- Role
- Designed and built
- Status
- Shared with the commercial team
- Shipped
- June 2026
- Size
- 21 scripts over one shared auth helper
One command
The headline script seeds four cases that tell a story a prospect recognises. Two arrive inbound, the way a partner system would send them: a referral with missing patient demographics, and an image quality issue that needs a rescan. Two go outbound, the way a clinic contacts a patient: an appointment reminder and scan preparation instructions.
Each case comes with the conversation already in it. Staff replies from different users, a file attached, a form on the outbound ones. The script prints the four case keys at the end, and the demo is ready to open.
Small pieces underneath
The seed is built from single-purpose scripts that are useful on their own: list, create and update for teams, inbound cases, outbound cases and patients, with patients sent as FHIR R5 resources. Most are under fifty lines and follow the same five steps, so the next script is a copy of the last one.
They share one helper that handles the OAuth2 client-credentials exchange, caches the token and re-issues it before it expires. No script manages a token itself.
Built for people who do not write code
The hardest part of any API toolkit is the identifiers. Which team, which user, which form? A discovery script answers that: it prints every team, member and form in the organisation as lines that paste straight into the configuration file, and each section fails on its own so a missing permission does not hide the rest.
Every script checks its configuration before it calls anything and names the exact setting that is missing. The seed checks that the demo file exists before creating a single case, so a run never stops halfway and leaves debris.
The repository also carries a guide written for Claude, documenting every command and the API's quirks. A colleague can open the folder in Claude Code and ask for a demo in plain language.
What I would add next
The seed reuses existing patient records rather than creating them, which keeps a staging organisation tidy but means first-time setup has one manual step left. Folding patient creation into the seed, behind a flag, is the obvious next change. So is a teardown script, which every demo environment eventually wants.
- Node.js
- REST API
- OAuth2
- FHIR R5
- Claude