Skip to main content
LabsThis feature is in Labs.
Otto investigates Dag failures on Astro using proprietary Airflow, Astro, and Observe context that no general-purpose agent has access to. Each investigation produces a structured diagnosis with a root cause type, severity, suggested fix, and a checklist of Dag- and task-level checks. This page covers Otto investigations that run in the Astro control plane and are triggered from the Astro UI, Astro alerts, or the Astro API. To investigate a Dag failure interactively from the terminal, ask Otto in the Astro CLI. See Otto overview. Astronomer recommends wiring a Dag failure to an investigation automatically. The diagnosis is ready before your team starts triaging, and it can route the failure to the right escalation or remediation path.

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 apply command 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 astro command, 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.
To copy a command, click Copy code in the corner of its code block. Run a code patch command from the root of your Astro project. If Otto finds a root cause but no specific change, the investigation shows a written suggested fix instead.

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.
  1. Create a Dag that calls the investigation API and routes the response to the right downstream action.
  2. Deploy the Dag to Astro.
  3. Set up a Dag failure Astro alert that monitors your critical Dags.
  4. Set the notification channel to Dag Trigger and select the Dag you deployed in step 2.
  5. Optionally, tailor investigations by adding Otto investigation guidance at the Workspace or Deployment level. See Customize Otto investigation guidance.
When a critical Dag fails, the alert fires, the Dag Trigger channel calls your investigation Dag, and Otto returns the diagnosis for downstream handling. Common downstream actions include:
  • 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_id or ASTRO_ORGANIZATION_ID: The ID of the Organization that owns the Deployment you investigate.
  • astro_deployment_id or ASTRO_DEPLOYMENT_ID: The ID of the Deployment you investigate.
  • astro_api_token or ASTRO_API_TOKEN: A Deployment API token with permission to read the Deployment.
  • slack_webhook_url or SLACK_WEBHOOK_URL: A Slack incoming webhook URL.
  • slack_channel or SLACK_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 with validate 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.