Skip to main content
Glama
astronomer

astro-airflow-mcp

Official
by astronomer

trigger_dag_and_wait

Trigger an Airflow DAG run and wait for completion to return final status and any failed task details. This blocking operation automatically polls until the DAG reaches a terminal state.

Instructions

Trigger a DAG run and wait for it to complete before returning.

Use this tool when the user asks to:

  • "Run DAG X and wait for it to finish" or "Execute DAG Y and tell me when it's done"

  • "Trigger DAG Z and wait for completion" or "Run this pipeline synchronously"

  • "Start DAG X and let me know the result" or "Execute and monitor DAG Y"

  • "Run DAG X and show me if it succeeds or fails"

This is a BLOCKING operation that will:

  1. Trigger the specified DAG

  2. Poll for status automatically (interval scales with timeout)

  3. Return once the DAG run reaches a terminal state (success, failed, upstream_failed)

  4. Include details about any failed tasks if the run was not successful

IMPORTANT: This tool blocks until the DAG completes or times out. For long-running DAGs, consider using trigger_dag instead and checking status separately with get_dag_run.

Default timeout is 60 minutes. Adjust the timeout parameter for longer DAGs.

Returns information about the completed DAG run including:

  • dag_id: Which DAG was run

  • dag_run_id: Unique identifier for this execution

  • state: Final state (success, failed, upstream_failed)

  • start_date: When execution started

  • end_date: When execution completed

  • elapsed_seconds: How long we waited

  • timed_out: Whether we hit the timeout before completion

  • failed_tasks: List of failed task details (only if state != success)

Args: dag_id: The ID of the DAG to trigger (e.g., "example_dag") conf: Optional configuration dictionary to pass to the DAG run. This will be available in the DAG via context['dag_run'].conf timeout: Maximum time to wait in seconds (default: 3600.0 / 60 minutes)

Returns: JSON with final DAG run status and any failed task details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dag_idYes
confNo
timeoutNo

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/astronomer/astro-airflow-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server