Skip to main content

Overview

Many banking and government portals still rely on traditional web interfaces with no public API. Teams manually log in to check balances, submit applications, or file tax forms — repetitive tasks that consume hours every week. These portals also refresh their UIs frequently, breaking any conventional automation. Refrain handles these portals by generating a self-healing runbook from a single goal description. When the portal’s UI changes, the runbook automatically adapts — no manual selector fixes needed.

Example runbook

name: check-bank-balance
url: https://portal.example-bank.co.jp/login
variables:
  - name: username
    source: secrets
  - name: password
    source: secrets
steps:
  - action: input
    selector: "#userId"
    value: "{{ username }}"
  - action: input
    selector: "#password"
    value: "{{ password }}"
  - action: click
    selector: "#loginButton"
  - action: wait
    selector: ".account-summary"
  - action: extract
    selector: ".balance-amount"
    capture: balance
  - action: export
    format: csv
    fields:
      - name: balance
        value: "{{ balance }}"

Generate and execute

1

Generate the runbook

Point Refrain at the portal and describe the goal:
npx @refrainai/cli generate -- \
  --url https://portal.example-bank.co.jp/login \
  --goal "Log in, navigate to account summary, and extract the current balance" \
  --context ./context.md \
  --output ./check-balance.yaml
2

Execute the runbook

Run the generated runbook. No AI tokens are consumed:
npx @refrainai/cli execute -- \
  --runbook ./check-balance.yaml \
  --secrets ./secrets.json
3

Schedule periodic runs

Use the Web Console scheduler or your CI/CD pipeline to run the runbook on a schedule.

Why this works well

  • No API required — Operates directly on the web interface, just like a human would.
  • Self-healing — Portal UI refreshes don’t break the automation. Selectors are resolved through multiple fallback layers.
  • Approval gates — Add Slack approval before sensitive actions like fund transfers or form submissions.
  • Zero rerun cost — After the initial AI-powered generation, every execution is deterministic and token-free.

What’s next