Workflows v1beta API - Class WorkflowsClient (2.0.0-beta04)

public abstract class WorkflowsClient

Reference documentation and code samples for the Workflows v1beta API class WorkflowsClient.

Workflows client wrapper, for convenient use.

Inheritance

object > WorkflowsClient

Derived Types

Namespace

Google.Cloud.Workflows.V1Beta

Assembly

Google.Cloud.Workflows.V1Beta.dll

Remarks

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

Properties

CreateWorkflowOperationsClient

public virtual OperationsClient CreateWorkflowOperationsClient { get; }

The long-running operations client for CreateWorkflow.

Property Value
Type Description
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default Workflows scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default Workflows scopes are:

DeleteWorkflowOperationsClient

public virtual OperationsClient DeleteWorkflowOperationsClient { get; }

The long-running operations client for DeleteWorkflow.

Property Value
Type Description
OperationsClient

GrpcClient

public virtual Workflows.WorkflowsClient GrpcClient { get; }

The underlying gRPC Workflows client

Property Value
Type Description
WorkflowsWorkflowsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

UpdateWorkflowOperationsClient

public virtual OperationsClient UpdateWorkflowOperationsClient { get; }

The long-running operations client for UpdateWorkflow.

Property Value
Type Description
OperationsClient

Methods

Create()

public static WorkflowsClient Create()

Synchronously creates a WorkflowsClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use WorkflowsClientBuilder.

Returns
Type Description
WorkflowsClient

The created WorkflowsClient.

CreateAsync(CancellationToken)

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

Asynchronously creates a WorkflowsClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use WorkflowsClientBuilder.

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskWorkflowsClient

The task representing the created WorkflowsClient.

CreateWorkflow(LocationName, Workflow, string, CallSettings)

public virtual Operation<Workflow, OperationMetadata> CreateWorkflow(LocationName parent, Workflow workflow, string workflowId, CallSettings callSettings = null)

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

Parameters
Name Description
parent LocationName

Required. Project and location in which the workflow should be created. Format: projects/{project}/locations/{location}

workflow Workflow

Required. Workflow to be created.

workflowId 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.
callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationWorkflowOperationMetadata

The RPC response.

Example
// Create client
WorkflowsClient workflowsClient = WorkflowsClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Workflow workflow = new Workflow();
string workflowId = "";
// Make the request
Operation<Workflow, OperationMetadata> response = workflowsClient.CreateWorkflow(parent, workflow, workflowId);

// Poll until the returned long-running operation is complete
Operation<Workflow, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Workflow 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<Workflow, OperationMetadata> retrievedResponse = workflowsClient.PollOnceCreateWorkflow(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Workflow retrievedResult = retrievedResponse.Result;
}

CreateWorkflow(CreateWorkflowRequest, CallSettings)

public virtual Operation<Workflow, OperationMetadata> CreateWorkflow(CreateWorkflowRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request CreateWorkflowRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationWorkflowOperationMetadata

The RPC response.

Example
// Create client
WorkflowsClient workflowsClient = WorkflowsClient.Create();
// Initialize request argument(s)
CreateWorkflowRequest request = new CreateWorkflowRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Workflow = new Workflow(),
    WorkflowId = "",
};
// Make the request
Operation<Workflow, OperationMetadata> response = workflowsClient.CreateWorkflow(request);

// Poll until the returned long-running operation is complete
Operation<Workflow, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Workflow 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<Workflow, OperationMetadata> retrievedResponse = workflowsClient.PollOnceCreateWorkflow(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Workflow retrievedResult = retrievedResponse.Result;
}

CreateWorkflow(string, Workflow, string, CallSettings)

public virtual Operation<Workflow, OperationMetadata> CreateWorkflow(string parent, Workflow workflow, string workflowId, CallSettings callSettings = null)

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

Parameters
Name Description
parent string

Required. Project and location in which the workflow should be created. Format: projects/{project}/locations/{location}

workflow Workflow

Required. Workflow to be created.

workflowId 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.
callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationWorkflowOperationMetadata

The RPC response.

Example
// Create client
WorkflowsClient workflowsClient = WorkflowsClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Workflow workflow = new Workflow();
string workflowId = "";
// Make the request
Operation<Workflow, OperationMetadata> response = workflowsClient.CreateWorkflow(parent, workflow, workflowId);

// Poll until the returned long-running operation is complete
Operation<Workflow, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Workflow 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<Workflow, OperationMetadata> retrievedResponse = workflowsClient.PollOnceCreateWorkflow(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Workflow retrievedResult = retrievedResponse.Result;
}

CreateWorkflowAsync(LocationName, Workflow, string, CallSettings)

public virtual Task<Operation<Workflow, OperationMetadata>> CreateWorkflowAsync(LocationName parent, Workflow workflow, string workflowId, CallSettings callSettings = null)

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

Parameters
Name Description
parent LocationName

Required. Project and location in which the workflow should be created. Format: projects/{project}/locations/{location}

workflow Workflow

Required. Workflow to be created.

workflowId 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.
callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationWorkflowOperationMetadata

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Workflow workflow = new Workflow();
string workflowId = "";
// Make the request
Operation<Workflow, OperationMetadata> response = await workflowsClient.CreateWorkflowAsync(parent, workflow, workflowId);

// Poll until the returned long-running operation is complete
Operation<Workflow, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Workflow 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<Workflow, OperationMetadata> retrievedResponse = await workflowsClient.PollOnceCreateWorkflowAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Workflow retrievedResult = retrievedResponse.Result;
}

CreateWorkflowAsync(LocationName, Workflow, string, CancellationToken)

public virtual Task<Operation<Workflow, OperationMetadata>> CreateWorkflowAsync(LocationName parent, Workflow workflow, string workflowId, CancellationToken cancellationToken)

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

Parameters
Name Description
parent LocationName

Required. Project and location in which the workflow should be created. Format: projects/{project}/locations/{location}

workflow Workflow

Required. Workflow to be created.

workflowId 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.
cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationWorkflowOperationMetadata

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Workflow workflow = new Workflow();
string workflowId = "";
// Make the request
Operation<Workflow, OperationMetadata> response = await workflowsClient.CreateWorkflowAsync(parent, workflow, workflowId);

// Poll until the returned long-running operation is complete
Operation<Workflow, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Workflow 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<Workflow, OperationMetadata> retrievedResponse = await workflowsClient.PollOnceCreateWorkflowAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Workflow retrievedResult = retrievedResponse.Result;
}

CreateWorkflowAsync(CreateWorkflowRequest, CallSettings)

public virtual Task<Operation<Workflow, OperationMetadata>> CreateWorkflowAsync(CreateWorkflowRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request CreateWorkflowRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationWorkflowOperationMetadata

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
CreateWorkflowRequest request = new CreateWorkflowRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Workflow = new Workflow(),
    WorkflowId = "",
};
// Make the request
Operation<Workflow, OperationMetadata> response = await workflowsClient.CreateWorkflowAsync(request);

// Poll until the returned long-running operation is complete
Operation<Workflow, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Workflow 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<Workflow, OperationMetadata> retrievedResponse = await workflowsClient.PollOnceCreateWorkflowAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Workflow retrievedResult = retrievedResponse.Result;
}

CreateWorkflowAsync(CreateWorkflowRequest, CancellationToken)

public virtual Task<Operation<Workflow, OperationMetadata>> CreateWorkflowAsync(CreateWorkflowRequest request, CancellationToken cancellationToken)

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

Parameters
Name Description
request CreateWorkflowRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationWorkflowOperationMetadata

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
CreateWorkflowRequest request = new CreateWorkflowRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Workflow = new Workflow(),
    WorkflowId = "",
};
// Make the request
Operation<Workflow, OperationMetadata> response = await workflowsClient.CreateWorkflowAsync(request);

// Poll until the returned long-running operation is complete
Operation<Workflow, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Workflow 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<Workflow, OperationMetadata> retrievedResponse = await workflowsClient.PollOnceCreateWorkflowAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Workflow retrievedResult = retrievedResponse.Result;
}

CreateWorkflowAsync(string, Workflow, string, CallSettings)

public virtual Task<Operation<Workflow, OperationMetadata>> CreateWorkflowAsync(string parent, Workflow workflow, string workflowId, CallSettings callSettings = null)

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

Parameters
Name Description
parent string

Required. Project and location in which the workflow should be created. Format: projects/{project}/locations/{location}

workflow Workflow

Required. Workflow to be created.

workflowId 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.
callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationWorkflowOperationMetadata

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Workflow workflow = new Workflow();
string workflowId = "";
// Make the request
Operation<Workflow, OperationMetadata> response = await workflowsClient.CreateWorkflowAsync(parent, workflow, workflowId);

// Poll until the returned long-running operation is complete
Operation<Workflow, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Workflow 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<Workflow, OperationMetadata> retrievedResponse = await workflowsClient.PollOnceCreateWorkflowAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Workflow retrievedResult = retrievedResponse.Result;
}

CreateWorkflowAsync(string, Workflow, string, CancellationToken)

public virtual Task<Operation<Workflow, OperationMetadata>> CreateWorkflowAsync(string parent, Workflow workflow, string workflowId, CancellationToken cancellationToken)

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

Parameters
Name Description
parent string

Required. Project and location in which the workflow should be created. Format: projects/{project}/locations/{location}

workflow Workflow

Required. Workflow to be created.

workflowId 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.
cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationWorkflowOperationMetadata

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Workflow workflow = new Workflow();
string workflowId = "";
// Make the request
Operation<Workflow, OperationMetadata> response = await workflowsClient.CreateWorkflowAsync(parent, workflow, workflowId);

// Poll until the returned long-running operation is complete
Operation<Workflow, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Workflow 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<Workflow, OperationMetadata> retrievedResponse = await workflowsClient.PollOnceCreateWorkflowAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Workflow retrievedResult = retrievedResponse.Result;
}

DeleteWorkflow(WorkflowName, CallSettings)

public virtual Operation<Empty, OperationMetadata> DeleteWorkflow(WorkflowName name, CallSettings callSettings = null)

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

Parameters
Name Description
name WorkflowName

Required. Name of the workflow to be deleted. Format: projects/{project}/locations/{location}/workflows/{workflow}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyOperationMetadata

The RPC response.

Example
// Create client
WorkflowsClient workflowsClient = WorkflowsClient.Create();
// Initialize request argument(s)
WorkflowName name = WorkflowName.FromProjectLocationWorkflow("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
// Make the request
Operation<Empty, OperationMetadata> response = workflowsClient.DeleteWorkflow(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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<Empty, OperationMetadata> retrievedResponse = workflowsClient.PollOnceDeleteWorkflow(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteWorkflow(DeleteWorkflowRequest, CallSettings)

public virtual Operation<Empty, OperationMetadata> DeleteWorkflow(DeleteWorkflowRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request DeleteWorkflowRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyOperationMetadata

The RPC response.

Example
// Create client
WorkflowsClient workflowsClient = WorkflowsClient.Create();
// Initialize request argument(s)
DeleteWorkflowRequest request = new DeleteWorkflowRequest
{
    WorkflowName = WorkflowName.FromProjectLocationWorkflow("[PROJECT]", "[LOCATION]", "[WORKFLOW]"),
};
// Make the request
Operation<Empty, OperationMetadata> response = workflowsClient.DeleteWorkflow(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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<Empty, OperationMetadata> retrievedResponse = workflowsClient.PollOnceDeleteWorkflow(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteWorkflow(string, CallSettings)

public virtual Operation<Empty, OperationMetadata> DeleteWorkflow(string name, CallSettings callSettings = null)

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

Parameters
Name Description
name string

Required. Name of the workflow to be deleted. Format: projects/{project}/locations/{location}/workflows/{workflow}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyOperationMetadata

The RPC response.

Example
// Create client
WorkflowsClient workflowsClient = WorkflowsClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/workflows/[WORKFLOW]";
// Make the request
Operation<Empty, OperationMetadata> response = workflowsClient.DeleteWorkflow(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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<Empty, OperationMetadata> retrievedResponse = workflowsClient.PollOnceDeleteWorkflow(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteWorkflowAsync(WorkflowName, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteWorkflowAsync(WorkflowName name, CallSettings callSettings = null)

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

Parameters
Name Description
name WorkflowName

Required. Name of the workflow to be deleted. Format: projects/{project}/locations/{location}/workflows/{workflow}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
WorkflowName name = WorkflowName.FromProjectLocationWorkflow("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
// Make the request
Operation<Empty, OperationMetadata> response = await workflowsClient.DeleteWorkflowAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, OperationMetadata> retrievedResponse = await workflowsClient.PollOnceDeleteWorkflowAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteWorkflowAsync(WorkflowName, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteWorkflowAsync(WorkflowName name, CancellationToken cancellationToken)

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

Parameters
Name Description
name WorkflowName

Required. Name of the workflow to be deleted. Format: projects/{project}/locations/{location}/workflows/{workflow}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
WorkflowName name = WorkflowName.FromProjectLocationWorkflow("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
// Make the request
Operation<Empty, OperationMetadata> response = await workflowsClient.DeleteWorkflowAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, OperationMetadata> retrievedResponse = await workflowsClient.PollOnceDeleteWorkflowAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteWorkflowAsync(DeleteWorkflowRequest, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteWorkflowAsync(DeleteWorkflowRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request DeleteWorkflowRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
DeleteWorkflowRequest request = new DeleteWorkflowRequest
{
    WorkflowName = WorkflowName.FromProjectLocationWorkflow("[PROJECT]", "[LOCATION]", "[WORKFLOW]"),
};
// Make the request
Operation<Empty, OperationMetadata> response = await workflowsClient.DeleteWorkflowAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, OperationMetadata> retrievedResponse = await workflowsClient.PollOnceDeleteWorkflowAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteWorkflowAsync(DeleteWorkflowRequest, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteWorkflowAsync(DeleteWorkflowRequest request, CancellationToken cancellationToken)

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

Parameters
Name Description
request DeleteWorkflowRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
DeleteWorkflowRequest request = new DeleteWorkflowRequest
{
    WorkflowName = WorkflowName.FromProjectLocationWorkflow("[PROJECT]", "[LOCATION]", "[WORKFLOW]"),
};
// Make the request
Operation<Empty, OperationMetadata> response = await workflowsClient.DeleteWorkflowAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, OperationMetadata> retrievedResponse = await workflowsClient.PollOnceDeleteWorkflowAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteWorkflowAsync(string, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteWorkflowAsync(string name, CallSettings callSettings = null)

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

Parameters
Name Description
name string

Required. Name of the workflow to be deleted. Format: projects/{project}/locations/{location}/workflows/{workflow}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/workflows/[WORKFLOW]";
// Make the request
Operation<Empty, OperationMetadata> response = await workflowsClient.DeleteWorkflowAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, OperationMetadata> retrievedResponse = await workflowsClient.PollOnceDeleteWorkflowAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteWorkflowAsync(string, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteWorkflowAsync(string name, CancellationToken cancellationToken)

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

Parameters
Name Description
name string

Required. Name of the workflow to be deleted. Format: projects/{project}/locations/{location}/workflows/{workflow}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/workflows/[WORKFLOW]";
// Make the request
Operation<Empty, OperationMetadata> response = await workflowsClient.DeleteWorkflowAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, OperationMetadata> retrievedResponse = await workflowsClient.PollOnceDeleteWorkflowAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

GetWorkflow(WorkflowName, CallSettings)

public virtual Workflow GetWorkflow(WorkflowName name, CallSettings callSettings = null)

Gets details of a single Workflow.

Parameters
Name Description
name WorkflowName

Required. Name of the workflow which information should be retrieved. Format: projects/{project}/locations/{location}/workflows/{workflow}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Workflow

The RPC response.

Example
// Create client
WorkflowsClient workflowsClient = WorkflowsClient.Create();
// Initialize request argument(s)
WorkflowName name = WorkflowName.FromProjectLocationWorkflow("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
// Make the request
Workflow response = workflowsClient.GetWorkflow(name);

GetWorkflow(GetWorkflowRequest, CallSettings)

public virtual Workflow GetWorkflow(GetWorkflowRequest request, CallSettings callSettings = null)

Gets details of a single Workflow.

Parameters
Name Description
request GetWorkflowRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Workflow

The RPC response.

Example
// Create client
WorkflowsClient workflowsClient = WorkflowsClient.Create();
// Initialize request argument(s)
GetWorkflowRequest request = new GetWorkflowRequest
{
    WorkflowName = WorkflowName.FromProjectLocationWorkflow("[PROJECT]", "[LOCATION]", "[WORKFLOW]"),
};
// Make the request
Workflow response = workflowsClient.GetWorkflow(request);

GetWorkflow(string, CallSettings)

public virtual Workflow GetWorkflow(string name, CallSettings callSettings = null)

Gets details of a single Workflow.

Parameters
Name Description
name string

Required. Name of the workflow which information should be retrieved. Format: projects/{project}/locations/{location}/workflows/{workflow}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Workflow

The RPC response.

Example
// Create client
WorkflowsClient workflowsClient = WorkflowsClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/workflows/[WORKFLOW]";
// Make the request
Workflow response = workflowsClient.GetWorkflow(name);

GetWorkflowAsync(WorkflowName, CallSettings)

public virtual Task<Workflow> GetWorkflowAsync(WorkflowName name, CallSettings callSettings = null)

Gets details of a single Workflow.

Parameters
Name Description
name WorkflowName

Required. Name of the workflow which information should be retrieved. Format: projects/{project}/locations/{location}/workflows/{workflow}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskWorkflow

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
WorkflowName name = WorkflowName.FromProjectLocationWorkflow("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
// Make the request
Workflow response = await workflowsClient.GetWorkflowAsync(name);

GetWorkflowAsync(WorkflowName, CancellationToken)

public virtual Task<Workflow> GetWorkflowAsync(WorkflowName name, CancellationToken cancellationToken)

Gets details of a single Workflow.

Parameters
Name Description
name WorkflowName

Required. Name of the workflow which information should be retrieved. Format: projects/{project}/locations/{location}/workflows/{workflow}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskWorkflow

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
WorkflowName name = WorkflowName.FromProjectLocationWorkflow("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
// Make the request
Workflow response = await workflowsClient.GetWorkflowAsync(name);

GetWorkflowAsync(GetWorkflowRequest, CallSettings)

public virtual Task<Workflow> GetWorkflowAsync(GetWorkflowRequest request, CallSettings callSettings = null)

Gets details of a single Workflow.

Parameters
Name Description
request GetWorkflowRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskWorkflow

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
GetWorkflowRequest request = new GetWorkflowRequest
{
    WorkflowName = WorkflowName.FromProjectLocationWorkflow("[PROJECT]", "[LOCATION]", "[WORKFLOW]"),
};
// Make the request
Workflow response = await workflowsClient.GetWorkflowAsync(request);

GetWorkflowAsync(GetWorkflowRequest, CancellationToken)

public virtual Task<Workflow> GetWorkflowAsync(GetWorkflowRequest request, CancellationToken cancellationToken)

Gets details of a single Workflow.

Parameters
Name Description
request GetWorkflowRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskWorkflow

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
GetWorkflowRequest request = new GetWorkflowRequest
{
    WorkflowName = WorkflowName.FromProjectLocationWorkflow("[PROJECT]", "[LOCATION]", "[WORKFLOW]"),
};
// Make the request
Workflow response = await workflowsClient.GetWorkflowAsync(request);

GetWorkflowAsync(string, CallSettings)

public virtual Task<Workflow> GetWorkflowAsync(string name, CallSettings callSettings = null)

Gets details of a single Workflow.

Parameters
Name Description
name string

Required. Name of the workflow which information should be retrieved. Format: projects/{project}/locations/{location}/workflows/{workflow}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskWorkflow

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/workflows/[WORKFLOW]";
// Make the request
Workflow response = await workflowsClient.GetWorkflowAsync(name);

GetWorkflowAsync(string, CancellationToken)

public virtual Task<Workflow> GetWorkflowAsync(string name, CancellationToken cancellationToken)

Gets details of a single Workflow.

Parameters
Name Description
name string

Required. Name of the workflow which information should be retrieved. Format: projects/{project}/locations/{location}/workflows/{workflow}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskWorkflow

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/workflows/[WORKFLOW]";
// Make the request
Workflow response = await workflowsClient.GetWorkflowAsync(name);

ListWorkflows(LocationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListWorkflowsResponse, Workflow> ListWorkflows(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists Workflows in a given project and location. The default order is not specified.

Parameters
Name Description
parent LocationName

Required. Project and location from which the workflows should be listed. Format: projects/{project}/locations/{location}

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListWorkflowsResponseWorkflow

A pageable sequence of Workflow resources.

Example
// Create client
WorkflowsClient workflowsClient = WorkflowsClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListWorkflowsResponse, Workflow> response = workflowsClient.ListWorkflows(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Workflow item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListWorkflowsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Workflow item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Workflow> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Workflow item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListWorkflows(ListWorkflowsRequest, CallSettings)

public virtual PagedEnumerable<ListWorkflowsResponse, Workflow> ListWorkflows(ListWorkflowsRequest request, CallSettings callSettings = null)

Lists Workflows in a given project and location. The default order is not specified.

Parameters
Name Description
request ListWorkflowsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListWorkflowsResponseWorkflow

A pageable sequence of Workflow resources.

Example
// Create client
WorkflowsClient workflowsClient = WorkflowsClient.Create();
// Initialize request argument(s)
ListWorkflowsRequest request = new ListWorkflowsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    OrderBy = "",
};
// Make the request
PagedEnumerable<ListWorkflowsResponse, Workflow> response = workflowsClient.ListWorkflows(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Workflow item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListWorkflowsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Workflow item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Workflow> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Workflow item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListWorkflows(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListWorkflowsResponse, Workflow> ListWorkflows(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists Workflows in a given project and location. The default order is not specified.

Parameters
Name Description
parent string

Required. Project and location from which the workflows should be listed. Format: projects/{project}/locations/{location}

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListWorkflowsResponseWorkflow

A pageable sequence of Workflow resources.

Example
// Create client
WorkflowsClient workflowsClient = WorkflowsClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListWorkflowsResponse, Workflow> response = workflowsClient.ListWorkflows(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Workflow item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListWorkflowsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Workflow item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Workflow> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Workflow item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListWorkflowsAsync(LocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListWorkflowsResponse, Workflow> ListWorkflowsAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists Workflows in a given project and location. The default order is not specified.

Parameters
Name Description
parent LocationName

Required. Project and location from which the workflows should be listed. Format: projects/{project}/locations/{location}

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListWorkflowsResponseWorkflow

A pageable asynchronous sequence of Workflow resources.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListWorkflowsResponse, Workflow> response = workflowsClient.ListWorkflowsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Workflow item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListWorkflowsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Workflow item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Workflow> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Workflow item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListWorkflowsAsync(ListWorkflowsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListWorkflowsResponse, Workflow> ListWorkflowsAsync(ListWorkflowsRequest request, CallSettings callSettings = null)

Lists Workflows in a given project and location. The default order is not specified.

Parameters
Name Description
request ListWorkflowsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListWorkflowsResponseWorkflow

A pageable asynchronous sequence of Workflow resources.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
ListWorkflowsRequest request = new ListWorkflowsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    OrderBy = "",
};
// Make the request
PagedAsyncEnumerable<ListWorkflowsResponse, Workflow> response = workflowsClient.ListWorkflowsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Workflow item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListWorkflowsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Workflow item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Workflow> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Workflow item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListWorkflowsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListWorkflowsResponse, Workflow> ListWorkflowsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists Workflows in a given project and location. The default order is not specified.

Parameters
Name Description
parent string

Required. Project and location from which the workflows should be listed. Format: projects/{project}/locations/{location}

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListWorkflowsResponseWorkflow

A pageable asynchronous sequence of Workflow resources.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListWorkflowsResponse, Workflow> response = workflowsClient.ListWorkflowsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Workflow item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListWorkflowsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Workflow item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Workflow> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Workflow item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

PollOnceCreateWorkflow(string, CallSettings)

public virtual Operation<Workflow, OperationMetadata> PollOnceCreateWorkflow(string operationName, CallSettings callSettings = null)

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

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationWorkflowOperationMetadata

The result of polling the operation.

PollOnceCreateWorkflowAsync(string, CallSettings)

public virtual Task<Operation<Workflow, OperationMetadata>> PollOnceCreateWorkflowAsync(string operationName, CallSettings callSettings = null)

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

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationWorkflowOperationMetadata

A task representing the result of polling the operation.

PollOnceDeleteWorkflow(string, CallSettings)

public virtual Operation<Empty, OperationMetadata> PollOnceDeleteWorkflow(string operationName, CallSettings callSettings = null)

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

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyOperationMetadata

The result of polling the operation.

PollOnceDeleteWorkflowAsync(string, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> PollOnceDeleteWorkflowAsync(string operationName, CallSettings callSettings = null)

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

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A task representing the result of polling the operation.

PollOnceUpdateWorkflow(string, CallSettings)

public virtual Operation<Workflow, OperationMetadata> PollOnceUpdateWorkflow(string operationName, CallSettings callSettings = null)

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

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationWorkflowOperationMetadata

The result of polling the operation.

PollOnceUpdateWorkflowAsync(string, CallSettings)

public virtual Task<Operation<Workflow, OperationMetadata>> PollOnceUpdateWorkflowAsync(string operationName, CallSettings callSettings = null)

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

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationWorkflowOperationMetadata

A task representing the result of polling the operation.

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
Type Description
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

UpdateWorkflow(UpdateWorkflowRequest, CallSettings)

public virtual Operation<Workflow, OperationMetadata> UpdateWorkflow(UpdateWorkflowRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request UpdateWorkflowRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationWorkflowOperationMetadata

The RPC response.

Example
// Create client
WorkflowsClient workflowsClient = WorkflowsClient.Create();
// Initialize request argument(s)
UpdateWorkflowRequest request = new UpdateWorkflowRequest
{
    Workflow = new Workflow(),
    UpdateMask = new FieldMask(),
};
// Make the request
Operation<Workflow, OperationMetadata> response = workflowsClient.UpdateWorkflow(request);

// Poll until the returned long-running operation is complete
Operation<Workflow, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Workflow 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<Workflow, OperationMetadata> retrievedResponse = workflowsClient.PollOnceUpdateWorkflow(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Workflow retrievedResult = retrievedResponse.Result;
}

UpdateWorkflow(Workflow, FieldMask, CallSettings)

public virtual Operation<Workflow, OperationMetadata> UpdateWorkflow(Workflow workflow, FieldMask updateMask, CallSettings callSettings = null)

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

Parameters
Name Description
workflow Workflow

Required. Workflow to be updated.

updateMask FieldMask

List of fields to be updated. If not present, the entire workflow will be updated.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationWorkflowOperationMetadata

The RPC response.

Example
// Create client
WorkflowsClient workflowsClient = WorkflowsClient.Create();
// Initialize request argument(s)
Workflow workflow = new Workflow();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Workflow, OperationMetadata> response = workflowsClient.UpdateWorkflow(workflow, updateMask);

// Poll until the returned long-running operation is complete
Operation<Workflow, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Workflow 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<Workflow, OperationMetadata> retrievedResponse = workflowsClient.PollOnceUpdateWorkflow(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Workflow retrievedResult = retrievedResponse.Result;
}

UpdateWorkflowAsync(UpdateWorkflowRequest, CallSettings)

public virtual Task<Operation<Workflow, OperationMetadata>> UpdateWorkflowAsync(UpdateWorkflowRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request UpdateWorkflowRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationWorkflowOperationMetadata

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
UpdateWorkflowRequest request = new UpdateWorkflowRequest
{
    Workflow = new Workflow(),
    UpdateMask = new FieldMask(),
};
// Make the request
Operation<Workflow, OperationMetadata> response = await workflowsClient.UpdateWorkflowAsync(request);

// Poll until the returned long-running operation is complete
Operation<Workflow, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Workflow 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<Workflow, OperationMetadata> retrievedResponse = await workflowsClient.PollOnceUpdateWorkflowAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Workflow retrievedResult = retrievedResponse.Result;
}

UpdateWorkflowAsync(UpdateWorkflowRequest, CancellationToken)

public virtual Task<Operation<Workflow, OperationMetadata>> UpdateWorkflowAsync(UpdateWorkflowRequest request, CancellationToken cancellationToken)

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

Parameters
Name Description
request UpdateWorkflowRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationWorkflowOperationMetadata

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
UpdateWorkflowRequest request = new UpdateWorkflowRequest
{
    Workflow = new Workflow(),
    UpdateMask = new FieldMask(),
};
// Make the request
Operation<Workflow, OperationMetadata> response = await workflowsClient.UpdateWorkflowAsync(request);

// Poll until the returned long-running operation is complete
Operation<Workflow, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Workflow 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<Workflow, OperationMetadata> retrievedResponse = await workflowsClient.PollOnceUpdateWorkflowAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Workflow retrievedResult = retrievedResponse.Result;
}

UpdateWorkflowAsync(Workflow, FieldMask, CallSettings)

public virtual Task<Operation<Workflow, OperationMetadata>> UpdateWorkflowAsync(Workflow workflow, FieldMask updateMask, CallSettings callSettings = null)

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

Parameters
Name Description
workflow Workflow

Required. Workflow to be updated.

updateMask FieldMask

List of fields to be updated. If not present, the entire workflow will be updated.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationWorkflowOperationMetadata

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
Workflow workflow = new Workflow();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Workflow, OperationMetadata> response = await workflowsClient.UpdateWorkflowAsync(workflow, updateMask);

// Poll until the returned long-running operation is complete
Operation<Workflow, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Workflow 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<Workflow, OperationMetadata> retrievedResponse = await workflowsClient.PollOnceUpdateWorkflowAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Workflow retrievedResult = retrievedResponse.Result;
}

UpdateWorkflowAsync(Workflow, FieldMask, CancellationToken)

public virtual Task<Operation<Workflow, OperationMetadata>> UpdateWorkflowAsync(Workflow workflow, FieldMask updateMask, CancellationToken cancellationToken)

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

Parameters
Name Description
workflow Workflow

Required. Workflow to be updated.

updateMask FieldMask

List of fields to be updated. If not present, the entire workflow will be updated.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationWorkflowOperationMetadata

A Task containing the RPC response.

Example
// Create client
WorkflowsClient workflowsClient = await WorkflowsClient.CreateAsync();
// Initialize request argument(s)
Workflow workflow = new Workflow();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Workflow, OperationMetadata> response = await workflowsClient.UpdateWorkflowAsync(workflow, updateMask);

// Poll until the returned long-running operation is complete
Operation<Workflow, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Workflow 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<Workflow, OperationMetadata> retrievedResponse = await workflowsClient.PollOnceUpdateWorkflowAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Workflow retrievedResult = retrievedResponse.Result;
}