# Google Cloud Dataproc V1 Client - Class WorkflowTemplate (3.14.0)

3.14.0 (latest) 3.13.4 3.12.0 3.11.0 3.10.1 3.9.0 3.8.1 3.7.1 3.6.1 3.5.1 3.4.0 3.3.0 3.2.2 2.12.0 2.11.0 2.10.0 2.9.1 2.8.2 2.7.0 2.6.1 2.5.0 2.3.0 2.2.3 2.1.0 2.0.0 Reference documentation and code samples for the Google Cloud Dataproc V1 Client class WorkflowTemplate.

A Dataproc workflow template resource.

Generated from protobuf message `google.cloud.dataproc.v1.WorkflowTemplate`

## Namespace

Google \\ Cloud \\ Dataproc \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ id` | `string` |
| `↳ name` | `string` Output 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}` |
| `↳ version` | `int` Optional. 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. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time template was created. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time template was last updated. |
| `↳ labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. 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. |
| `↳ placement` | `https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.WorkflowTemplatePlacement` Required. WorkflowTemplate scheduling information. |
| `↳ jobs` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.OrderedJob>` Required. The Directed Acyclic Graph of Jobs to submit. |
| `↳ parameters` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.TemplateParameter>` Optional. Template parameters whose values are substituted into the template. Values for parameters must be provided when the template is instantiated. |
| `↳ dag_timeout` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Optional. 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](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#configuring_or_selecting_a_cluster), the cluster is deleted. |

### getId

Generated from protobuf field `string id = 2 [(.google.api.field_behavior) = REQUIRED];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setId

Generated from protobuf field `string id = 2 [(.google.api.field_behavior) = REQUIRED];`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getName

Output 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}`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

Output 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}`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getVersion

Optional. 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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setVersion

Optional. 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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCreateTime

Output only. The time template was created.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The time template was created.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUpdateTime

Output only. The time template was last updated.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. The time template was last updated.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLabels

Optional. 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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setLabels

Optional. 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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPlacement

Required. WorkflowTemplate scheduling information.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.WorkflowTemplatePlacement|null` |   |

### hasPlacement

### clearPlacement

### setPlacement

Required. WorkflowTemplate scheduling information.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.WorkflowTemplatePlacement` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getJobs

Required. The Directed Acyclic Graph of Jobs to submit.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/RepeatedField` |   |

### setJobs

Required. The Directed Acyclic Graph of Jobs to submit.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.OrderedJob>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getParameters

Optional. Template parameters whose values are substituted into the
template. Values for parameters must be provided when the template is
instantiated.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/RepeatedField` |   |

### setParameters

Optional. Template parameters whose values are substituted into the
template. Values for parameters must be provided when the template is
instantiated.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.TemplateParameter>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDagTimeout

Optional. 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](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#configuring_or_selecting_a_cluster),
the cluster is deleted.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration|null` |   |

### hasDagTimeout

### clearDagTimeout

### setDagTimeout

Optional. 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](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#configuring_or_selecting_a_cluster),
the cluster is deleted.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |