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.

## Cloud Storage JSON API

Stores and retrieves potentially large, immutable data objects.
To learn more, see the [Cloud Storage JSON API documentation](https://developers.google.com/storage/docs/json_api/).

> [!NOTE]
> **Note:** The Cloud Storage connector supports simple object uploads and downloads. For resumable uploads or batch requests, instead of using the connector, define a workflow step that [makes an HTTP call](https://docs.cloud.google.com/workflows/docs/http-requests) to the [Cloud Storage JSON API endpoints](https://docs.cloud.google.com/storage/docs/request-endpoints).

You should URL-encode object names to be path safe. You can use the
[`url_encode`](https://docs.cloud.google.com/workflows/docs/reference/stdlib/text/url_encode) and
[`url_encode_plus`](https://docs.cloud.google.com/workflows/docs/reference/stdlib/text/url_encode_plus)
functions to encode applicable characters when they appear in either the object
name or query string of a request URL. If you don't url-encode your object name
and your storage bucket has [folders](https://docs.cloud.google.com/storage/docs/folders), the request will
fail. For more information, see
[Encoding URL path parts](https://docs.cloud.google.com/storage/docs/request-endpoints#encoding) and
[Cloud Storage naming considerations](https://docs.cloud.google.com/storage/docs/objects#naming).

## Cloud Storage JSON connector sample

### YAML

    # This workflow demonstrates how to use the Cloud Storage connector:
    # Create a bucket and upload an object to the bucket
    # Delete the bucket and the object
    # Expected output: "SUCCESS"
    - init:
        assign:
          - project_id: ${sys.get_env("GOOGLE_CLOUD_PROJECT_ID")}
          - bucket_name: "BUCKET_NAME"  # replace BUCKET_NAME and FILE_NAME placeholders
          - encoded_object_name: ${text.url_encode("FILE_NAME.txt")}  # URL-encode object names to be path safe
    - create_bucket:
        call: googleapis.storage.v1.buckets.insert
        args:
          project: ${project_id}
          body:
            name: ${bucket_name}
    - upload_object_media:
        call: googleapis.storage.v1.objects.insert
        args:
          bucket: ${bucket_name}
          uploadType: "media"  # uploads object data
          name: ${encoded_object_name}
          body: "hello world"
    - download_object_media:
        call: googleapis.storage.v1.objects.get
        args:
          bucket: ${bucket_name}
          object: ${encoded_object_name}
          alt: "media"  # gets object data
        result: object_data
    # If `alt` is not set, get metadata
    - get_object_metadata:
        call: googleapis.storage.v1.objects.get
        args:
          bucket: ${bucket_name}
          object: ${encoded_object_name}
        result: object_metadata
    - get_bucket:
        call: googleapis.storage.v1.buckets.get
        args:
          bucket: ${bucket_name}
    - delete_object:
        call: googleapis.storage.v1.objects.delete
        args:
          bucket: ${bucket_name}
          object: ${encoded_object_name}
    - delete_bucket:
        call: googleapis.storage.v1.buckets.delete
        args:
          bucket: ${bucket_name}
    - the_end:
        return: "SUCCESS"

### JSON

    [
      {
        "init": {
          "assign": [
            {
              "project_id": "${sys.get_env(\"GOOGLE_CLOUD_PROJECT_ID\")}"
            },
            {
              "bucket_name": "BUCKET_NAME"
            },
            {
              "encoded_object_name": "${text.url_encode(\"FILE_NAME.txt\")}"
            }
          ]
        }
      },
      {
        "create_bucket": {
          "call": "googleapis.storage.v1.buckets.insert",
          "args": {
            "project": "${project_id}",
            "body": {
              "name": "${bucket_name}"
            }
          }
        }
      },
      {
        "upload_object_media": {
          "call": "googleapis.storage.v1.objects.insert",
          "args": {
            "bucket": "${bucket_name}",
            "uploadType": "media",
            "name": "${encoded_object_name}",
            "body": "hello world"
          }
        }
      },
      {
        "download_object_media": {
          "call": "googleapis.storage.v1.objects.get",
          "args": {
            "bucket": "${bucket_name}",
            "object": "${encoded_object_name}",
            "alt": "media"
          },
          "result": "object_data"
        }
      },
      {
        "get_object_metadata": {
          "call": "googleapis.storage.v1.objects.get",
          "args": {
            "bucket": "${bucket_name}",
            "object": "${encoded_object_name}"
          },
          "result": "object_metadata"
        }
      },
      {
        "get_bucket": {
          "call": "googleapis.storage.v1.buckets.get",
          "args": {
            "bucket": "${bucket_name}"
          }
        }
      },
      {
        "delete_object": {
          "call": "googleapis.storage.v1.objects.delete",
          "args": {
            "bucket": "${bucket_name}",
            "object": "${encoded_object_name}"
          }
        }
      },
      {
        "delete_bucket": {
          "call": "googleapis.storage.v1.buckets.delete",
          "args": {
            "bucket": "${bucket_name}"
          }
        }
      },
      {
        "the_end": {
          "return": "SUCCESS"
        }
      }
    ]

## Module: googleapis.storage.v1.bucketAccessControls

| Functions ||
|---|---|
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/bucketAccessControls/delete` | Permanently deletes the ACL entry for the specified entity on the specified bucket. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/bucketAccessControls/get` | Returns the ACL entry for the specified entity on the specified bucket. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/bucketAccessControls/insert` | Creates a new ACL entry on the specified bucket. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/bucketAccessControls/list` | Retrieves ACL entries on the specified bucket. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/bucketAccessControls/patch` | Patches an ACL entry on the specified bucket. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/bucketAccessControls/update` | Updates an ACL entry on the specified bucket. |

## Module: googleapis.storage.v1.buckets

| Functions ||
|---|---|
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/buckets/delete` | Permanently deletes an empty bucket. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/buckets/get` | Returns metadata for the specified bucket. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/buckets/getIamPolicy` | Returns an IAM policy for the specified bucket. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/buckets/insert` | Creates a new bucket. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/buckets/list` | Retrieves a list of buckets for a given project. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/buckets/lockRetentionPolicy` | Locks retention policy on a bucket. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/buckets/patch` | Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/buckets/setIamPolicy` | Updates an IAM policy for the specified bucket. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/buckets/testIamPermissions` | Tests a set of permissions on the given bucket to see which, if any, are held by the caller. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/buckets/update` | Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate. |

## Module: googleapis.storage.v1.channels

| Functions ||
|---|---|
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/channels/stop` | Stop watching resources through this channel |

## Module: googleapis.storage.v1.defaultObjectAccessControls

| Functions ||
|---|---|
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/defaultObjectAccessControls/delete` | Permanently deletes the default object ACL entry for the specified entity on the specified bucket. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/defaultObjectAccessControls/get` | Returns the default object ACL entry for the specified entity on the specified bucket. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/defaultObjectAccessControls/insert` | Creates a new default object ACL entry on the specified bucket. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/defaultObjectAccessControls/list` | Retrieves default object ACL entries on the specified bucket. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/defaultObjectAccessControls/patch` | Patches a default object ACL entry on the specified bucket. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/defaultObjectAccessControls/update` | Updates a default object ACL entry on the specified bucket. |

## Module: googleapis.storage.v1.notifications

| Functions ||
|---|---|
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/notifications/delete` | Permanently deletes a notification subscription. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/notifications/get` | View a notification configuration. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/notifications/insert` | Creates a notification subscription for a given bucket. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/notifications/list` | Retrieves a list of notification subscriptions for a given bucket. |

## Module: googleapis.storage.v1.objectAccessControls

| Functions ||
|---|---|
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/objectAccessControls/delete` | Permanently deletes the ACL entry for the specified entity on the specified object. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/objectAccessControls/get` | Returns the ACL entry for the specified entity on the specified object. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/objectAccessControls/insert` | Creates a new ACL entry on the specified object. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/objectAccessControls/list` | Retrieves ACL entries on the specified object. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/objectAccessControls/patch` | Patches an ACL entry on the specified object. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/objectAccessControls/update` | Updates an ACL entry on the specified object. |

## Module: googleapis.storage.v1.objects

| Functions ||
|---|---|
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/objects/compose` | Concatenates a list of existing objects into a new object in the same bucket. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/objects/copy` | Copies a source object to a destination object. Optionally overrides metadata. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/objects/delete` | Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/objects/get` | Retrieves an object or its metadata. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/objects/insert` | Stores a new object and metadata. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/objects/list` | Retrieves a list of objects matching the criteria. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/objects/patch` | Patches an object's metadata. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/objects/rewrite` | Rewrites a source object to a destination object. Optionally overrides metadata. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/objects/update` | Updates an object's metadata. |
| `https://docs.cloud.google.com/workflows/docs/reference/googleapis/storage/v1/objects/watchAll` | Watch for changes on all objects in a bucket. |