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.
{
"period": "last_week"
}- Queuedbudget $0.025 reserved
- MicroVMmicroVM ready
- MicroVMworker started · shell off · web off
- Connectionanalytics GET /metrics?period=last_week
- Result
analytics GET → 200 - MicroVMmicroVM destroyed
- 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)
- Worker destroyed$0.002442 charged, $0.022558 released
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.
| Setting | Allowed |
|---|---|
| Connections | analytics: GET only, at ephemer.al/api/samples/analytics-api |
| Web | Off |
| Shell | Off |
| Files | None |
| Zero data retention | Off: the record is kept for 30 days |
| Budget | $0.025, a hard cap |
| Timeout | 60 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.jsonFull request body workflow.json
The same body, with the files inline.
{
"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.