メインコンテンツへスキップ

概要

Web フォームへのデータ入力は、あらゆる組織で最も繰り返しの多い作業のひとつです。新入社員の登録、取引先情報の入力、レガシーシステムへのレコード更新など、API がなければ手作業で一件ずつ入力するしかありません。 Refrain のバッチ実行機能は CSV の各行を読み込み、1 行ずつフォームに入力・送信します。自己修復するセレクタにより、フォームの UI が変わっても自動化が止まることはありません。

手順書の例

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: "{{ first_name }} {{ last_name }} の登録を送信しますか?"
  - action: wait
    selector: ".success-message"

生成と実行

1

手順書を生成する

npx @refrainai/cli generate -- \
  --url https://hr.example.com/employees/new \
  --goal "従業員登録フォームに入力して送信する" \
  --context ./context.md \
  --output ./employee-registration.yaml
2

CSV を準備する

first_name,last_name,email,department
太郎,山田,[email protected],エンジニアリング
花子,鈴木,[email protected],マーケティング
次郎,佐藤,[email protected],営業
3

バッチ実行する

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

Refrain が向いている理由

  • CSV 駆動 — 各行が 1 回のフォーム送信に。コード不要。
  • 自己修復 — フォームのフィールド変更にも自動対応。
  • 行ごとの承認requiresConfirmation で送信前に個別レビュー。
  • スケーラブル — 数百・数千行のバッチ処理にも対応。

次のステップ