2.7.0 (latest) 2.6.1 2.5.1 2.4.1 2.3.0 2.2.0 2.1.1 2.0.0 1.2.0 1.1.0 1.0.2 0.8.0 0.7.2 0.6.0 0.5.0 0.4.1 0.3.0 0.2.0 0.1.5 Reference documentation and code samples for the Workflows V1 API class Google::Cloud::Workflows::V1::Workflows::Client.

Client for the Workflows service.


<br />

Workflows is used to deploy and execute workflow programs.
Workflows makes sure the program executes reliably, despite hardware and
networking interruptions.

## Inherits

- Object

## Includes

- [Google::Cloud::Workflows::V1::Workflows::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-Workflows-Paths)

## Methods

### .configure

    def self.configure() { |config| ... } -> Client::Configuration

Configure the Workflows Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-Workflows-Client-Configuration "Google::Cloud::Workflows::V1::Workflows::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-Workflows-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-Workflows-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all Workflows clients
::Google::Cloud::Workflows::V1::Workflows::Client.configure do |config|
  config.timeout = 10.0
end
```

### #configure

    def configure() { |config| ... } -> Client::Configuration

Configure the Workflows Client instance.


The configuration is set to the derived mode, meaning that values can be changed,
but structural changes (adding new fields, etc.) are not allowed. Structural changes
should be made on [Client.configure](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-Workflows-Client#Google__Cloud__Workflows__V1__Workflows__Client_configure_class_ "Google::Cloud::Workflows::V1::Workflows::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-Workflows-Client-Configuration "Google::Cloud::Workflows::V1::Workflows::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-Workflows-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-Workflows-Client-Configuration))

### #create_workflow

    def create_workflow(request, options = nil) -> ::Gapic::Operation
    def create_workflow(parent: nil, workflow: nil, workflow_id: nil) -> ::Gapic::Operation

Creates a new workflow. If a workflow with the specified name already
exists in the specified project and location, the long running operation
returns a \[ALREADY_EXISTS\]\[google.rpc.Code.ALREADY_EXISTS\] error.
**Overloads**

    def create_workflow(request, options = nil) -> ::Gapic::Operation

Pass arguments to `create_workflow` via a request object, either of type [CreateWorkflowRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-CreateWorkflowRequest "Google::Cloud::Workflows::V1::CreateWorkflowRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Workflows::V1::CreateWorkflowRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-CreateWorkflowRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def create_workflow(parent: nil, workflow: nil, workflow_id: nil) -> ::Gapic::Operation

Pass arguments to `create_workflow` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. Project and location in which the workflow should be created. Format: projects/{project}/locations/{location}
- **workflow** ([::Google::Cloud::Workflows::V1::Workflow](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-Workflow), ::Hash) --- Required. Workflow to be created.
- **workflow_id** (::String) ---

  Required. The ID of the workflow to be created. It has to fulfill the
  following requirements:
  - Must contain only letters, numbers, underscores and hyphens.
  - Must start with a letter.
  - Must be between 1-64 characters.
  - Must end with a number or a letter.
  - Must be unique within the customer project and location.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::Operation)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/workflows/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workflows::V1::Workflows::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workflows::V1::CreateWorkflowRequest.new

# Call the create_workflow method.
result = client.create_workflow request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #delete_workflow

    def delete_workflow(request, options = nil) -> ::Gapic::Operation
    def delete_workflow(name: nil) -> ::Gapic::Operation

Deletes a workflow with the specified name.
This method also cancels and deletes all running executions of the
workflow.
**Overloads**

    def delete_workflow(request, options = nil) -> ::Gapic::Operation

Pass arguments to `delete_workflow` via a request object, either of type [DeleteWorkflowRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-DeleteWorkflowRequest "Google::Cloud::Workflows::V1::DeleteWorkflowRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Workflows::V1::DeleteWorkflowRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-DeleteWorkflowRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def delete_workflow(name: nil) -> ::Gapic::Operation

Pass arguments to `delete_workflow` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. Name of the workflow to be deleted. Format: projects/{project}/locations/{location}/workflows/{workflow}
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::Operation)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/workflows/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workflows::V1::Workflows::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workflows::V1::DeleteWorkflowRequest.new

# Call the delete_workflow method.
result = client.delete_workflow request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #get_workflow

    def get_workflow(request, options = nil) -> ::Google::Cloud::Workflows::V1::Workflow
    def get_workflow(name: nil, revision_id: nil) -> ::Google::Cloud::Workflows::V1::Workflow

Gets details of a single workflow.
**Overloads**

    def get_workflow(request, options = nil) -> ::Google::Cloud::Workflows::V1::Workflow

Pass arguments to `get_workflow` via a request object, either of type [GetWorkflowRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-GetWorkflowRequest "Google::Cloud::Workflows::V1::GetWorkflowRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Workflows::V1::GetWorkflowRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-GetWorkflowRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def get_workflow(name: nil, revision_id: nil) -> ::Google::Cloud::Workflows::V1::Workflow

Pass arguments to `get_workflow` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Required. Name of the workflow for which information should be retrieved. Format: projects/{project}/locations/{location}/workflows/{workflow}
- **revision_id** (::String) --- Optional. The revision of the workflow to retrieve. If the revision_id is empty, the latest revision is retrieved. The format is "000001-a4d", where the first six characters define the zero-padded decimal revision number. They are followed by a hyphen and three hexadecimal characters.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Workflows::V1::Workflow](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-Workflow))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Workflows::V1::Workflow](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-Workflow))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/workflows/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workflows::V1::Workflows::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workflows::V1::GetWorkflowRequest.new

# Call the get_workflow method.
result = client.get_workflow request

# The returned object is of type Google::Cloud::Workflows::V1::Workflow.
p result
```

### #initialize

    def initialize() { |config| ... } -> Client

Create a new Workflows client object.
**Yields**

- (config) --- Configure the Workflows client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-Workflows-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-Workflows-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::Workflows::V1::Workflows::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_workflow_revisions

    def list_workflow_revisions(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>
    def list_workflow_revisions(name: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>

Lists revisions for a given workflow.
**Overloads**

    def list_workflow_revisions(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>

Pass arguments to `list_workflow_revisions` via a request object, either of type [ListWorkflowRevisionsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-ListWorkflowRevisionsRequest "Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-ListWorkflowRevisionsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def list_workflow_revisions(name: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>

Pass arguments to `list_workflow_revisions` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Required. Workflow for which the revisions should be listed. Format: projects/{project}/locations/{location}/workflows/{workflow}
- **page_size** (::Integer) ---

  The maximum number of revisions to return per page. If a value is not
  specified, a default value of 20 is used. The maximum permitted value is
  1. Values greater than 100 are coerced down to 100.
- **page_token** (::String) --- The page token, received from a previous ListWorkflowRevisions call. Provide this to retrieve the subsequent page.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::PagedEnumerable\<[::Google::Cloud::Workflows::V1::Workflow](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-Workflow)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::PagedEnumerable\<[::Google::Cloud::Workflows::V1::Workflow](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-Workflow)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/workflows/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workflows::V1::Workflows::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest.new

# Call the list_workflow_revisions method.
result = client.list_workflow_revisions request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Workflows::V1::Workflow.
  p item
end
```

### #list_workflows

    def list_workflows(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>
    def list_workflows(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>

Lists workflows in a given project and location.
The default order is not specified.
**Overloads**

    def list_workflows(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>

Pass arguments to `list_workflows` via a request object, either of type [ListWorkflowsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-ListWorkflowsRequest "Google::Cloud::Workflows::V1::ListWorkflowsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Workflows::V1::ListWorkflowsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-ListWorkflowsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def list_workflows(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>

Pass arguments to `list_workflows` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. Project and location from which the workflows should be listed. Format: projects/{project}/locations/{location}
- **page_size** (::Integer) --- Maximum number of workflows to return per call. The service might return fewer than this value even if not at the end of the collection. If a value is not specified, a default value of 500 is used. The maximum permitted value is 1000 and values greater than 1000 are coerced down to 1000.
- **page_token** (::String) --- A page token, received from a previous `ListWorkflows` call. Provide this to retrieve the subsequent page.


  When paginating, all other parameters provided to `ListWorkflows` must
  match the call that provided the page token.
- **filter** (::String) --- Filter to restrict results to specific workflows. For details, see [AIP-160](https://google.aip.dev/160).


  For example, if you are using the Google APIs Explorer:

  `state="SUCCEEDED"`

  or

  `createTime>"2023-08-01" AND state="FAILED"`
- **order_by** (::String) --- Comma-separated list of fields that specify the order of the results. Default sorting order for a field is ascending. To specify descending order for a field, append a "desc" suffix. If not specified, the results are returned in an unspecified order.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::PagedEnumerable\<[::Google::Cloud::Workflows::V1::Workflow](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-Workflow)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::PagedEnumerable\<[::Google::Cloud::Workflows::V1::Workflow](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-Workflow)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/workflows/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workflows::V1::Workflows::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workflows::V1::ListWorkflowsRequest.new

# Call the list_workflows method.
result = client.list_workflows request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Workflows::V1::Workflow.
  p item
end
```

### #location_client

    def location_client() -> Google::Cloud::Location::Locations::Client

Get the associated client for mix-in of the Locations.
**Returns**

- (Google::Cloud::Location::Locations::Client)

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #operations_client

    def operations_client() -> ::Google::Cloud::Workflows::V1::Workflows::Operations

Get the associated client for long-running operations.
**Returns**

- ([::Google::Cloud::Workflows::V1::Workflows::Operations](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-Workflows-Operations))

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_workflow

    def update_workflow(request, options = nil) -> ::Gapic::Operation
    def update_workflow(workflow: nil, update_mask: nil) -> ::Gapic::Operation

Updates an existing workflow.
Running this method has no impact on already running executions of the
workflow. A new revision of the workflow might be created as a result of a
successful update operation. In that case, the new revision is used
in new workflow executions.
**Overloads**

    def update_workflow(request, options = nil) -> ::Gapic::Operation

Pass arguments to `update_workflow` via a request object, either of type [UpdateWorkflowRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-UpdateWorkflowRequest "Google::Cloud::Workflows::V1::UpdateWorkflowRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Workflows::V1::UpdateWorkflowRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-UpdateWorkflowRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def update_workflow(workflow: nil, update_mask: nil) -> ::Gapic::Operation

Pass arguments to `update_workflow` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **workflow** ([::Google::Cloud::Workflows::V1::Workflow](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Cloud-Workflows-V1-Workflow), ::Hash) --- Required. Workflow to be updated.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-FieldMask), ::Hash) --- List of fields to be updated. If not present, the entire workflow will be updated.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::Operation)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/workflows/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Workflows::V1::Workflows::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Workflows::V1::UpdateWorkflowRequest.new

# Call the update_workflow method.
result = client.update_workflow request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```