GeezerVison is showing docs.braintrust.dev — Run Loop on a schedule - Braintrust Loop automations investigate project data on a schedule, such as changes in cost, quality, or errors. Choose a Digest for recurring summaries, a Scheduled task for a custom investigation, or a pattern rule to discover and maintain patterns. Send results to Slack, PagerDuty, or a webhook.
Creating custom scheduled tasks and digests requires Starter with on-demand usage enabled, Pro, or Enterprise. Without it, you can still edit or pause existing automations and create Patterns rules.
Each digest, scheduled task, and pattern rule consumes Braintrust credits, including when it uses your own provider key. Model and reasoning effort choices affect consumption. Review these settings alongside the schedule and query range when configuring recurring work.
Create a digest
Digests summarize project activity on a schedule. They can report changes in quality, cost, or user behavior, with links to supporting traces. Unlike pattern alerts, a Digest sends a scheduled summary even when there are no significant changes.
- Go to Settings > Digests and click Digest.
- Enter a Name and optional Description.
- In Agent instruction, describe what to summarize, or select a suggested prompt and adapt it.
- Choose a Writing style: Compact (the default) for metrics, highlights, and trace links, or Detailed for more explanation and next steps.
- Set the Schedule to determine how often the Digest runs and how far back it looks.
- Under Destinations, add at least one Slack channel, PagerDuty integration, or webhook. Webhooks support custom and encrypted headers.
- Review Preview final prompt, then click Create.
To read a completed Digest or ask follow-up questions, review its past runs.
Create a scheduled task
Scheduled tasks run custom investigations with a schedule, query range, and permission to make specific changes.
- Go to Settings > Scheduled tasks and click Scheduled task.
- Enter a Name and optional Description.
- In Agent instruction, describe what to investigate and what to return. Use the recipes for examples.
- Set the Schedule to determine how often the task runs.
- Set Default query range to determine how far back each run looks, up to 30 days. Each run examines the full range, including previously analyzed traces.
-
Under Write tool permissions, select only the tools the task needs to create or edit objects. Reading project data doesn’t require approval.
Enabled Braintrust writes run without asking for approval. All tools from connected project MCP servers are also available without approval, including in pattern rules. Restrict their access through the shared API key or OAuth account’s permissions.Allowing online scoring rules can start ongoing scoring costs that continue until you stop those rules.
Permissions and ongoing effects
Scheduled tasks, digests, and pattern rules use the permissions of the project’s automatically created Loop automation service account. They don’t inherit the creator’s permissions. For cross-project investigations, grant that account read access to each target project. See Automation service accounts.
- Braintrust objects: Enable the corresponding write tools. Pattern rules can create and update patterns. They can also create preprocessors in the project and save one for the rule without approval.
- GitHub repositories: Runs can read code, pull requests, and CI checks from connected repositories. GitHub writes require an interactive thread.
- Online scoring rules: Runs can create or update rules when permitted. These rules score production traffic continuously, including after the automation run ends.
- Created objects: Objects aren’t linked to any pattern the run recorded. If a pattern’s monitor chart measures a scorer or facet the run created, deleting that object stops new data from reaching the chart.
- Optionally add a Slack channel, PagerDuty integration, or webhook under Destinations. Webhooks support custom and encrypted headers. Use Formatting prompt to customize the message or webhook JSON.
- Click Create, then Run now to test the task and review its results in Past runs.
Run and delivery timing
Daily and weekly Loop automations that send only to Slack can start up to an hour early to prepare results for their scheduled delivery time. Their run timestamps and query windows reflect when they execute, not when the message arrives. Results that aren’t ready by the scheduled time arrive later.
Run an automation now
A manual run lets you test an instruction or get results without waiting for the schedule. The next scheduled run still happens at its usual time. You need project Update permission, and you can’t run a paused automation.
To run a saved automation, open it and click Run now. What happens depends on whether the automation is continuous:
- Without continuous mode: Braintrust starts a one-off run in a new thread. The run covers the most recent query range, ending at the current time minus any evaluation delay.
- With continuous mode: Loop continues the current thread when new traces are ready for analysis. Otherwise, or if there’s no current run, Braintrust starts a full run in a new thread. If a run is already in progress, nothing new starts.
To open the run’s thread once it starts, go to the automation’s Past runs tab.
To start a full run in a new thread for a continuous automation, click next to Run now and select Run in new thread. Later checks continue that new thread. This option appears only for continuous automations.
How continuous checks work
For scheduled tasks, Continuous is off by default. It checks for new traces between scheduled runs. Enable it in Schedule. To turn it off, choose a schedule option again. Your existing schedule still controls full runs, each in a new thread.When new traces are ready for analysis, Loop analyzes them in the current run’s thread and sends only significant new findings to your destinations, not a full report.Pattern rules always check for new traces between full investigations, and their schedule can’t be changed.Continuous isn’t available for digests or for automations with a threshold condition.
Coding agents can also run a saved automation with the run_scheduled_loop_job tool on the Braintrust MCP server. It works like Run now: it requires project Update permission, and it can’t run a paused automation or start the run in a new thread. The tool only confirms that the run was submitted, so review the output on the Past runs tab.
A run started from the MCP server sends results to the automation’s configured destinations, such as Slack, webhooks, or PagerDuty. Calling the tool again to check progress can start another run and deliver duplicate results.
Loop automation recipes
Use Digests for recurring summaries or scheduled tasks when you need custom query ranges or write permissions. Each recipe identifies its type and includes settings and an instruction you can adapt.
Sends a brief summary of recent activity and notable problems to Slack.| Field | Value |
|---|
| Type | Digest | | Schedule | Daily | | Writing style | Compact | | Destinations | Slack |
Summarize this project's activity over the digest's query window. Include
trace volume, recorded errors, and the main tasks users asked the agent to do.
Highlight problems worth investigating and link to representative traces.
If there are no notable problems, say so. Report missing data rather than
inferring results we haven't logged.
Weekly user-friction digest
Summarizes where users struggle, with evidence and suggested follow-up work.| Field | Value |
|---|
| Type | Digest | | Schedule | Weekly | | Writing style | Detailed | | Destinations | Slack |
Review traces in the digest's query window for repeated requests, corrections,
and tasks left unfinished. Group recurring problems and link to representative
traces. Distinguish visible evidence from possible explanations: a conversation
ending doesn't by itself mean the user gave up. Suggest the most useful
follow-up investigation for each problem, or say when the evidence is unclear.
Posts a cost breakdown to Slack every Monday morning.| Field | Value |
|---|
| Type | Scheduled task | | Schedule | Weekly, Mondays at 9:00 AM | | Default query range | 7 days | | Write tool permissions | None. The run only reads and reports. | | Destinations | Slack |
Create a weekly estimated-cost report for this project.
Periods:
- Use the automation's seven-day window as the current period.
- Compare it with the immediately preceding seven days.
- State both UTC date ranges in the report.
Cost by user:
- Query project logs separately for each period.
- Group by `span_attributes.created_by_user_id` and sum `metrics.estimated_cost`.
- Keep null creator IDs as `Unattributed`, and never guess a name.
Return only:
1. A Markdown table with columns `User`, `Past 7 days`, `Prior 7 days`, `Change`.
2. One sentence summarizing the total week-over-week change.
3. A short paragraph on which work drove the spend, based on the highest-cost
traces in the window. Describe the tasks, not the people.
Compares existing quality scores with the previous day and investigates possible regressions. This example uses scores.factuality, with higher values indicating better quality. Replace it with a score your project already records and adjust the direction if lower values are better.| Field | Value |
|---|
| Type | Scheduled task | | Schedule | Daily | | Default query range | 1 day | | Write tool permissions | None. The run only reads and reports. | | Destinations | Slack |
Review factuality in this project's logs for signs of degrading quality.
Compare:
- Use the automation's one-day window and the immediately preceding day.
- State both UTC date ranges. For each period, report the average of
`scores.factuality` and the number of scored rows. Higher scores are better.
- Exclude missing scores from the average and report how many rows lack scores.
- If either period has no scores, report that the comparison is unavailable.
Investigate:
- If the average falls, inspect up to 10 low-scoring traces from the current
period and up to 10 scored traces from the previous period.
- Check whether the tasks or traffic mix changed. Distinguish observed score
changes from possible causes, and do not treat a small sample as proof.
- Use existing scores only. Do not run scorers or create scoring rules.
Return a comparison table, a short summary of the evidence and its limitations,
and up to three representative trace links with suggested follow-up checks.
Summarizes errors in the same subset of logs you monitor on a dashboard. Replace metadata.environment = 'production' with the filter conditions from your dashboard. Include the conditions in the instruction so the run has the scope it needs.| Field | Value |
|---|
| Type | Scheduled task | | Schedule | Daily | | Default query range | 1 day | | Write tool permissions | None. The run only reads and reports. | | Destinations | Slack |
Summarize recent errors for the production environment in this project.
Scope:
- Use the automation's one-day window and state the UTC date range.
- Select traces matching `metadata.environment = 'production'` and inspect
their spans for recorded errors. If the field is unavailable, report that
the scope cannot be applied instead of broadening the search.
Investigate:
- Group similar recorded errors and count distinct affected root traces in
each group. Do not count repeated errors in one trace as separate incidents.
- Inspect up to three representative traces from each of the five largest
groups. Check whether the operation recovered later in the trace.
- Distinguish recorded errors from confirmed failures visible to the end user.
If the outcome is unclear, say so. Do not guess a root cause.
Return a table with each error group, its affected trace count, and a
representative trace link, followed by suggested follow-up checks.
If there are no recorded errors in scope, say so rather than inventing groups.
Focused pattern discovery
Narrows pattern discovery to one concern, using an existing facet to choose which traces to investigate. Run this alongside the default Pattern discovery rule when a specific area deserves its own cadence.| Field | Value |
|---|
| Type | Scheduled task | | Schedule | Daily | | Default query range | 7 days | | Write tool permissions | Create and update patterns | | Destinations | Optional |
Analyze recent project traces to find recurring failures within the existing
"Primary failure mode" facet's topic classifications.
Use the facet and its topic classifications only to select candidates. They are
noisy, and are not evidence by themselves.
Workflow:
1. Use the automation window.
2. Collect a sample of 100-200 facet occurrences, spread across the available
topic classifications rather than only the newest or largest cluster.
3. Cap the sample at two occurrences per root trace, and deduplicate repeated
facet runs and copies of the same underlying conversation.
4. For each candidate, inspect the compact context around the occurrence: the
user request, agent actions, tool results, and outcome.
5. Validate every proposed pattern against raw trace evidence. Reject any
hypothesis explained by explicit user direction, a permission or environment
block, or intentional fail-fast behavior.
Record a pattern only when it describes a specific recurring behavior, is
supported by at least three independent conversations, has a meaningful impact
and an actionable response, and includes short quotes and relevant span IDs.
Review past runs
Open the automation, select Past runs, and select a run to review the work Loop did. Pattern rules don’t show past runs.
- Run history: Each run creates a read-only thread that stays with its automation. These threads don’t appear in the Loop page’s thread list and can’t be deleted like interactive threads. Coding agents can list these runs and their links with the
list_scheduled_loop_job_runs tool on the Braintrust MCP server.
- Follow-up questions: Select Fork to chat to copy the transcript into a private, editable thread where you can investigate the run. The fork doesn’t send reports to the automation’s destinations, but patterns it creates or reopens can trigger project alerts.
- Failed runs: Select Retry & continue to resubmit the latest failed turn in the same thread. This action applies to a failed automation run, not a delivery request from an interactive fork. Retry requires project Update permission and expires four days after the run. It uses the run’s original settings and saved destinations, even if you’ve changed the automation.
Pause an automation
Pause an automation to stop its scheduled runs while keeping its configuration and history. Do this when you’re tuning an instruction, controlling spend, or investigating a run that behaved unexpectedly. Objects its runs already created stay in your project.
To pause, open the automation and turn off Active. The automation then shows as Paused on its Scheduled tasks or Digests Settings page. Turn Active back on to resume the schedule.
Pausing an automation does not cancel Slack messages that are already scheduled for delivery.
Unavailable automations. The automation list marks an automation that can’t run with a warning indicator. Open it to see a banner with the reason:
- Default provider unavailable: The automation has Auto on and the default provider can’t serve it. Click Configure default to update the default, or turn off Auto and choose another provider.
- Credit limit reached: On Starter without on-demand usage, automations stop running when Braintrust credits run out, even with your own provider key. Enable on-demand usage to continue, or wait for the next monthly allowance. Pattern rules skip runs while credits are exhausted and resume automatically when credits are available again.
- Provider unavailable: The selected built-in model is unavailable, or built-in models are disabled for your organization. Click AI provider settings to review your providers, or Add provider if your organization has no configured providers.
Delete an automation
Deleting an automation is permanent and does not cancel Slack messages that are already scheduled for delivery. If you might want the automation again, pause it instead.
To delete an automation, open its Scheduled tasks or Digests Settings page and delete it from the list.
Deleting an automation doesn’t affect the objects its runs already created. Patterns, scorers, facets, and other objects a run produced remain in your project, and any online scoring rules a run created keep running until you stop them separately.
Next steps
|