Skip to content

Saved automations (anchor.automations)

Describe a task once and run it whenever you want. The first run learns the plan with the LLM; the next runs replay the approved plan without the LLM. When the site changes and a saved step stops working, the automation heals itself and records the recovery.

A recovery is accepted only if every saved step that stopped working was redone: by a step of the same action about the same thing (the same value, as a renamed field filled with the same text, or at least half of its words). A step that only went somewhere (a link, "open the cart", "view details") is not redone by one that acts ("add to cart later", "continue", "delete"): a page with lures led a model's repair into exactly that. A recovery that does not keep this contract fails the run, and the saved plan is not changed.

The same rule is checked during the recovery, before each click: a click that acts (add, delete, continue, send) is only done if it redoes a saved step still to redo that acts too, about the same thing. A lure is refused before it is clicked, and the planner is told why. Filling a field is left to the contract above (it knows the values), and clicks that only go somewhere or prepare (close, open, show more) are let through.

python -m anchor.automations create register-maria --url eval/fixtures/registration_en.html --profile ollama-small "Register Maria Silva in the IT department and save the registration"
python -m anchor.automations run register-maria
python -m anchor.automations list
python -m anchor.automations show register-maria
python -m anchor.automations recoveries register-maria
python -m anchor.automations undo register-maria 1
python -m anchor.automations notes register-maria --add "the Save button is at the end of the page"

Options that come before the command:

Option Meaning
--root Folder of the saved automations. Default: automations.
--lang Interface language: en or pt.

create

Argument / option Meaning
name (positional) Lowercase letters, digits, - and _ (e.g. register-maria).
request (positional) What to do, in natural language.
--url The site's link, or the path of a local .html file. Required.
--profile Model profile used to learn (and to heal) the plan. Required.
--browser-profile Folder of a persistent browser profile, for systems with login.
--prompt-language Planner prompt language: pt, en or auto. Default: the model profile's.

run

Argument / option Meaning
name (positional) The automation to run. The first run learns the plan; the next ones replay it.
--relearn Plans again with the LLM, replacing the approved plan.
--no-heal If a saved step stops working, stops instead of recovering with the LLM.
--vision Confirms doubted steps with a screenshot (see the agent's --vision).
--allow-sensitive Does not ask before sensitive actions, and does not save decisions.
--unattended Runs with no one present, for a scheduler (see below). Only a proven plan; nothing is repaired or asked; any change stops the run, and the rest of a spreadsheet. Exit code 1 when it did not finish.
--fresh-browser Opens a clean browser for this run. By default, each automation keeps its own browser profile in its folder (browser/), so a login done by hand is kept for the next runs; a --browser-profile given at create is used instead.
--param The value of a parameter for this run, as name=value (repeat it for each parameter).
--csv Runs once per row of a CSV file whose columns are the parameters (, or ; as separator). Cannot be used with --param.

Tables and lists read by an automation are saved in its folder, under output/, and each run's record lists the files it wrote (not the text it read, which may be personal data).

Unattended runs (scheduling)

Only an automation whose current plan has been proven runs with --unattended: done once, with someone present, from start to end with no recovery (no repair by the model, no element chosen by hand). That run records the element each step acted on. Any change to the plan (a repair, --relearn, an undo) makes a new plan with no proof, which needs another run with someone present.

In an unattended run nothing changes and no one is asked:

  • the model is never called, and a saved step that stops working is not repaired;
  • no tie-break: an ambiguous element stops the run;
  • each step acts only on the element of the proving run (same text and label): an element that differs, even one the heuristic would accept with someone present, stops the run before acting;
  • only sensitive actions approved before are done; a new one is refused;
  • a login is never waited for: a saved login is used only if Use in scheduled runs is on for it (Settings → Saved logins); otherwise, log in once in a run with someone present (each automation keeps its browser profile);
  • what does not change the plan still happens: a cookie banner in the way is declined, "Show more" is opened, and an element whose id or class changed is still found by its text;
  • the first row that stops ends a spreadsheet run, and the exit code is 1.

The interface's Schedules do this while ANCHOR is open. To run it with no ANCHOR window open, use the system's scheduler; on Windows (Task Scheduler), every day at 8:00:

schtasks /Create /TN "ANCHOR register" /SC DAILY /ST 08:00 /TR "cmd /c cd /d C:\path\to\ANCHOR && venv\Scripts\python.exe -m anchor.automations run register --unattended --csv people.csv"

On Linux or macOS (cron), the same with 0 8 * * * cd /path/to/ANCHOR && venv/bin/python -m anchor.automations run register --unattended. When a run stops, show and the run's record say which step changed and why; run the automation once with someone present to look at it.

Parameters

The parts of the request that change from run to run go in braces when the automation is created; create finds them, and show lists them:

python -m anchor.automations create register --url eval/fixtures/registration_en.html --profile ollama-small "Register {name}, tax ID {tax_id}, IT department, contractor. Accept the terms and save the registration."
python -m anchor.automations run register --param name="Maria Silva" --param tax_id=123-45-6789
python -m anchor.automations run register --csv employees.csv

A CSV file for this automation:

name;tax_id
Maria Silva;123-45-6789
John Carter;987-65-4321

The model plans with the real values of the first run; the approved plan is saved with the placeholders (fill Tax ID = {tax_id}), so the next runs work with any values. The run records keep the placeholders, not the values, since they may be personal data. Every parameter needs a value in every run; an unknown parameter is refused.

list, show, recoveries, undo, notes, confirmations

Command Meaning
list Lists the automations and whether each one has an approved plan.
show name Shows the request, the link, the approved plan and the last runs.
recoveries name Lists how the automation recovered when the site changed: what failed, what replaced it, how it was solved, whether the effect was confirmed, the confidence; and the elements you picked during replays.
undo name number Undoes a recovery: a plan correction brings the previous plan back (and undoes the later corrections); a choice of yours is forgotten, and the next run asks again.
notes name Lists your notes about the automation. The 5 most recent go to the planner when it learns or heals the plan.

| confirmations name | Lists your decisions on sensitive actions (allowed or denied). |

confirmations options:

Option Meaning
--forget Forgets the decision with this number: the next run asks again.

Sensitive actions (deleting, saving or submitting, sending, paying, downloading, uploading, acting on your account on a social site, and cancelling an order, a subscription, a booking or another irreversible thing; a plain "Cancel" that closes a form is not asked about) are asked about once, when the element is found and before acting. Answer s/y to allow it, n to deny it, or just press Enter to deny it only this time. An action you allowed is not asked again (nor in the next rows of a spreadsheet); an action you denied with n stops the run, in that run and in the next ones, until you forget the decision. Pressing Enter, or having no terminal to answer, saves nothing: the next run asks again.

notes options:

Option Meaning
--add Adds a note (e.g. --add "the Save button is at the end of the page").
--remove Removes the note with this number.

After a run that did not work, run also asks whether you want to leave a note (Enter skips); with --csv, it asks once, at the end, if some row failed.