> ## Documentation Index
> Fetch the complete documentation index at: https://docs.therefrain.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Scheduled Dashboard Export

> Log in to SaaS dashboards and export CSV reports on a schedule with zero AI cost.

## 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

```yaml theme={null}
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

<Steps>
  <Step title="Generate the runbook">
    ```bash theme={null}
    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
    ```
  </Step>

  <Step title="Execute the runbook">
    ```bash theme={null}
    npx @refrainai/cli execute -- \
      --runbook ./dashboard-export.yaml \
      --secrets ./secrets.json \
      --output-dir ./exports
    ```
  </Step>

  <Step title="Schedule daily runs">
    Use the [Web Console scheduler](/console/schedules) to run the export every morning.
  </Step>
</Steps>

## 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

<CardGroup cols={2}>
  <Card title="Execute a runbook" icon="play" href="/guides/execute-runbook">
    Learn about download and export options.
  </Card>

  <Card title="Variables and secrets" icon="key" href="/guides/variables-and-secrets">
    Securely manage dashboard credentials.
  </Card>
</CardGroup>
