Create a client to initiate a Dataproc workflow template

Creates a client using application default credentials to initiate a Dataproc workflow template. Use either the global or a regional endpoint.

Code sample


Before trying this sample, follow the Python setup instructions in the Dataproc quickstart using client libraries. For more information, see the Dataproc Python API reference documentation.

if global_region:
    region = "global"
    # Use the default gRPC global endpoints.
    dataproc_workflow_client = dataproc_v1.WorkflowTemplateServiceClient()
    region = get_region_from_zone(zone)
    # Use a regional gRPC endpoint. See:
    client_transport = workflow_template_service_grpc_transport.WorkflowTemplateServiceGrpcTransport(
    dataproc_workflow_client = dataproc_v1.WorkflowTemplateServiceClient(

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.