Automations
Automations let you trigger actions based on specific events in Braintrust. This makes it easier for you to execute common actions and integrate Braintrust with your existing tools and workflows.
Automations are in beta. If you are on a hybrid deployment, automations are available starting with v0.0.72
.
How automations work
Automations work by monitoring events in your project and executing actions when specified conditions are met. At a high level the automation runtime will:
Monitor events in your project
Filter events using BTQL
Limit execution to once per time interval
Execute actions on matching data
Limitations
Currently, automations only support log events and webhook actions. More event types and actions coming soon.
Creating automations
To create an automation, select Add automation from the automations tab in your project configuration and input the automation name, a BTQL filter, time interval, and webhook URL.
Automation settings
- Name: A descriptive name for your automation
- Description (optional): Additional context about the automation's purpose
- Event type: Currently supports "Log event"
- BTQL filter: Filter logs using BTQL syntax (if empty, matches all logs)
- Interval: How frequently the automation should check for matching events
- Webhook URL: The endpoint that will receive the automation data
Testing automations
Before saving or updating an automation, you can test it to verify it works as expected. The test will trigger the automation as if the initiating event occurred and then run through the BTQL filter, interval, and execute the action on matching rows. If no matching logs are found, you may need to adjust your BTQL filter or interval. Note that your project must have recent matching logs within the automation interval in order for the test call to succeed.
Webhook payload
When an automation is triggered it sends a JSON payload to your webhook URL with the following structure: