Skip to main content

workflow_templates

Creates, updates, deletes, gets or lists a workflow_templates resource.

Overview

Nameworkflow_templates
TypeResource
Idgoogle.dataproc.workflow_templates

Fields

NameDatatypeDescription
idstring
namestringOutput only. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} For projects.locations.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id}
createTimestringOutput only. The time template was created.
dagTimeoutstringOptional. Timeout duration for the DAG of jobs, expressed in seconds (see JSON representation of duration (https://developers.google.com/protocol-buffers/docs/proto3#json)). The timeout duration must be from 10 minutes ("600s") to 24 hours ("86400s"). The timer begins when the first job is submitted. If the workflow is running at the end of the timeout period, any remaining jobs are cancelled, the workflow is ended, and if the workflow was running on a managed cluster, the cluster is deleted.
encryptionConfigobjectEncryption settings for encrypting workflow template job arguments.
jobsarrayRequired. The Directed Acyclic Graph of Jobs to submit.
labelsobjectOptional. The labels to associate with this template. These labels will be propagated to all jobs and clusters created by the workflow instance.Label keys must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt).Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt).No more than 32 labels can be associated with a template.
parametersarrayOptional. Template parameters whose values are substituted into the template. Values for parameters must be provided when the template is instantiated.
placementobjectSpecifies workflow execution target.Either managed_cluster or cluster_selector is required.
updateTimestringOutput only. The time template was last updated.
versionintegerOptional. Used to perform a consistent read-modify-write.This field should be left blank for a CreateWorkflowTemplate request. It is required for an UpdateWorkflowTemplate request, and must match the current server version. A typical update template flow would fetch the current template with a GetWorkflowTemplate request, which will return the current template with the version field filled in with the current server version. The user updates other fields in the template, then returns it as part of the UpdateWorkflowTemplate request.

Methods

NameAccessible byRequired ParamsDescription
projects_locations_workflow_templates_getSELECTlocationsId, projectsId, workflowTemplatesIdRetrieves the latest workflow template.Can retrieve previously instantiated template by specifying optional version parameter.
projects_locations_workflow_templates_listSELECTlocationsId, projectsIdLists workflows that match the specified filter in the request.
projects_regions_workflow_templates_getSELECTprojectsId, regionsId, workflowTemplatesIdRetrieves the latest workflow template.Can retrieve previously instantiated template by specifying optional version parameter.
projects_regions_workflow_templates_listSELECTprojectsId, regionsIdLists workflows that match the specified filter in the request.
projects_locations_workflow_templates_createINSERTlocationsId, projectsIdCreates new workflow template.
projects_regions_workflow_templates_createINSERTprojectsId, regionsIdCreates new workflow template.
projects_locations_workflow_templates_deleteDELETElocationsId, projectsId, workflowTemplatesIdDeletes a workflow template. It does not cancel in-progress workflows.
projects_regions_workflow_templates_deleteDELETEprojectsId, regionsId, workflowTemplatesIdDeletes a workflow template. It does not cancel in-progress workflows.
projects_locations_workflow_templates_updateREPLACElocationsId, projectsId, workflowTemplatesIdUpdates (replaces) workflow template. The updated template must contain version that matches the current server version.
projects_regions_workflow_templates_updateREPLACEprojectsId, regionsId, workflowTemplatesIdUpdates (replaces) workflow template. The updated template must contain version that matches the current server version.
projects_locations_workflow_templates_instantiateEXEClocationsId, projectsId, workflowTemplatesIdInstantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty.
projects_locations_workflow_templates_instantiate_inlineEXEClocationsId, projectsIdInstantiates a template and begins execution.This method is equivalent to executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty.
projects_regions_workflow_templates_instantiateEXECprojectsId, regionsId, workflowTemplatesIdInstantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty.
projects_regions_workflow_templates_instantiate_inlineEXECprojectsId, regionsIdInstantiates a template and begins execution.This method is equivalent to executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty.

SELECT examples

Lists workflows that match the specified filter in the request.

SELECT
id,
name,
createTime,
dagTimeout,
encryptionConfig,
jobs,
labels,
parameters,
placement,
updateTime,
version
FROM google.dataproc.workflow_templates
WHERE projectsId = '{{ projectsId }}'
AND regionsId = '{{ regionsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new workflow_templates resource.

/*+ create */
INSERT INTO google.dataproc.workflow_templates (
projectsId,
regionsId,
version,
labels,
placement,
jobs,
parameters,
dagTimeout,
encryptionConfig
)
SELECT
'{{ projectsId }}',
'{{ regionsId }}',
'{{ version }}',
'{{ labels }}',
'{{ placement }}',
'{{ jobs }}',
'{{ parameters }}',
'{{ dagTimeout }}',
'{{ encryptionConfig }}'
;

REPLACE example

Replaces all fields in the specified workflow_templates resource.

/*+ update */
REPLACE google.dataproc.workflow_templates
SET
version = '{{ version }}',
labels = '{{ labels }}',
placement = '{{ placement }}',
jobs = '{{ jobs }}',
parameters = '{{ parameters }}',
dagTimeout = '{{ dagTimeout }}',
encryptionConfig = '{{ encryptionConfig }}'
WHERE
projectsId = '{{ projectsId }}'
AND regionsId = '{{ regionsId }}'
AND workflowTemplatesId = '{{ workflowTemplatesId }}';

DELETE example

Deletes the specified workflow_templates resource.

/*+ delete */
DELETE FROM google.dataproc.workflow_templates
WHERE projectsId = '{{ projectsId }}'
AND regionsId = '{{ regionsId }}'
AND workflowTemplatesId = '{{ workflowTemplatesId }}';