Workflows API Connector Overview

The Workflows connector defines the built-in functions that can be used to access other Google Cloud products within a workflow.

This page provides an overview of the individual connector. There is no need to import or load connector libraries in a workflow—connectors work out of the box when used in a call step.

Workflows API

Manage workflow definitions. To execute workflows and manage executions, see the Workflows Executions API. To learn more, see the Workflows API documentation.

Workflows connector sample

YAML

# This workflow demonstrates how to use the Cloud Workflows connector.
# The workflow creates/gets/deletes a workflow.
# Expected successful output: "SUCCESS"

- init:
    assign:
      - project: ${sys.get_env("GOOGLE_CLOUD_PROJECT_ID")}
      - location: "us-central1"
      - workflow: "example-workflow"
- create_workflow:
    call: googleapis.workflows.v1.projects.locations.workflows.create
    args:
      parent: ${"projects/" + project + "/locations/" + location}
      workflowId: ${workflow}
      body:
        name: ${"projects/" + project + "/locations/" + location + "/workflows/" + workflow}
        description: "An example workflow to be created and deleted."
        sourceContents: "- step:\n    next: end"
- get_workflow:
    call: googleapis.workflows.v1.projects.locations.workflows.get
    args:
      name: ${"projects/" + project + "/locations/" + location + "/workflows/" + workflow}
- delete_workflow:
    call: googleapis.workflows.v1.projects.locations.workflows.delete
    args:
      name: ${"projects/" + project + "/locations/" + location + "/workflows/" + workflow}
- the_end:
    return: "SUCCESS"

JSON

[
  {
    "init": {
      "assign": [
        {
          "project": "${sys.get_env(\"GOOGLE_CLOUD_PROJECT_ID\")}"
        },
        {
          "location": "us-central1"
        },
        {
          "workflow": "example-workflow"
        }
      ]
    }
  },
  {
    "create_workflow": {
      "call": "googleapis.workflows.v1.projects.locations.workflows.create",
      "args": {
        "parent": "${\"projects/\" + project + \"/locations/\" + location}",
        "workflowId": "${workflow}",
        "body": {
          "name": "${\"projects/\" + project + \"/locations/\" + location + \"/workflows/\" + workflow}",
          "description": "An example workflow to be created and deleted.",
          "sourceContents": "- step:\n    next: end"
        }
      }
    }
  },
  {
    "get_workflow": {
      "call": "googleapis.workflows.v1.projects.locations.workflows.get",
      "args": {
        "name": "${\"projects/\" + project + \"/locations/\" + location + \"/workflows/\" + workflow}"
      }
    }
  },
  {
    "delete_workflow": {
      "call": "googleapis.workflows.v1.projects.locations.workflows.delete",
      "args": {
        "name": "${\"projects/\" + project + \"/locations/\" + location + \"/workflows/\" + workflow}"
      }
    }
  },
  {
    "the_end": {
      "return": "SUCCESS"
    }
  }
]

Module: googleapis.workflows.v1.projects.locations

Functions
get Gets information about a location.
list Lists information about the supported locations for this service.

Module: googleapis.workflows.v1.projects.locations.operations

Functions
delete Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.
get Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
list Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED. NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as "/v1/{name=users/*}/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.

Module: googleapis.workflows.v1.projects.locations.workflows

Functions
create 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 error.
delete Deletes a workflow with the specified name. This method also cancels and deletes all running executions of the workflow.
get Gets details of a single Workflow.
list Lists Workflows in a given project and location. The default order is not specified.
patch 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.

Module: googleapis.workflows.v1beta.projects.locations

Functions
get Gets information about a location.
list Lists information about the supported locations for this service.

Module: googleapis.workflows.v1beta.projects.locations.operations

Functions
delete Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.
get Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
list Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED. NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as "/v1/{name=users/*}/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.

Module: googleapis.workflows.v1beta.projects.locations.workflows

Functions
create 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 error.
delete Deletes a workflow with the specified name. This method also cancels and deletes all running executions of the workflow.
get Gets details of a single Workflow.
list Lists Workflows in a given project and location. The default order is not specified.
patch 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.