Automata
Automata
Record-once, replay-many browser automation for Windows. Record what you do in a live browser pane, refine it in a visual step editor, and replay it with a resolver that keeps working after a site redesign.
+-- Automata ---------------------------------+------------------------------------------------+ | ? Record Stop Continue Cancel Settings | | | [ https://www.google.com ] [Go] | | | Build | Schedule | Data | Runs | live browser pane (WebView2) | |---------------------------------------------| | | COLLECTIONS + add collection| the page your task acts on, with its | | v Google Searches | own persistent profile, so a site | | v Wolf Tshirts [Run] | login survives app restarts | | 1 Navigate to google.com passed | | | 2 Type "wolf tshirts" passed | | | 3 Press Enter running | | | 4 Wait for results | | | 5 Click "Images" | | | > Describe it instead (advanced) | | | LOG | | +---------------------------------------------+------------------------------------------------+
The sidebar on the left is where you build, schedule and review. The browser pane on the right is the real page the automation drives. The tree above is the example the first-run tour builds for you.
Why
- Automate the websites that have no API: record the clicks once, replay them whenever you want.
- Stop rewriting scripts every time a site changes its markup: steps remember each element eight ways and heal themselves when one stops matching.
- Edit what you recorded instead of re-recording it: every step is a typed, editable row in a tree.
- Run unattended: schedule collections, chain them, and let the headless runner pick them up from Windows Task Scheduler.
- Feed tasks with data: loop over CSV or JSON rows, harvest lists off a page, and pass values from one task to the next.
- Bring your own LLM key when you want it: draft steps from a plain-English description, or let a model rescue a step that cannot be found. Recording and replay never need one.
Features
Record
Press Record, perform the actions in the browser pane, press Stop. The captured events coalesce into clean steps and save as a new task in the selected collection, with a live preview while you act:
- keystroke bursts become one
typeText - focus-clicks before typing vanish
- checkbox toggles collapse to their final state
- dropdown-opening clicks fold into the
selectOptionthey led to - submit-looking clicks are auto-flagged as commit points
Recording is the primary way to build a task; hand-building in the editor works too.
- Password values are never recorded (
masked). Fill them in the editor. - File uploads record the file name only, because browsers hide local paths from JavaScript. Set a real local path on the step before replaying.
- The recorder runs in every frame, so a click inside a cross-origin iframe is recorded in order alongside the clicks around it.
Edit
- Tree: hover a collection or task row for its buttons: add task or step, rename (opens a modal), duplicate, delete. Double-click a name for a quick inline rename.
- Insert between steps: hover the gap between two step rows and an "add step here" sliver appears; clicking it opens a picker listing every action, and the new step lands exactly there, selected in the editor.
- Step editor: click any step for its typed action dropdown, label, value or URL, editable target fingerprint fields, pause-for-user and commit-point flags, timeout, and add-substep or delete.
- Drag and drop: drag steps to reorder (drop on a row's middle to nest as a substep); drag a task onto another collection to move it.
- Deletes always confirm: every delete opens a purpose-built confirm modal. Escape or clicking away cancels; destruction takes an explicit click.
Replay
Select a task and click Run. Step rows light up live (running, passed, failed, healed, paused); pauseForUser steps hold until Continue. Every run also writes a log file to Documents\Automata\Logs\<timestamp>-<task>.log.
Each step auto-confirms its post-condition (value read back, checked state, navigation settled, page no longer busy) before the next one runs.
Self-healing element resolution
Each targeted step stores a multi-strategy fingerprint (id, CSS selector, name, classes, XPath, ARIA role and label, nearby label text, visible text). Replay resolves it by the path of least resistance; the first strategy with exactly one visible match wins:
#id -> css selector -> tag[name] -> tag.classes -> xpath -> aria label -> label text -> visible text
If no strategy is unique, candidates are scored by text, ARIA, name and class overlap. A clear leader wins; a near-tie fails as ambiguous rather than guessing. When a step only resolved through a fallback strategy, the resolver re-fingerprints the element and saves the refreshed identity back into the task (self-heal), and the tree marks the step as healed.
As an opt-in last resort (the "allow LLM repair" checkbox under Describe it instead (advanced)), an unresolvable step's intent can be handed to the LLM tool-calling loop to complete just that one step, in Run mode only.
Flow control, data and harvesting
Steps go beyond single clicks: wait (for a duration, a time of day, a condition or a signal), forEach over dataset rows, if and else, runTask, writeDataset, extractAll (harvest many rows off a page into a dataset), aggregate (total, count, min, max or average of a column) and checkElement (is it there right now, without failing). The Data tab holds the datasets these read and write.
Passing values between tasks
A task's wrench menu has Inputs and outputs. Takes declares what the task needs from whoever runs it: a name and a default, blank meaning required. Publishes declares what it hands on: a name, and a pick of any step in the task that captures a value.
Wire them together in the same dialog: each input has a comes from dropdown listing every output published by another task in the same collection. Run that collection and its tasks walk in order on one browser, each one's published values reaching the tasks after it. Both ends are picked, never typed.
A wiring is a hint, not a requirement. Run a wired task on its own and it uses its declared default and says so, and a value supplied directly (--input name=value, or a runTask step's binding) always wins over a wiring. The Demos collection ships three examples (Pipeline 1 to Pipeline 3) that only mean anything in order.
Schedule and run headless
The Schedule tab runs a collection at a set time, on an interval, or once another collection has finished. The Runs tab lists finished and in-progress runs, including ones that started while the window was closed. Both are backed by automata-runner, the headless command-line runner described under Command-line runner.
Describe it instead
Under Describe it instead (advanced), type what a task should do in plain English:
- Draft steps asks the selected LLM for a short Gherkin feature file in a closed, documented vocabulary, compiles it, and shows you both the feature and the resulting steps. Nothing is saved until you click Insert. A draft that does not compile is repaired against its own line-numbered diagnostics, up to three attempts.
- Run once lets an LLM drive the pane directly through generic DOM tools (click, set field, type, select, check, upload, page status) without saving steps. It is for one-offs and exploration.
A drafted feature looks like this:
Feature: Supplier restock
Scenario: Sign in
Given I open "https://shop.example/login"
And I click "Sign in"
Scenario: Check stock
Given I open "https://shop.example/stock"
Reaching into hard places
Every boundary a selector stops at is reached into: open shadow roots and same-origin iframes by walking them, closed shadow roots by being installed before the page runs and keeping a list of the roots it opens, and cross-origin iframes by talking to the copy of the resolver already running inside them over postMessage. The last one carries coordinates back out through each enclosing frame, because a cross-origin document cannot know where it sits on the page and its parent can.
Recording, harvesting and uploading reach the same places. A harvest generalises and reads rows through the same root walk, asking a cross-origin frame's own copy by name when it has to.
Quick start
From a published build
- Run
Automata.App.exe. Windows may offer to install the .NET Desktop Runtime the first time, if it is not already on the machine; accept that prompt once and relaunch. The WebView2 Runtime is already installed on virtually every current Windows 10 or 11 machine, so nothing else is needed. - The window has two panes: the sidebar (collections, tasks and steps tree, step editor, record and replay controls) and the live browser pane the automation acts on. The browser pane uses its own persistent WebView2 profile, so a site login survives app restarts without touching your regular browser.
- The first launch walks you through building a real example (see First run).
- Optional: to turn on the AI side, add a key (Claude, OpenAI, Gemini or Kimi) in MindAttic Vault (Settings, Open in MindAttic Vault). Without one, free-text authoring and LLM repair have nothing to call; recording, editing and replaying steps you have already built work either way. Automata asks once, on first launch, if no key is configured.
From source
git clone https://github.com/mindattic/Automata cd Automata dotnet run --project Automata.App
You need Windows and the .NET 10 SDK. See Building for publishing your own build.
First run
On first open with an empty store, Automata teaches itself. A short OK-gated walkthrough builds a real example in front of you:
- "A Collection is a group of Tasks". OK creates the Google Searches collection.
- "A Task is a member of a Collection; a Task is a group of Steps that run in order". OK creates the Wolf Tshirts task.
- The sample steps appear (navigate to Google, type wolf tshirts, press Enter, wait for the results, then click Images), and a final popup says to click Run.
Run it, watch the steps light up, then poke at everything else. The rest of the app works the way that example looks.
Concepts
- Collection: a named group of tasks.
Collection 1:M Task 1:M Step. - Task: a replayable automation ("Check Email from Dave"), an ordered tree of steps.
- Step: one typed action. Steps can nest substeps (
children), which execute sequentially after the parent's own action confirms.
Step actions
| Action | Does |
|---|---|
navigate
|
Load a URL and wait for the navigation to finish |
click
|
Trusted CDP mouse click at the element's center |
typeText
|
Real CDP keystrokes, for fields with keydown-style logic |
setValue
|
Native property setter plus input and change events (React-safe, fast) |
pressEnter
|
Real Enter key press, to submit search boxes and Enter-to-submit forms |
check and uncheck
|
Ensure a checkbox's final state (native or role=checkbox widget)
|
selectRadio
|
Select a radio input or role=radio widget
|
selectOption
|
Pick a select option by visible text |
uploadFile
|
Attach a local file via CDP, with no native picker |
waitForElement
|
Block until the target resolves and is visible |
assertElement
|
Fail the run unless the target exists and contains the expected text |
extractText
|
Read the target's text into the run output and log |
group
|
Pure container for substeps |
wait
|
Pause for a duration, until a time of day, until a condition holds, or for a signal |
forEach
|
Run the substeps once per row of a dataset |
if
|
Run the substeps only when a condition holds |
else
|
Run the substeps only when the if immediately before did not
|
runTask
|
Invoke another task inline |
writeDataset
|
Write bound values as a row of a named dataset |
extractAll
|
Harvest many rows off the current page into a dataset |
setZoom
|
Zoom the page so a later step can reach something a cramped layout hides |
aggregate
|
Reduce one dataset column to a total, count, smallest, largest or average |
checkElement
|
Report whether the target is there right now; absence is an answer, not a failure |
Two per-step flags:
- pauseForUser: replay halts before the step until you press Continue.
- isCommitPoint: an informational marker for steps that commit a permanent write (submit, save, purchase). Auto-flagged at record time for submit-looking clicks.
Settings
Automata's app-level settings and its API keys are edited in MindAttic Vault (MindAttic.Vault.Desktop), the one place every MindAttic app's settings and keys live. The sidebar's Settings button Open in MindAttic Vault opens Automata's tab there, which holds:
- AI provider: which LLM runs first (Claude, OpenAI, Gemini, Kimi via Moonshot); the rest stay fallbacks, and the first with a usable key wins.
- Appearance: Theme (Dark, the default, or Light; both palettes are checked against WCAG 2.2 AA by
tools/verify-ui.mjs) and Border radius (0 to 10 px, default 5). - Engine defaults: the global scope of the engine settings (step timeout, self-heal, LLM repair, retry, continue on step/task error, browser profile, screenshot on failure, LLM provider for runs). Empty means the built-in default; every collection, task and step can still override each one from its row menu in the sidebar.
- Keys: the shared MindAttic named keys for Claude, OpenAI, Gemini and Kimi. Keys assigned to Automata on its tab are used first, in order, failing over on error; with none assigned, Automata uses the Claude OAuth session and then the shared keys, as before. Keys Automata kept for itself before are moved into the shared list as its assigned keys on first start.
A save in Vault applies to the running app at once (the theme and radius repaint live) and to the next run, with no restart. Values live in %APPDATA%\MindAttic\Automata\settings.json; on first start Automata copies its settings from the database there once (the database row is left as it was). Automata.App.exe --write-settings-manifest does that and writes the manifest Vault reads, then exits; run.ps1 runs it after publishing.
The sidebar's Settings fold-out still holds:
- Examples: review the generated Demos collection, reset it to the version this build ships, or take a guided tour through every example, one at a time.
- Import and export: move a collection or task in or out as a
*.automata.zipor*.automata.json, or back up and merge the whole workspace as one*.automata.json(see Storage). - Open data folder: shows
automata.dbin File Explorer. - Layout: Detach the sidebar moves the build panel into its own window, for another monitor or a third of the screen. Closing that window docks it again, and its position is remembered across launches. It is the same panel either way, reparented and never reloaded, so nothing it was holding is lost.
Storage
Everything (collections, tasks, datasets, run history, the schedule, parked runs and settings) lives in one SQLite database:
%LocalAppData%\MindAttic\Automata\automata.db
The only store is the database; files are how work travels. Open data folder shows automata.db in File Explorer (copy it while the app is closed for a raw backup). Run logs stay plain text, one file per run, in Documents\Automata\Logs\; the folder button on the Runs tab opens it.
- Export and import (Settings, Move a collection or task) takes the selected collection or task out as a
*.automata.zip(the long-standing share format), a single readable*.automata.json, or a Chrome DevTools Recorder flow. Import takes any of those back, and also an old per-task.jsonfile from the file-based versions. - The whole workspace (Settings, The whole workspace) exports everything to one
*.automata.json(collections with their tasks, datasets, the schedule, settings, run history and parked runs) and imports one back. Into an empty database that is a restore: every id, name and timestamp arrives as it left. Into a populated one it merges. - Imports never overwrite. Colliding ids are regenerated and every reference follows (task order,
runTasksteps and input wiring, schedule targets and chains, run history). Colliding names get a(2)suffix, a task imported without its collection lands in an auto-created Imported collection, and a dataset, run or settings that already exist are kept, with a warning in the log. - Datasets keep their file-style names (
skus.csv,roster.json); the extension picks the shape. Import on the Data tab brings CSV and JSON files in (one with the same name is replaced, which is how a dataset is refreshed from a new spreadsheet export); each dataset's download button writes it back out as a file. A JSON dataset keeps nested objects as objects. - Deleting hides (HOUSE-LAW-2): a deleted collection or task keeps its row, marked deleted, and stops appearing anywhere. A task saved without a parent lands in an auto-created Default collection.
- Upgrading from the file-based versions. On the first launch against an empty database, Automata imports the old
Documents\Automata\{Collections,Datasets,Runs,Schedule,Parked}folders and%APPDATA%\MindAttic\Automata\settings.json, applying the old store's hand-edit rules on the way in (a folder or file renamed in Explorer names its collection or task; a copy-pasted file gets a fresh id; a folder of tasks withoutcollection.jsonis recovered under its name). The files are left exactly as they were, as a backup. The import runs once per database; the outcome is recorded in it, so nothing comes back from the old files after you delete it, and what came in is reported in the sidebar log. - Scratch databases for tests and tools:
AUTOMATA_DB_PATHnames the database file. A harness that setsAUTOMATA_SETTINGS_PATH(every one intools/does) getsautomata.dbbeside that path instead, so it can never touch the real one. The oldAUTOMATA_COLLECTIONS_ROOT,AUTOMATA_DATASETS_ROOT,AUTOMATA_RUNS_ROOT,AUTOMATA_SCHEDULE_PATH,AUTOMATA_PARKED_ROOTandAUTOMATA_SETTINGS_PATHnow say where the one-time import looks. The harnesses read the scratch database withtools/automata-db.mjs. - Schema changes ship as EF Core migrations in
Automata.Core/Automation/Data/Migrations, applied automatically at startup by the app and the runner.
To add a migration:
dotnet ef migrations add <Name> --project Automata.Core --output-dir Automation/Data/Migrations
Command-line runner
automata-runner (the Automata.Runner project) runs tasks without the desktop app, against the same database:
automata-runner — runs Automata tasks without the desktop app.
run --task <id|name> run one task
run --collection <id|name> run every task in a collection, in order
tick resume parked runs and run whatever is due (what Task Scheduler invokes)
status parked runs, then the ten most recent
schedule list what is scheduled, and when each is next due
schedule add --collection <id|name> --cron "0 9 * * *" [--timezone <id>]
schedule add --task <id|name> --every-minutes <n>
schedule add --collection <id|name> --after <entry-id>
schedule enable|disable|remove <entry-id>
install [--interval-minutes 5] register the tick with Windows Task Scheduler
uninstall remove it
run --task <id|name> [--input <name>=<value>]...
supply the task's declared inputs; anything not named
falls back to that input's default
demos list the generated examples, and which have been edited
demos seed write any example that is missing; refresh untouched ones
demos regenerate put EVERY example back to the shipped version, edits and
all; move or duplicate one out of Demos to keep it
profiles list the acceptance scenarios, and whether they are installed
profiles seed install any that are missing, into "Acceptance"
--help this text
Exit codes: 0 success, 1 a run failed, 2 fault, 3 bad arguments.
- The browser needs an interactive session: WebView2 cannot render in session 0, so a scheduled task must be registered to run only when the user is logged on.
- A wait longer than its step's park-after threshold (15 minutes by default) checkpoints the run and closes its browser rather than holding one idle; the next tick after the wait ends picks it up. Parking resets the page to the task's start URL, so a task that must keep what it did before the wait should set that threshold to 0 and hold the browser instead.
- Acceptance profiles run against real sites, so they are never seeded on launch and never refreshed; adapt them and they stay adapted.
How it works
Automata.App WPF host: two WebView2 panes, postMessage bridge, AutomationController
Automata.Runner headless CLI runner (automata-runner) over offscreen WebView2 lanes
Automata.Core engine: model, SQLite store (EF Core 10), zip/JSON export-import, one-time legacy
import, replay engine, recorder coalescer, Gherkin flow compiler, scheduling,
LLM tool loop. WebView2-free.
AutoWebNav (NuGet, github.com/mindattic/AutoWebNav) the shared browser layer: IBrowserSurface,
fingerprint/resolver + page toolkit JS, BrowserActions, and AutoWebNav.WebView2's
WebView2BrowserSurface / DomFileInjector / OffscreenWebView2Factory. Shared with
KdpPublish and JobHunt; change browser mechanics there, not here.
Automata.Tests NUnit 4 over model, database (real migrations on scratch SQLite files), stores,
export/import, legacy import, replay, workflow, recorder, settings, logs, demos
The sidebar is plain HTML, CSS and JavaScript in Automata.App/wwwroot, hosted in one WebView2 pane and talking to the C# host over postMessage. The other pane is the target browser. LLM access goes through MindAttic.Legion; credentials resolve through MindAttic.Vault.
Building
dotnet build Automata.slnx dotnet test Automata.Tests
Run from source
.\run.ps1 # the menu: 1) Redeploy 2) Run Debug 3) Run Release .\run.ps1 -Redeploy -RunRelease # Deploy & Run (menu pick 13) .\run.ps1 -RunRelease # Run the installed copy, no build .\run.ps1 -Redeploy -DryRun # print what would be built and launched
run.ps1 (repo root) is the MindAttic standard run menu; run.bat beside it opens the same menu on a double-click and passes any arguments through. Redeploy publishes Automata.App and Automata.Runner (automata-runner.exe) into R:\MindAttic\Apps\Automata\Debug (framework-dependent) and R:\MindAttic\Apps\Automata\Release (self-contained single-file exes, with wwwroot as loose files beside them), stopping any copy running from that folder first, then runs Automata.App.exe --write-settings-manifest in each. Run Debug starts the Debug copy in the console (extra arguments pass through); Run Release starts the Release copy as a double-click would. dotnet run --project Automata.App works too for a quick dev run. Deploying never touches the WebView2 profile folders under %LocalAppData%\MindAttic\Automata\, so site logins survive redeploys.
Publish a distributable build
dotnet publish Automata.App -c Release -r win-x64 --self-contained false
Framework-dependent: the output (Automata.App\bin\Release\net10.0-windows\win-x64\publish\) is a few MB and needs the .NET 10 Desktop Runtime on the machine it runs on. Windows offers to install that automatically the first time Automata.App.exe runs, if it is missing. Hand that folder to someone and it runs as-is; there is no separate installer.
Testing
Beyond the NUnit tests in Automata.Tests, four acceptance harnesses drive the real app and the real runner (run npm install in tools/ first; they use Playwright and axe-core):
tools/verify-ui.mjs: the sidebar over CDP, including a WCAG 2.2 AA baseline for both themes.tools/verify-js.mjs: the injected scripts themselves (the naming rule as a pure function, and fingerprint, resolver and harvest against a real DOM in the real WebView2).tools/verify-demos.mjs: every generated example, run in a browser.tools/verify-shop.mjs: the harvest-and-loop total, checked three ways against the pages themselves.
tools/collect-names.mjs sits beside them and is not a check at all; it never fails, it reports. It visits a spread of real sites and sorts every id and class they use into what stability.js would keep and what it would throw away, which is how the filter gets tuned against what shipped rather than against what somebody imagined. What it turns up goes into the corpus in verify-js.mjs, which is where a pattern is proven.
tools/verify-live.mjs --live is deliberately outside that set. It runs the acceptance profiles (a Google search, a Bing search and a webmail inbox) against the real sites, after automata-runner profiles seed installs them. It is never part of the green bar, because a search engine redesigning itself is not a regression in this repo. The mail profile reads its account from AUTOMATA_MAIL_URL, AUTOMATA_MAIL_USER and AUTOMATA_MAIL_PASS, and skips itself by name when they are not set.
Limitations
- Windows only: the host is WPF and the browser is WebView2.
- A closed shadow root that existed before the toolkit was installed is not reachable, and never becomes reachable. There is one instant when a closed root is visible to anything, and it is the instant it is created.
- A frame that runs no script at all (
sandboxwithoutallow-scripts) cannot answer. - Forwarding an action into a cross-origin frame needs
new Functionthere, so a frame whose CSP forbidsunsafe-evalcan be searched, read and harvested but not acted in, and says so. Nothing on the ordinary same-document path goes neareval. - Recording inside a closed shadow root is out, not merely unbuilt: the event is retargeted with an empty
composedPathand there is nothing to read. - Attaching a file inside a cross-origin frame is out, because that needs a handle on the element and a handle does not cross an origin boundary.
- Scheduled runs need a logged-on user session (see Command-line runner).
Scope
The complete product, built and planned, is written down in SPEC.md: every epic, feature and story with its ticket, and what is never in the product. The current finish line is RELEASE.md: Automata 3.0 (MS-85), which is also the finished product.
Documentation
- Status, history and remaining work: NEXT_STEPS.md
- Agent and contributor instructions: AGENTS.md
- Shared browser layer: AutoWebNav
License
MIT. See LICENSE.
Part of MindAttic — see more projects at github.com/mindattic. Related: AutoWebNav, MindAttic.Legion, MindAttic.Vault.
Pages in this repository
- Automata — Project Bible — Record a browser task once in a live WebView2 pane, edit it as a typed step tree, and replay or schedule it with a resolver that keeps…
- Automata — Release charter — Record-once, replay-many browser automation for Windows: record what you do in a live WebView2 pane, refine it in a step tree editor, and…
- Automata — Product specification — Place in the ecosystem: An automation driver (docs/ECOSYSTEM.md §2.1): the platform's tool for unattended chores on websites with no API,…