Skip to main content

Overview

Many SaaS tools provide dashboards with rich analytics but limited export or API options. Teams end up manually logging in, applying filters, and clicking “Export” every day or week. Refrain turns this into a one-time setup: generate a runbook that logs in, navigates to the right dashboard, applies filters, and downloads the CSV. Every subsequent run is deterministic — no AI tokens consumed.

Example runbook

name: daily-dashboard-export
url: https://app.example-saas.com/login
variables:
  - name: email
    source: secrets
  - name: password
    source: secrets
steps:
  - action: input
    selector: "#email"
    value: "{{ email }}"
  - action: input
    selector: "#password"
    value: "{{ password }}"
  - action: click
    selector: "#login-button"
  - action: wait
    selector: ".dashboard-container"
  - action: click
    selector: "[data-filter='last-7-days']"
  - action: wait
    timeout: 1500
  - action: click
    selector: ".export-button"
  - action: download
    selector: ".download-csv"

Generate and execute

1

Generate the runbook

npx @refrainai/cli generate -- \
  --url https://app.example-saas.com/login \
  --goal "Log in, filter to last 7 days, and export the dashboard as CSV" \
  --context ./context.md \
  --output ./dashboard-export.yaml
2

Execute the runbook

npx @refrainai/cli execute -- \
  --runbook ./dashboard-export.yaml \
  --secrets ./secrets.json \
  --output-dir ./exports
3

Schedule daily runs

Use the Web Console scheduler to run the export every morning.

Why this works well

  • Zero AI cost on reruns — The runbook replays deterministically after the initial generation.
  • Self-healing — Dashboard UI updates are handled automatically.
  • Download management — Exported files are organized in the output directory.
  • Scheduling — Integrate with the Web Console or your CI/CD pipeline for daily runs.

What’s next