# Cloud Life Sciences v2beta API - Class WorkflowsServiceV2BetaClient (2.0.0-beta07)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.0.0-beta07 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.WorkflowsServiceV2BetaClient)
- [2.0.0-beta06](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/2.0.0-beta06/Google.Cloud.LifeSciences.V2Beta.WorkflowsServiceV2BetaClient)
- [1.0.0-beta02](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/1.0.0-beta02/Google.Cloud.LifeSciences.V2Beta.WorkflowsServiceV2BetaClient)

    public abstract class WorkflowsServiceV2BetaClient

Reference documentation and code samples for the Cloud Life Sciences v2beta API class WorkflowsServiceV2BetaClient.

WorkflowsServiceV2Beta client wrapper, for convenient use.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> WorkflowsServiceV2BetaClient

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Derived Types

[WorkflowsServiceV2BetaClientImpl](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.WorkflowsServiceV2BetaClientImpl)

## Namespace

[Google.Cloud.LifeSciences.V2Beta](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta)

## Assembly

Google.Cloud.LifeSciences.V2Beta.dll

## Remarks

A service for running workflows, such as pipelines consisting of Docker
containers.

## Properties

### DefaultEndpoint

    public static string DefaultEndpoint { get; }

The default endpoint for the WorkflowsServiceV2Beta service, which is a host of
"lifesciences.googleapis.com" and a port of 443.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### DefaultScopes

    public static IReadOnlyList<string> DefaultScopes { get; }

The default WorkflowsServiceV2Beta scopes.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1https://learn.microsoft.com/dotnet/api/system.string` |   |

**Remarks** The default WorkflowsServiceV2Beta scopes are:

- <https://www.googleapis.com/auth/cloud-platform>

<br />

### GrpcClient

    public virtual WorkflowsServiceV2Beta.WorkflowsServiceV2BetaClient GrpcClient { get; }

The underlying gRPC WorkflowsServiceV2Beta client

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.WorkflowsServiceV2Betahttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.WorkflowsServiceV2Beta.WorkflowsServiceV2BetaClient` |   |

### LocationsClient

    public virtual LocationsClient LocationsClient { get; }

The [LocationsClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.LocationsClient.html) associated with this client.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.LocationsClient.html` |   |

### RunPipelineOperationsClient

    public virtual OperationsClient RunPipelineOperationsClient { get; }

The long-running operations client for `RunPipeline`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.OperationsClient.html` |   |

### ServiceMetadata

    public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ServiceMetadata.html` |   |

## Methods

### Create()

    public static WorkflowsServiceV2BetaClient Create()

Synchronously creates a [WorkflowsServiceV2BetaClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.WorkflowsServiceV2BetaClient) using the default credentials, endpoint
and settings. To specify custom credentials or other settings, use
[WorkflowsServiceV2BetaClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.WorkflowsServiceV2BetaClientBuilder).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.WorkflowsServiceV2BetaClient` | The created [WorkflowsServiceV2BetaClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.WorkflowsServiceV2BetaClient). |

### CreateAsync(CancellationToken)

    public static Task<WorkflowsServiceV2BetaClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a [WorkflowsServiceV2BetaClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.WorkflowsServiceV2BetaClient) using the default credentials, endpoint
and settings. To specify custom credentials or other settings, use
[WorkflowsServiceV2BetaClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.WorkflowsServiceV2BetaClientBuilder).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` The [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use while creating the client. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.WorkflowsServiceV2BetaClient` | The task representing the created [WorkflowsServiceV2BetaClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.WorkflowsServiceV2BetaClient). |

### PollOnceRunPipeline(string, CallSettings)

    public virtual Operation<RunPipelineResponse, Metadata> PollOnceRunPipeline(string operationName, CallSettings callSettings = null)

Poll an operation once, using an `operationName` from a previous invocation of `RunPipeline`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `operationName` | `https://learn.microsoft.com/dotnet/api/system.string` The name of a previously invoked operation. Must not be `null` or empty. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.RunPipelineResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.Metadata` | The result of polling the operation. |

### PollOnceRunPipelineAsync(string, CallSettings)

    public virtual Task<Operation<RunPipelineResponse, Metadata>> PollOnceRunPipelineAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an `operationName` from a previous invocation of
`RunPipeline`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `operationName` | `https://learn.microsoft.com/dotnet/api/system.string` The name of a previously invoked operation. Must not be `null` or empty. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.RunPipelineResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.Metadata` | A task representing the result of polling the operation. |

### RunPipeline(RunPipelineRequest, CallSettings)

    public virtual Operation<RunPipelineResponse, Metadata> RunPipeline(RunPipelineRequest request, CallSettings callSettings = null)

Runs a pipeline. The returned Operation's \[metadata\]
\[google.longrunning.Operation.metadata\] field will contain a
\[google.cloud.lifesciences.v2beta.Metadata\]\[google.cloud.lifesciences.v2beta.Metadata\]
object describing the status of the pipeline execution. The
\[response\]\[google.longrunning.Operation.response\] field will contain a
\[google.cloud.lifesciences.v2beta.RunPipelineResponse\]\[google.cloud.lifesciences.v2beta.RunPipelineResponse\]
object if the pipeline completes successfully.

**Note:** Before you can use this method, the *Life Sciences Service Agent*
must have access to your project. This is done automatically when the
Cloud Life Sciences API is first enabled, but if you delete this permission
you must disable and re-enable the API to grant the Life Sciences
Service Agent the required permissions.
Authorization requires the following [Google
IAM](https://cloud.google.com/iam/) permission:

- `lifesciences.workflows.run`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.RunPipelineRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.RunPipelineResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.Metadata` | The RPC response. |

**Example**

    // Create client
    WorkflowsServiceV2BetaClient workflowsServiceV2BetaClient = WorkflowsServiceV2BetaClient.Create();
    // Initialize request argument(s)
    RunPipelineRequest request = new RunPipelineRequest
    {
        Pipeline = new Pipeline(),
        Labels = { { "", "" }, },
        PubSubTopic = "",
        Parent = "",
    };
    // Make the request
    Operation<RunPipelineResponse, Metadata> response = workflowsServiceV2BetaClient.RunPipeline(request);

    // Poll until the returned long-running operation is complete
    Operation<RunPipelineResponse, Metadata> completedResponse = response.PollUntilCompleted();
    // Retrieve the operation result
    RunPipelineResponse result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<RunPipelineResponse, Metadata> retrievedResponse = workflowsServiceV2BetaClient.PollOnceRunPipeline(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        RunPipelineResponse retrievedResult = retrievedResponse.Result;
    }

### RunPipelineAsync(RunPipelineRequest, CallSettings)

    public virtual Task<Operation<RunPipelineResponse, Metadata>> RunPipelineAsync(RunPipelineRequest request, CallSettings callSettings = null)

Runs a pipeline. The returned Operation's \[metadata\]
\[google.longrunning.Operation.metadata\] field will contain a
\[google.cloud.lifesciences.v2beta.Metadata\]\[google.cloud.lifesciences.v2beta.Metadata\]
object describing the status of the pipeline execution. The
\[response\]\[google.longrunning.Operation.response\] field will contain a
\[google.cloud.lifesciences.v2beta.RunPipelineResponse\]\[google.cloud.lifesciences.v2beta.RunPipelineResponse\]
object if the pipeline completes successfully.

**Note:** Before you can use this method, the *Life Sciences Service Agent*
must have access to your project. This is done automatically when the
Cloud Life Sciences API is first enabled, but if you delete this permission
you must disable and re-enable the API to grant the Life Sciences
Service Agent the required permissions.
Authorization requires the following [Google
IAM](https://cloud.google.com/iam/) permission:

- `lifesciences.workflows.run`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.RunPipelineRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.RunPipelineResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.Metadata` | A Task containing the RPC response. |

**Example**

    // Create client
    WorkflowsServiceV2BetaClient workflowsServiceV2BetaClient = await WorkflowsServiceV2BetaClient.CreateAsync();
    // Initialize request argument(s)
    RunPipelineRequest request = new RunPipelineRequest
    {
        Pipeline = new Pipeline(),
        Labels = { { "", "" }, },
        PubSubTopic = "",
        Parent = "",
    };
    // Make the request
    Operation<RunPipelineResponse, Metadata> response = await workflowsServiceV2BetaClient.RunPipelineAsync(request);

    // Poll until the returned long-running operation is complete
    Operation<RunPipelineResponse, Metadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    RunPipelineResponse result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<RunPipelineResponse, Metadata> retrievedResponse = await workflowsServiceV2BetaClient.PollOnceRunPipelineAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        RunPipelineResponse retrievedResult = retrievedResponse.Result;
    }

### RunPipelineAsync(RunPipelineRequest, CancellationToken)

    public virtual Task<Operation<RunPipelineResponse, Metadata>> RunPipelineAsync(RunPipelineRequest request, CancellationToken cancellationToken)

Runs a pipeline. The returned Operation's \[metadata\]
\[google.longrunning.Operation.metadata\] field will contain a
\[google.cloud.lifesciences.v2beta.Metadata\]\[google.cloud.lifesciences.v2beta.Metadata\]
object describing the status of the pipeline execution. The
\[response\]\[google.longrunning.Operation.response\] field will contain a
\[google.cloud.lifesciences.v2beta.RunPipelineResponse\]\[google.cloud.lifesciences.v2beta.RunPipelineResponse\]
object if the pipeline completes successfully.

**Note:** Before you can use this method, the *Life Sciences Service Agent*
must have access to your project. This is done automatically when the
Cloud Life Sciences API is first enabled, but if you delete this permission
you must disable and re-enable the API to grant the Life Sciences
Service Agent the required permissions.
Authorization requires the following [Google
IAM](https://cloud.google.com/iam/) permission:

- `lifesciences.workflows.run`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.RunPipelineRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.RunPipelineResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.Metadata` | A Task containing the RPC response. |

**Example**

    // Create client
    WorkflowsServiceV2BetaClient workflowsServiceV2BetaClient = await WorkflowsServiceV2BetaClient.CreateAsync();
    // Initialize request argument(s)
    RunPipelineRequest request = new RunPipelineRequest
    {
        Pipeline = new Pipeline(),
        Labels = { { "", "" }, },
        PubSubTopic = "",
        Parent = "",
    };
    // Make the request
    Operation<RunPipelineResponse, Metadata> response = await workflowsServiceV2BetaClient.RunPipelineAsync(request);

    // Poll until the returned long-running operation is complete
    Operation<RunPipelineResponse, Metadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    RunPipelineResponse result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<RunPipelineResponse, Metadata> retrievedResponse = await workflowsServiceV2BetaClient.PollOnceRunPipelineAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        RunPipelineResponse retrievedResult = retrievedResponse.Result;
    }

### ShutdownDefaultChannelsAsync()

    public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.WorkflowsServiceV2BetaClient#Google_Cloud_LifeSciences_V2Beta_WorkflowsServiceV2BetaClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.WorkflowsServiceV2BetaClient#Google_Cloud_LifeSciences_V2Beta_WorkflowsServiceV2BetaClient_CreateAsync_System_Threading_CancellationToken_). Channels which weren't automatically created are not
affected.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A task representing the asynchronous shutdown operation. |

**Remarks** After calling this method, further calls to [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.WorkflowsServiceV2BetaClient#Google_Cloud_LifeSciences_V2Beta_WorkflowsServiceV2BetaClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.LifeSciences.V2Beta/latest/Google.Cloud.LifeSciences.V2Beta.WorkflowsServiceV2BetaClient#Google_Cloud_LifeSciences_V2Beta_WorkflowsServiceV2BetaClient_CreateAsync_System_Threading_CancellationToken_) will create new channels, which could in turn be shut down
by another call to this method.