Skip to main content

Overview

Data entry across web forms is one of the most repetitive tasks in any organization — onboarding new employees, submitting vendor registrations, updating records in legacy systems. When there’s no API, someone has to type each entry manually. Refrain’s batch execution reads rows from a CSV and submits each one as a form entry. Self-healing selectors ensure the automation keeps working even when the form’s UI changes.

Example runbook

name: bulk-employee-registration
url: https://hr.example.com/employees/new
variables:
  - name: first_name
    source: data
  - name: last_name
    source: data
  - name: email
    source: data
  - name: department
    source: data
steps:
  - action: input
    selector: "#firstName"
    value: "{{ first_name }}"
  - action: input
    selector: "#lastName"
    value: "{{ last_name }}"
  - action: input
    selector: "#email"
    value: "{{ email }}"
  - action: select
    selector: "#department"
    value: "{{ department }}"
  - action: click
    selector: "#submit"
    requiresConfirmation: true
    confirmationMessage: "Submit registration for {{ first_name }} {{ last_name }}?"
  - action: wait
    selector: ".success-message"

Generate and execute

1

Generate the runbook

npx @refrainai/cli generate -- \
  --url https://hr.example.com/employees/new \
  --goal "Fill in the employee registration form and submit" \
  --context ./context.md \
  --output ./employee-registration.yaml
2

Prepare the CSV

first_name,last_name,email,department
Alice,Johnson,[email protected],Engineering
Bob,Smith,[email protected],Marketing
Carol,Williams,[email protected],Sales
3

Batch execute

npx @refrainai/cli execute -- \
  --runbook ./employee-registration.yaml \
  --data ./employees.csv

Why this works well

  • CSV-driven — Each row becomes one form submission. No code needed.
  • Self-healing — Form field changes are handled automatically.
  • Approval per row — Add requiresConfirmation to review each submission before it’s sent.
  • Scalable — Process hundreds or thousands of rows in a single batch run.

What’s next