Workflows v1 API - Class WorkflowsClient (2.2.0)

public abstract class WorkflowsClient

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

Workflows client wrapper, for convenient use.

Inheritance

object > WorkflowsClient

Derived Types

Namespace

Google.Cloud.Workflows.V1

Assembly

Google.Cloud.Workflows.V1.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
TypeDescription
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
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default Workflows scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

The default Workflows scopes are:

DeleteWorkflowOperationsClient

public virtual OperationsClient DeleteWorkflowOperationsClient { get; }

The long-running operations client for DeleteWorkflow.

Property Value
TypeDescription
OperationsClient

GrpcClient

public virtual Workflows.WorkflowsClient GrpcClient { get; }

The underlying gRPC Workflows client

Property Value
TypeDescription
WorkflowsWorkflowsClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
TypeDescription
LocationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

UpdateWorkflowOperationsClient

public virtual OperationsClient UpdateWorkflowOperationsClient { get; }

The long-running operations client for UpdateWorkflow.

Property Value
TypeDescription
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
TypeDescription
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
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
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 returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.

Parameters
NameDescription
parentLocationName

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

workflowWorkflow

Required. Workflow to be created.

workflowIdstring

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

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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 returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.

Parameters
NameDescription
requestCreateWorkflowRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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 returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.

Parameters
NameDescription
parentstring

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

workflowWorkflow

Required. Workflow to be created.

workflowIdstring

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

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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 returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.

Parameters
NameDescription
parentLocationName

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

workflowWorkflow

Required. Workflow to be created.

workflowIdstring

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

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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 returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.

Parameters
NameDescription
parentLocationName

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

workflowWorkflow

Required. Workflow to be created.

workflowIdstring

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

A CancellationToken to use for this RPC.

Returns
TypeDescription
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 returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.

Parameters
NameDescription
requestCreateWorkflowRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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 returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.

Parameters
NameDescription
requestCreateWorkflowRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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 returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.

Parameters
NameDescription
parentstring

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

workflowWorkflow

Required. Workflow to be created.

workflowIdstring

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

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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 returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.

Parameters
NameDescription
parentstring

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

workflowWorkflow

Required. Workflow to be created.

workflowIdstring

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

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
nameGoogle.Cloud.Workflows.Common.V1.WorkflowName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestDeleteWorkflowRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
nameGoogle.Cloud.Workflows.Common.V1.WorkflowName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
nameGoogle.Cloud.Workflows.Common.V1.WorkflowName

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
requestDeleteWorkflowRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestDeleteWorkflowRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
namestring

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
nameGoogle.Cloud.Workflows.Common.V1.WorkflowName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetWorkflowRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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]"),
    RevisionId = "",
};
// 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
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
nameGoogle.Cloud.Workflows.Common.V1.WorkflowName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
nameGoogle.Cloud.Workflows.Common.V1.WorkflowName

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
requestGetWorkflowRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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]"),
    RevisionId = "",
};
// 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
NameDescription
requestGetWorkflowRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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]"),
    RevisionId = "",
};
// 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
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
namestring

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
parentLocationName

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

pageTokenstring

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

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestListWorkflowsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

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

pageTokenstring

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

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentLocationName

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

pageTokenstring

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

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestListWorkflowsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

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

pageTokenstring

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

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
TypeDescription
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 might be created as a result of a successful update operation. In that case, the new revision is used in new workflow executions.

Parameters
NameDescription
requestUpdateWorkflowRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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 might be created as a result of a successful update operation. In that case, the new revision is used in new workflow executions.

Parameters
NameDescription
workflowWorkflow

Required. Workflow to be updated.

updateMaskFieldMask

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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 might be created as a result of a successful update operation. In that case, the new revision is used in new workflow executions.

Parameters
NameDescription
requestUpdateWorkflowRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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 might be created as a result of a successful update operation. In that case, the new revision is used in new workflow executions.

Parameters
NameDescription
requestUpdateWorkflowRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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 might be created as a result of a successful update operation. In that case, the new revision is used in new workflow executions.

Parameters
NameDescription
workflowWorkflow

Required. Workflow to be updated.

updateMaskFieldMask

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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 might be created as a result of a successful update operation. In that case, the new revision is used in new workflow executions.

Parameters
NameDescription
workflowWorkflow

Required. Workflow to be updated.

updateMaskFieldMask

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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;
}