trigger_dag_and_wait
Trigger an Apache Airflow DAG run and wait for its completion, returning the final state and details of any failed tasks. Blocks until the run ends or times out (default 60 minutes).
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:
Trigger the specified DAG
Poll for status automatically (interval scales with timeout)
Return once the DAG run reaches a terminal state (success, failed, upstream_failed)
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
| Name | Required | Description | Default |
|---|---|---|---|
| dag_id | Yes | ||
| conf | No | ||
| timeout | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |