Automate a weekly KPI report with AI

Every Monday a scheduled agent reads last week's signups, active users, revenue and churn and writes a short report with week-over-week change.

  • Read-only connection
  • Scheduled
  • Callback
  • Budget cap

Watch a real run

A real run on Oct 7, 2026, replayed. Model: openai/gpt-6-luna.

Input
{
  "period": "last_week"
}
Succeededrun_aed198aa926e2dba4128e136978b6768$0.002442 of $0.025
  1. Queuedbudget $0.025 reserved
  2. MicroVMmicroVM ready
  3. MicroVMworker started · shell off · web off
  4. Connectionanalytics GET /metrics?period=last_week
  5. Resultanalytics GET → 200
  6. MicroVMmicroVM destroyed
  7. Succeeded2 model calls, 2,479 tokensRecorded output (English)

    Weekly business report — 2026-W40

    • Signups: 294 (+98)
    • Active users: 2,803 (+282)
    • Revenue: $22,853.85 (−$546.85)
    • Churned accounts: 8 (no change)
  8. Worker destroyed$0.002442 charged, $0.022558 released
Model $0.000242 · Web $0.00 · Compute $0.0022

Run it yourself

Open the sample in the playground with the whole request filled in. It runs on your own account, within the budget shown, against the same read-only sample systems.

Budget for this sample: $0.025

How it works

The agent reads an analytics API through a read-only connection and writes a report under 150 words that you can post to chat or email. The schedule has its own time zone. Each run costs a fraction of a cent.

What the agent can and cannot do

The permissions are part of the request. Anything not listed here is not available to the run.

SettingAllowed
Connections
analytics: GET only, at ephemer.al/api/samples/analytics-api
WebOff
ShellOff
FilesNone
Zero data retentionOff: the record is kept for 30 days
Budget$0.025, a hard cap
Timeout60 seconds

Credentials never enter the machine: a broker adds them to each call and enforces the methods above.

The code

This is the exact request the sample sends. Set EPHEMERAL_API_KEY to a member key of your organization.

curl -X POST $EPHEMERAL_URL/v1/runs \
  -H "Authorization: Bearer $EPHEMERAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d @request.json
Full request body workflow.json

The same body, with the files inline.

workflow.json
{
  "prompt": "Write the weekly business report for input.period. Call GET /metrics?period=<input.period> on the analytics connection and use only what it returns. Reply in Markdown, at most 150 words: a one-line headline, then signups, active users, revenue in dollars and churned accounts, each with the change from the week before. If the call fails, say so instead of estimating.",
  "connections": {
    "analytics": {
      "type": "http",
      "url": "https://ephemer.al/api/samples/analytics-api",
      "auth": {
        "type": "bearer",
        "token": "sample_read_key"
      },
      "allowed_methods": [
        "GET"
      ],
      "instructions": "GET /metrics?period=last_week or period=2026-W40 returns signups, active_users, revenue_cents and churned_accounts for that ISO week, with the same figures for the week before. Amounts are in cents."
    }
  },
  "shell": false,
  "timeout_seconds": 60
}

This sample runs on a timetable: 0 9 * * 1 in Asia/Tokyo. A schedule starts a saved workflow, so save the request as a workflow first, then create the schedule.

Read more

Related samples

esc

Nothing matches “”.