El 15 de septiembre de 2026, todos los entornos de Cloud Composer 1 y Cloud Composer 2 versión 2.0.x alcanzarán el final de su ciclo de vida previsto, y no podrás usarlos. Te recomendamos que planifiques la migración a Cloud Composer 3.
En esta página, se explica cómo habilitar la compatibilidad con operadores diferibles en tu entorno y usar operadores Google Cloud diferibles en tus DAG.
Acerca de los operadores diferidos en Cloud Composer
Si tienes al menos una instancia de activador (o al menos dos en entornos altamente resilientes), puedes usar operadores y activadores diferibles en tus DAG.
En el caso de los operadores aplazables, Airflow divide la ejecución de tareas en las siguientes etapas:
Inicia la operación. En esta etapa, la tarea ocupa un espacio de trabajador de Airflow. La tarea realiza una operación que delega la tarea a un servicio diferente.
Por ejemplo, ejecutar un trabajo de BigQuery puede tardar desde unos segundos hasta varias horas. Después de crear el trabajo, la operación
pasa el identificador de trabajo (ID de trabajo de BigQuery) a un
activador de Airflow.
El activador supervisa el trabajo hasta que finaliza. En esta etapa, no se ocupa un espacio de trabajador. El activador de Airflow tiene una arquitectura asincrónica y puede controlar cientos de trabajos de este tipo. Cuando el activador detecta que la tarea finalizó, envía un evento que activa la última etapa.
En la última etapa, un trabajador de Airflow ejecuta una devolución de llamada. Por ejemplo, esta devolución de llamada puede marcar la tarea como correcta, ejecutar otra operación y configurar el trabajo para que el activador lo supervise nuevamente.
El activador no tiene estado y, por lo tanto, es resistente a interrupciones o reinicios. Debido a esto, las tareas de larga duración son resistentes a los reinicios de pods, a menos que el reinicio se produzca durante la última etapa, que se espera que sea breve.
Antes de comenzar
Los operadores y sensores diferidos están disponibles en los entornos de Cloud Composer 2 y requieren lo siguiente:
Cloud Composer 2.0.31 y versiones posteriores
Airflow 2.2.5, 2.3.3 y versiones posteriores
Habilita la compatibilidad con operadores aplazables
Un componente del entorno llamado activador de Airflow supervisa de forma asincrónica todas las tareas diferidas de tu entorno. Después de que se completa una operación diferida de una tarea de este tipo, el activador pasa la tarea a un trabajador de Airflow.
OperadoresGoogle Cloud que admiten el modo diferido
Solo se extendieron algunos operadores de Airflow para admitir el modelo aplazable.
La siguiente lista es una referencia para los operadores del paquete airflow.providers.google.operators.cloud que admiten el modo diferido.
La columna con la versión mínima de paquete airflow.providers.google.operators.cloud requerida representa la versión de paquete más antigua en la que ese operador admite el modo diferido.
Operadores de Cloud Composer
Nombre del operador
Versión de apache-airflow-providers-google requerida
Una convención común para todos los operadores Google Cloud es habilitar el modo aplazable con el parámetro booleano deferrable. Si un operador Google Cloudno tiene este parámetro, no se puede ejecutar en el modo diferido. Otros operadores pueden tener una convención diferente. Por ejemplo, algunos operadores de la comunidad tienen una clase independiente con el sufijo Async en el nombre.
En el siguiente ejemplo de DAG, se usa el operador DataprocSubmitJobOperator en el modo diferido:
El activador genera registros que están disponibles junto con los registros de otros componentes del entorno. Para obtener más información sobre cómo ver los registros de tu entorno, consulta Visualiza los registros.
Activador de supervisión
Para obtener más información sobre la supervisión del componente activador, consulta Métricas de Airflow.
Además de supervisar el activador, puedes verificar la cantidad de tareas diferidas en las métricas de Tarea sin terminar en el panel de supervisión de tu entorno.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-08-29 (UTC)"],[[["\u003cp\u003eDeferrable Operators in Cloud Composer 2 allow for splitting task execution into stages, freeing up worker slots during long-running operations by using Airflow triggerers to monitor jobs.\u003c/p\u003e\n"],["\u003cp\u003eTo use deferrable operators, environments require at least one Airflow triggerer instance, which can be configured during environment creation or by adjusting an existing environment.\u003c/p\u003e\n"],["\u003cp\u003eDeferrable mode is enabled by using the boolean \u003ccode\u003edeferrable\u003c/code\u003e parameter in supported Google Cloud operators, with specific operators and required package versions listed for Cloud Composer, BigQuery, Cloud Build, Cloud SQL, Dataflow, Cloud Data Fusion, Dataproc, Google Kubernetes Engine, and AI Platform.\u003c/p\u003e\n"],["\u003cp\u003eThe Airflow triggerer is stateless, making long-running jobs resilient to interruptions and restarts, and you can monitor triggerer performance using Airflow metrics and view triggerer logs alongside other environment component logs.\u003c/p\u003e\n"],["\u003cp\u003eSupport for deferrable operators requires Cloud Composer 2.0.31 or later and Airflow 2.2.5, 2.3.3, or later versions, and triggerers are not synchronized with the dags or plugins folders.\u003c/p\u003e\n"]]],[],null,["# Use deferrable operators in Airflow DAGs\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\n[Cloud Composer 3](/composer/docs/composer-3/use-deferrable-operators \"View this page for Cloud Composer 3\") \\| **Cloud Composer 2** \\| Cloud Composer 1\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nThis page explains how to enable support for Deferrable Operators in your\nenvironment and use deferrable Google Cloud operators in your DAGs.\n\nAbout Deferrable Operators in Cloud Composer\n--------------------------------------------\n\nIf you have at least one triggerer instance (or at least two in\n[highly resilient environments](/composer/docs/composer-2/set-up-highly-resilient-environments)), you can use\n[Deferrable Operators and Triggers](https://airflow.apache.org/docs/apache-airflow/stable/concepts/deferring.html) in your DAGs.\n\nFor deferrable operators, Airflow splits task execution into the following stages:\n\n1. Start the operation. In this stage, the task occupies an Airflow worker\n slot. The task performs an operation that delegates the job to a\n different service.\n\n For example, running a BigQuery job can take from a few\n seconds to several hours. After creating the job, the operation\n passes the work identifier (BigQuery job ID) to an\n Airflow trigger.\n2. The trigger monitors the job until it finishes. In this stage, a\n worker slot is not occupied. The Airflow triggerer has asynchronous\n architecture and is capable of handling hundreds of such jobs. When the\n trigger detects that the job is finished, it sends an event that triggers\n the last stage.\n\n3. In the last stage, an Airflow worker executes a callback. This callback, for\n example, can mark the task as successful, or execute another operation and\n set the job to be monitored by the triggerer again.\n\nThe triggerer is stateless and therefore resilient to interruptions or\nrestarts. Because of this, long-running jobs are resilient to pod restarts,\nunless the restart happens during the last stage, which is expected to be short.\n\nBefore you begin\n----------------\n\n- In Cloud Composer 2, Deferrable Operators and Sensors require the following:\n\n - Cloud Composer version 2.0.31 and later versions\n - Airflow 2.2.5, 2.3.3, and later versions\n\n| **Caution:** Terraform provider support for Airflow triggerers is in Preview. Use the `google-beta` Terraform provider when changing scale and performance parameters of your environment, even if these changes are not related to the triggerer. For example, when changing parameters for Airflow workers.\n\nEnable support for deferrable operators\n---------------------------------------\n\nAn environment component called *Airflow triggerer* asynchronously monitors all\ndeferred tasks in your environment. After a deferred operation from such a task\nis completed, triggerer passes the task to an Airflow worker.\n\nYou need at least one triggerer instance in your environment (or at least two\nin highly resilient environments) to use deferrable mode in your DAGs.\nYou can configure the triggerers\n[when you create an environment](/composer/docs/composer-2/create-environments#scale-and-performance) or\n[adjust the number of triggerers and performance parameters for an existing environment](/composer/docs/composer-2/scale-environments#triggerer-parameters).\n\n### Google Cloud operators that support deferrable mode\n\nOnly some Airflow operators have been extended to support the deferrable model.\nThe following list is a reference for the operators in the\n[`airflow.providers.google.operators.cloud`](https://airflow.apache.org/docs/apache-airflow-providers-google/stable/operators/cloud/#)\npackage that support the deferrable mode.\nThe column with the minimum required `airflow.providers.google.operators.cloud`\npackage version represents the earliest package version where that operator\nsupports deferrable mode.\n| **Important:** The following tables **don't list every operator that supports deferrable mode** . Many other operators from `airflow.providers.google.operators.cloud` and other provider packages are supported by Airflow and Cloud Composer. These operators are not described on this page. To check if a particular operator supports deferrable mode, see its [Provider package documentation](https://airflow.apache.org/docs/#providers-packages-docs-apache-airflow-providers-index-html) provided by Airflow.\n| **Note:** BigQuery operators in defferable mode **fail if the\nlocation is not set to US** . This happens because of [a bug](https://github.com/apache/airflow/issues/29307) in a dependency of Airflow, not in BigQuery operators. \n\n#### Cloud Composer operators\n\n#### BigQuery operators\n\n#### BigQuery Data Transfer Service operators\n\n#### Cloud Build operators\n\n#### Cloud SQL operators\n\n#### Dataflow operators\n\n#### Cloud Data Fusion operators\n\n#### Dataproc operators\n\n#### Google Kubernetes Engine operators\n\n#### AI Platform operators\n\nUse deferrable operators in your DAGs\n-------------------------------------\n\nA common convention for all Google Cloud operators is to enable the\ndeferrable mode with the `deferrable` boolean parameter. If a Google Cloud\noperator does not have this parameter, then it cannot run in the deferrable\nmode. Other operators can have a different convention. For example, some\ncommunity operators have a separate class with the `Async` suffix in the\nname.\n| **Important:** The `dags/` and `/plugins` folders from your environment bucket are not synchronized to the triggerer. You can use triggers that are installed with [PyPI packages](/composer/docs/composer-2/install-python-dependencies), or included in a preinstalled provider package.\n\nThe following example DAG uses `DataprocSubmitJobOperator` operator in the\ndeferrable mode: \n\n PYSPARK_JOB = {\n \"reference\": { \"project_id\": \"\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\" },\n \"placement\": { \"cluster_name\": \"\u003cvar translate=\"no\"\u003ePYSPARK_CLUSTER_NAME\u003c/var\u003e\" },\n \"pyspark_job\": {\n \"main_python_file_uri\": \"gs://dataproc-examples/pyspark/hello-world/hello-world.py\"\n },\n }\n\n DataprocSubmitJobOperator(\n task_id=\"dataproc-deferrable-example\",\n job=PYSPARK_JOB,\n deferrable=True,\n )\n\nView triggerer logs\n-------------------\n\nThe triggerer generates logs that are available together with logs of other\nenvironment components. For more information about viewing your environment\nlogs, see [View logs](/composer/docs/composer-2/view-logs#streaming).\n\nMonitor triggerer\n-----------------\n\nFor more information about monitoring the triggerer component, see\n[Airflow metrics](/composer/docs/composer-2/monitor-environments#airflow-metrics).\n\nIn addition to monitoring the triggerer, you can check the number of deferred\ntasks in the **Unfinished Task** metrics on the Monitoring dashboard of your\nenvironment.\n\nWhat's next\n-----------\n\n- [Troubleshooting Airflow triggerer issues](/composer/docs/composer-2/troubleshooting-triggerer)\n- [Airflow triggerer metrics](/composer/docs/composer-2/monitor-environments#airflow-metrics)\n- [Airflow triggerer logs](/composer/docs/composer-2/view-logs#streaming)"]]