Example prompt
I’m gonna show you a workflow in the eclinicalworks EHR to get a patient’s primary insurance ID. Use libretto skill to turn it into a playwright script that takes patient name and dob as input to get back the insurance ID. URL is …You perform the workflow once in the browser. Libretto captures the full action log. The agent reads it and writes a script that can run the same steps programmatically.
Step-by-step process
You perform the workflow manually
Navigate through the application exactly as you would normally. Log in, search for a patient, open their record, find the insurance tab — whatever the workflow requires. Libretto records everything happening in the browser as you go.
Libretto records your actions
Every click, form fill, and navigation is written to the action log at:Each entry captures the action type, the element you interacted with, the value you typed (if any), and the URL of the page at that moment.
Agent reads what you did
jq to find specific actions or filter by page:Agent inspects network traffic
Agent writes the workflow file
Using the action log as a blueprint, the agent writes a TypeScript workflow that replicates your steps:
What the action log captures
Each entry inactions.jsonl is a JSON object on its own line. User-initiated events include:
action— what happened:click,dblclick,fill,goto, etc.bestSemanticSelector— the most stable selector for the element you interacted withvalue— the text you typed or option you selectedurl— the page URL at the time of the actionnearbyText— visible text near the element, for human context
The
bestSemanticSelector field in user action entries is the most reliable selector to use in generated code. It’s the canonical identifier Libretto chose for the element based on the DOM structure — prefer it over targetSelector or raw CSS paths when writing workflow code.When to use this approach
- The workflow involves many steps and is hard to describe concisely
- You’re working with EHR, healthcare, or legacy enterprise software with unusual UI patterns
- You want to delegate the “figure out the selectors” work entirely to the agent
- The workflow involves conditional paths that are easier to show than explain
Related guides
One-shot script generation
Let the agent explore a site and build the workflow without your involvement.
Debugging workflows
Reproduce failures, inspect live page state, and fix broken automations.