Descripción general de las plantillas de flujo de trabajo de Dataproc
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
La API de plantillas de flujo de trabajo de Dataproc proporciona un mecanismo fácil de usar y flexible para administrar y ejecutar flujos de trabajo. Una plantilla de flujo de trabajo es una configuración reutilizable de flujo de trabajo. Define un grafo de trabajos con información sobre dónde ejecutar esos trabajos.
Si el flujo de trabajo usa un clúster administrado, crea el clúster, ejecuta los trabajos y, luego, borra el clúster cuando finalizan los trabajos.
Si el flujo de trabajo usa un selector de clúster, ejecuta trabajos en un clúster seleccionado existente.
Los flujos de trabajo son ideales para flujos de trabajo complejos. Puedes crear dependencias de trabajo de manera tal que un trabajo comience solo después de que las dependencias se completen con éxito.
Cuando crea una plantilla de flujo de trabajo, Dataproc no crea un clúster ni envía trabajos a un clúster.
Dataproc crea o selecciona un clúster y ejecuta trabajos de flujo de trabajo en él cuando se crea una instancia de una plantilla de flujo de trabajo.
Tipos de plantillas de flujo de trabajo
Clúster administrado
Una plantilla de flujo de trabajo puede especificar un clúster administrado. El flujo de trabajo creará un clúster “efímero” para ejecutar trabajos de flujo de trabajo y, luego, borrará el clúster cuando finalice el flujo de trabajo.
Selector de clústeres
Una plantilla de flujo de trabajo puede especificar un clúster existente en el que ejecutar trabajos de flujo de trabajo mediante la especificación de una o más etiquetas de usuario que se adjuntaron antes al clúster. El flujo de trabajo se ejecutará en un clúster que coincida con todas las etiquetas. Si varios clústeres coinciden con todas las etiquetas, Dataproc selecciona el clúster con la mayor disponibilidad de memoria YARN para ejecutar todos los trabajos de flujo de trabajo. Al final del flujo de trabajo, Dataproc no borra el clúster seleccionado. Consulta Cómo usar selectores de clúster con flujos de trabajo para obtener más información.
Parametrizado
Si quieres ejecutar una plantilla de flujo de trabajo muchas veces con valores diferentes, usa parámetros para evitar editar la plantilla en cada ejecución:
Define parámetros en la plantilla y, luego,
pasar diferentes valores para los parámetros en cada ejecución
Automatización de tareas repetitivas. Los flujos de trabajo encapsulan las configuraciones y los trabajos de clúster de uso frecuente.
Modelo de interacción de la API transaccional, enviar y olvidar Las plantillas de flujo de trabajo reemplazan los pasos involucrados en un flujo típico, que incluyen los siguientes:
Creación del clúster
Enviar trabajos
sondeo
Se borra el clúster.
Las plantillas de flujo de trabajo usan un solo token para hacer un seguimiento del progreso desde la creación hasta la eliminación del clúster, y automatizan el control y la recuperación de errores. También simplifican la integración de Dataproc con otras herramientas, como Cloud Run Functions y Cloud Composer.
Asistencia para clústeres longevos y efímeros. Una complejidad común asociada con la ejecución de Apache Hadoop ajusta y acomoda el tamaño correcto de los clústeres.
Los clústeres efímeros (administrados) son más fáciles de configurar debido a que ejecutan un solo flujo de trabajo. Los selectores de clúster se pueden usar con clústeres longevos para ejecutar varias veces la misma carga de trabajo sin incurrir en el costo amortizado de crear y borrar clústeres.
Seguridad de IAM detallada. La creación de clústeres de Dataproc y el envío de trabajos requieren permisos de IAM de todo o nada.
Las plantillas de flujo de trabajo usan un permiso workflowTemplates.instantiate por plantilla y no dependen de permisos de clúster o trabajo.
[[["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-09-04 (UTC)"],[[["\u003cp\u003eWorkflow Templates offer a reusable configuration for defining a series of jobs in a Directed Acyclic Graph (DAG), streamlining the management and execution of workflows.\u003c/p\u003e\n"],["\u003cp\u003eInstantiating a Workflow Template initiates a Workflow, which either creates an ephemeral cluster, runs the jobs, and then deletes the cluster, or utilizes a pre-existing cluster selected via labels.\u003c/p\u003e\n"],["\u003cp\u003eWorkflows are ideal for complex job sequences, allowing you to set job dependencies so that one job will only execute once the previous one has been completed successfully.\u003c/p\u003e\n"],["\u003cp\u003eWorkflow Templates can be parameterized to execute with varying values without the need to edit the template for each run, enhancing flexibility.\u003c/p\u003e\n"],["\u003cp\u003eWorkflow Templates simplify task automation and the integration of Dataproc with external tools by replacing manual cluster management steps with a single-token tracking process.\u003c/p\u003e\n"]]],[],null,["The Dataproc [WorkflowTemplates API](/dataproc/docs/reference/rest/v1/projects.regions.workflowTemplates) provides a\nflexible and easy-to-use mechanism for managing and executing workflows. A\nWorkflow Template is a reusable workflow configuration. It defines a graph of\njobs with information on where to run those jobs.\n\n**Key Points:**\n\n- [Instantiating a Workflow Template](/dataproc/docs/concepts/workflows/using-workflows#running_a_workflow) launches a Workflow. A Workflow is an operation that runs a [Directed Acyclic Graph (DAG)](https://en.wikipedia.org/wiki/Directed_acyclic_graph) of jobs on a cluster.\n - If the workflow uses a [managed cluster](#managed_cluster), it creates the cluster, runs the jobs, and then deletes the cluster when the jobs are finished.\n - If the workflow uses a [cluster selector](#cluster_selector), it runs jobs on a selected existing cluster.\n- Workflows are ideal for complex job flows. You can create job dependencies so that a job starts only after its dependencies complete successfully.\n- When you [create a workflow template](/dataproc/docs/concepts/workflows/using-workflows#creating_a_template) Dataproc does not create a cluster or submit jobs to a cluster. Dataproc creates or selects a cluster and runs workflow jobs on the cluster when a workflow template is **instantiated**.\n\nKinds of Workflow Templates\n\nManaged cluster\n\nA workflow template can specify a managed cluster. The workflow will create an\n\"ephemeral\" cluster to run workflow jobs, and then delete the cluster when the\nworkflow is finished.\n\nCluster selector\n\nA workflow template can specify an existing cluster on which to run workflow\njobs by specifying one or more [user labels](/dataproc/docs/concepts/labels)\npreviously attached to the cluster. The workflow will run on a\ncluster that matches all of the labels. If multiple clusters match\nall labels, Dataproc selects the cluster with the most\nYARN available memory to run all workflow jobs. At the end of workflow,\nDataproc does not delete the selected cluster. See\n[Use cluster selectors with workflows](/dataproc/docs/concepts/workflows/cluster-selectors)\nfor more information.\n| A workflow can select a specific cluster by matching the `goog-dataproc-cluster-name` label (see [Using Automatically Applied Labels](/dataproc/docs/concepts/workflows/cluster-selectors#using_automatically_applied_labels)).\n\nParameterized\n\nIf you will run a workflow template multiple times with different values, use\nparameters to avoid editing the workflow template for each run:\n\n1. define parameters in the template, then\n\n2. pass different values for the parameters for each run.\n\nSee\n[Parameterization of Workflow Templates](/dataproc/docs/concepts/workflows/workflow-parameters)\nfor more information.\n\nInline\n\nWorkflows can be instantiated inline using the `gcloud` command with\n[workflow template YAML files](/dataproc/docs/concepts/workflows/using-yamls#instantiate_a_workflow_using_a_yaml_file) or by calling the Dataproc\n[InstantiateInline](/dataproc/docs/reference/rest/v1/projects.regions.workflowTemplates/instantiateInline)\nAPI (see [Using inline Dataproc workflows](/dataproc/docs/concepts/workflows/inline-workflows)).\nInline workflows do not create or modify workflow template resources.\n| Inline workflows can be useful for rapid prototyping or automation.\n\nWorkflow Template use cases\n\n- **Automation of repetitive tasks.** Workflows encapsulate frequently used\n cluster configurations and jobs.\n\n- **Transactional fire-and-forget API interaction model.** Workflow Templates\n replace the steps involved in a typical flow, which include:\n\n 1. creating the cluster\n 2. submitting jobs\n 3. polling\n 4. deleting the cluster\n\n Workflow Templates use a single token to track progress from cluster creation\n to deletion, and automate error handling and recovery. They also simplify the\n integration of Dataproc with other tools, such as Cloud Run functions\n and Cloud Composer.\n- **Support for ephemeral and long-lived clusters.** A common complexity\n associated with running Apache Hadoop is tuning and right-sizing clusters.\n Ephemeral (managed) clusters are easier to configure since they run a\n single workload. Cluster selectors can be used with\n longer-lived clusters to repeatedly execute the same workload\n without incurring the amortized cost of creating and deleting clusters.\n\n- **Granular IAM security.** Creating Dataproc clusters and\n submitting jobs require all-or-nothing IAM permissions.\n Workflow Templates use a per-template\n [workflowTemplates.instantiate](/dataproc/docs/concepts/iam/iam#workflow_templates_methods_required_permissions)\n permission, and do not depend on cluster or job permissions."]]