LabsThis feature is in Labs.
How to access investigations
You can trigger an investigation from any of these surfaces:- Astro UI: From the Dags list, click a Dag to open its detail page, then select a failed run to trigger an investigation.
- Astro Observe homepage: Click Investigate next to a Dag to investigate its most recent failed run, or open a specific run in the Dag’s run history.
- Catalog: Open a Dag in the Catalog and select a failed run from its run history.
- Astro alerts: When a Dag failure alert fires, open the failed Dag run from the alert notification to start an investigation. See Set up Astro alerts.
- Astro API: Trigger an investigation programmatically, poll for status, and read the result. Combine this with the Dag Trigger notification channel on an Astro alert to investigate critical Dag failures automatically.
What Otto investigates
Otto draws on Airflow context (including Dag code and task logs), Astro context (including Deployment configuration, component logs, and recent deploys), and Observe context (including lineage, run history, and operational metrics). Organizations that use Astro Observe get a richer investigation, since Otto has access to lineage, the Asset Catalog, and operational metrics in addition to Airflow and Astro context.Apply a suggested fix
When an investigation completes, the What to change section of the investigation lists up to three suggested fixes in order. Each fix has a label that shows its type:- Code patch: A
git applycommand that applies a fix to one file in your Dag code. Otto checks that the patch applies to the code from the deploy that failed, and doesn’t show a patch that doesn’t apply. - Airflow: An Airflow operation to clear the failed task, clear the failed run, or trigger a new run. The fix links to the run or task in Airflow.
- Manual: Written instructions, for example a fix to a connection or Deployment configuration. If the instructions include an
astrocommand, the command contains the IDs from the investigation and<SET_ME>placeholders for values that Otto doesn’t know. Replace the placeholders before you run the command.
Continue an investigation in your local project
You can send a completed investigation to Otto in the Astro CLI, or to another coding agent, to fix the code in your local Astro project.-
To continue with Otto, click Copy Otto command on the investigation. Then run the command in your terminal from the Astro project that contains the Dag:
Otto starts a new interactive session seeded with the investigation’s diagnosis, and checks the root cause against your code before it makes the fix. If the investigation is still running, the command reports that and exits without starting a session. See
astro otto. - To continue with another agent, such as Claude Code or Cursor, click the arrow next to Copy Otto command and select Copy prompt for Claude Code, Cursor and other agents. Paste the prompt into your agent. The prompt contains the full diagnosis and instructions to fix it.
Run an automatic investigation
To automatically investigate your critical Dags as soon as they fail, configure Astro alerts to call the investigation API on Dag failure. Otto runs the investigation, and your investigation Dag handles the response.- Create a Dag that calls the investigation API and routes the response to the right downstream action.
- Deploy the Dag to Astro.
- Set up a Dag failure Astro alert that monitors your critical Dags.
- Set the notification channel to Dag Trigger and select the Dag you deployed in step 2.
- Optionally, tailor investigations by adding Otto investigation guidance at the Workspace or Deployment level. See Customize Otto investigation guidance.
- Notify: Post the investigation results to Slack, email, or another notification channel.
- Open a PR: Apply the suggested fix as a pull request.
- Open an incident: Create an incident in ServiceNow, PagerDuty, or another incident management system.
Example: Post the diagnosis to Slack
The following Dag accepts the Dag Trigger notification payload, calls the investigation API, reads the streamed diagnosis, and posts a Slack message with the root cause type, severity, summary, and suggested fix. Before deploying, configure these as Airflow variables or environment variables on the Deployment:astro_organization_idorASTRO_ORGANIZATION_ID: The ID of the Organization that owns the Deployment you investigate.astro_deployment_idorASTRO_DEPLOYMENT_ID: The ID of the Deployment you investigate.astro_api_tokenorASTRO_API_TOKEN: A Deployment API token with permission to read the Deployment.slack_webhook_urlorSLACK_WEBHOOK_URL: A Slack incoming webhook URL.slack_channelorSLACK_CHANNEL: Optional. The Slack channel to post to, if not the webhook’s default.
Customize Otto investigation guidance
You can add Otto investigation guidance at the Workspace or Deployment level to tailor investigations to your environment. For example, you can instruct Otto to treat tasks that begin withvalidate as non-blocking, or to interpret specific log patterns in a particular way. Deployments inherit Workspace guidance by default and can override it.
See Configure Otto investigation guidance for a Workspace and Configure Otto investigation guidance for a Deployment.