Delete a workflow using Ruby

Deletes a workflow using Ruby.

Code sample


Before trying this sample, follow the Ruby setup instructions in the Workflows quickstart using client libraries. For more information, see the Workflows Ruby API reference documentation.

require "google/cloud/workflows/v1"

# Create a client object. The client can be reused for multiple calls.
client =

# Create a request. To set request fields, pass in keyword arguments.
request =

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
  puts "Error!"

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.