Skip to main content

Google Cloud Storage Component

Manage files in a Google Cloud Platform (GCP) Cloud Storage bucket

Component key: google-cloud-storage

Changelog ↓

Description

Google Cloud Storage is Google's cloud file/blob storage system. The Google Cloud Storage component allows you to create, download, modify, list, and delete files stored in a Google Cloud Storage bucket.

API Documentation

This component was built using the Google Cloud Storage JSON API

Documentation for the Node.js client used in this component can be found at https://googleapis.dev/nodejs/storage/latest.

A common integration pattern involves listing files in a file store, and performing a series of actions on the array of files that are returned. See our looping over files quickstart for information about how to create a loop over an array of files.

Connections

Google OAuth 2.0

InputNotesExample
Authorize URLhttps://accounts.google.com/o/oauth2/v2/auth?access_type=offline&prompt=consent
Client ID

The Client ID from the Google Cloud Console OAuth credentials.

123456789012-abc123def456ghi789jkl012mno345pq.apps.googleusercontent.com
Client Secret

The Client Secret from the Google Cloud Console OAuth credentials.

Project ID

The ID of the Google Cloud Platform project that hosts the storage bucket.

my-project-123456
Scopes

OAuth scopes for Google Cloud Storage. See https://developers.google.com/identity/protocols/oauth2/scopes#storage for available scopes.

https://www.googleapis.com/auth/devstorage.read_write
Token URLhttps://oauth2.googleapis.com/token

Google Cloud Storage Private Key

To authenticate with Google Cloud Storage, a service account with a private key is required.

For more information on creating service accounts, refer to Google Cloud's authentication documentation.

Prerequisites

  • Access to a Google Cloud Platform (GCP) project
  • Permissions to create service accounts and assign roles

Setup Steps

To create a service account and generate a private key:

  1. Navigate to the Service Accounts page in the Google Cloud Console
  2. Select a project or create a new one
  3. Click Create Service Account
  4. Enter a service account name and description, then click Create and Continue
  5. Assign the appropriate role:
    • For full access to Cloud Storage: Select Cloud Storage Admin
    • For specific permissions: Select a resource-specific role based on requirements
  6. Click Continue, then Done
  7. In the service accounts list, click on the newly created service account
  8. Navigate to the Keys tab
  9. Click Add Key and select Create new key
  10. Select JSON as the key type and click Create
  11. A JSON file will be downloaded containing the service account credentials

Configure the Connection

The downloaded JSON file contains several fields including type, project_id, private_key, client_email, and others.

Enter the following values from the JSON file into the connection configuration:

  • Extract the required fields from the JSON file
  • Enter the Project ID (GCP Project ID)
  • Enter the service account credentials from the JSON file
Service Account Permissions

Ensure the service account has the appropriate permissions to access the Cloud Storage resources needed for the integration. Resource-specific permissions can be used for more granular access control.

InputNotesExample
Client Email

The service account email address from the JSON key file.

my-service-account@my-project-123456.iam.gserviceaccount.com
Private Key

The private key from the JSON key file. Include the entire key including BEGIN and END markers.

-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBg...\n-----END PRIVATE KEY-----\n
Project ID

The ID of the Google Cloud Platform project that hosts the storage bucket.

my-project-123456

Data Sources

Select Bucket

Select a Google Cloud Storage bucket from a dropdown menu | key: selectBucket | type: picklist

InputNotesExample
Connection

{
"result": [
"my-gcs-bucket",
"project-backups",
"user-uploads"
]
}

Select File

Select a file from a Google Cloud Storage bucket | key: selectFile | type: picklist

InputNotesExample
Bucket Name

The name of the Google Cloud Storage bucket. Bucket names contain only lowercase letters, numbers, hyphens, and underscores.

my-gcs-bucket
Connection
Prefix

Filter results to only files with names starting with this prefix. For example, 'unprocessed/' returns only files in that directory. Leave blank to list all files.

path/to/directory/

{
"result": [
"documents/report-2024.pdf",
"images/logo.png",
"data/export-2024-01.csv"
]
}

Actions

Complete Multipart Upload

Completes a multipart upload for a file in Google Cloud Storage | key: completeMultipartUpload

InputNotesExample
Connection
Destination Bucket

The name of the bucket where the file will be copied. When copying files within a single bucket, use the same bucket name for both source and destination.

my-destination-bucket
File Name

The file path within the bucket. Do not include a leading slash.

path/to/file.txt
Part Uploads

A JSON array of part uploads. Each part must have a partNumber and etag property. <strong>Note:</strong> Parts less than 5 MiB that are not the final part will result in a 400 Bad Request error.

Upload ID

The unique identifier for the multipart upload. This value is returned when the multipart upload is initiated.

VXBsb2FkIElEIGZvciBlbHZpbmcncyBteS1tb3ZpZS5tMnRzIHVwbG9hZA

{
"data": {
"CompleteMultipartUploadResult": {
"Location": {
"_text": "https://storage.googleapis.com/my-gcs-bucket/uploads/large-video.mp4"
},
"Bucket": {
"_text": "my-gcs-bucket"
},
"Key": {
"_text": "uploads/large-video.mp4"
},
"ETag": {
"_text": "\"a2a6ca083c7e6d13893dc34c6daf43f6-7\""
}
}
}
}

Copy Files

Copy a file from one Google Cloud Storage bucket to another | key: copyFile

InputNotesExample
Connection
Destination Bucket

The name of the bucket where the file will be copied. When copying files within a single bucket, use the same bucket name for both source and destination.

my-destination-bucket
Destination File Name

The destination file path within the bucket. Do not include a leading slash.

path/to/destination/file.txt
Source Bucket

The name of the bucket containing the file to copy. When copying files within a single bucket, use the same bucket name for both source and destination.

my-source-bucket
Source File Name

The source file path within the bucket. Do not include a leading slash.

path/to/source/file.txt

{
"data": {
"kind": "storage#object",
"id": "my-destination-bucket/documents/report-2024-copy.pdf/1705411200000000",
"selfLink": "https://www.googleapis.com/storage/v1/b/my-destination-bucket/o/documents%2Freport-2024-copy.pdf",
"mediaLink": "https://storage.googleapis.com/download/storage/v1/b/my-destination-bucket/o/documents%2Freport-2024-copy.pdf?generation=1705411200000000&alt=media",
"name": "documents/report-2024-copy.pdf",
"bucket": "my-destination-bucket",
"generation": "1705411200000000",
"metageneration": "1",
"contentType": "application/pdf",
"storageClass": "STANDARD",
"size": "2457600",
"md5Hash": "5d8eb89ce5dc25d54896006b6583eaa0",
"crc32c": "xgdNfQ==",
"etag": "CODg8PPX5oQDEAE=",
"timeCreated": "2024-01-16T10:00:00.000Z",
"updated": "2024-01-16T10:00:00.000Z",
"timeStorageClassUpdated": "2024-01-16T10:00:00.000Z",
"contentEncoding": null,
"contentDisposition": null,
"contentLanguage": null,
"cacheControl": null,
"metadata": null,
"temporaryHold": false,
"eventBasedHold": false
}
}

Create Bucket

Create a new Bucket inside Google Cloud Storage | key: createBucket

InputNotesExample
Bucket Name

The name of the Google Cloud Storage bucket. Bucket names contain only lowercase letters, numbers, hyphens, and underscores.

my-gcs-bucket
Connection
Location

The geographic location where the bucket will be created. Defaults to 'US'. See https://cloud.google.com/storage/docs/locations for available locations.

US-EAST1
Multi-Regional

When true, the bucket will be available from multiple regions.

false
Storage Class

The storage class for the bucket. See https://cloud.google.com/storage/docs/storage-classes for details.

User Project

The project ID that the user creating the bucket belongs to.

my-example-project

{
"data": [
{
"kind": "storage#bucket",
"id": "my-gcs-bucket",
"selfLink": "https://www.googleapis.com/storage/v1/b/my-gcs-bucket",
"projectNumber": "123456789012",
"name": "my-gcs-bucket",
"timeCreated": "2024-01-10T08:00:00.000Z",
"updated": "2024-01-15T14:30:00.000Z",
"metageneration": "3",
"location": "US-EAST1",
"locationType": "region",
"storageClass": "STANDARD",
"etag": "CAM=",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false
},
"uniformBucketLevelAccess": {
"enabled": false
},
"publicAccessPrevention": "inherited"
},
"versioning": {
"enabled": false
},
"labels": null,
"lifecycle": {
"rule": []
},
"cors": [],
"encryption": null,
"logging": null,
"website": null,
"billing": null,
"retentionPolicy": null,
"defaultEventBasedHold": false
}
]
}

Create Multipart Upload

Create a multipart upload for a file in Google Cloud Storage | key: createMultipartUpload

InputNotesExample
Connection
Content Type

The MIME type of the file (e.g., image/png, application/pdf, text/plain).

image/png
Destination Bucket

The name of the bucket where the file will be copied. When copying files within a single bucket, use the same bucket name for both source and destination.

my-destination-bucket
File Name

The file path within the bucket. Do not include a leading slash.

path/to/file.txt

{
"data": {
"InitiateMultipartUploadResult": {
"Bucket": {
"_text": "my-gcs-bucket"
},
"Key": {
"_text": "uploads/large-video.mp4"
},
"UploadId": {
"_text": "ABPnzm5uCe3g2XLS5kkxHPDZYrE68x87DhmcnJM1kKZ8ECXTtWCtJYHATzeych__ZDfWWN8"
}
}
}
}

Delete Bucket

Delete an existing Bucket from the Google Cloud Storage | key: deleteBucket

InputNotesExample
Bucket Name

The name of the Google Cloud Storage bucket. Bucket names contain only lowercase letters, numbers, hyphens, and underscores.

my-gcs-bucket
Connection

{
"data": null
}

Delete File

Delete a file from a Google Cloud Storage bucket | key: deleteFile

InputNotesExample
Bucket Name

The name of the Google Cloud Storage bucket. Bucket names contain only lowercase letters, numbers, hyphens, and underscores.

my-gcs-bucket
Connection
File Name

The file path within the bucket. Do not include a leading slash.

path/to/file.txt

{
"data": null
}

Download File

Download a file from Google Cloud Storage | key: downloadFile

InputNotesExample
Bucket Name

The name of the Google Cloud Storage bucket. Bucket names contain only lowercase letters, numbers, hyphens, and underscores.

my-gcs-bucket
Connection
File Name

The file path within the bucket. Do not include a leading slash.

path/to/file.txt

{
"data": "base64EncodedFileContent==",
"contentType": "application/pdf"
}

Generate Presigned URL

Generate a presigned URL to upload a file in Google Cloud Storage | key: generatePresignedUrl

InputNotesExample
Bucket Name

The name of the Google Cloud Storage bucket. Bucket names contain only lowercase letters, numbers, hyphens, and underscores.

my-gcs-bucket
Connection
Expiration Time

The expiration time for the presigned URL in seconds. Defaults to 3600 (1 hour).

3600
File Name

The file name to generate a presigned URL for. This should be the full file name, including any directories. For example, my-directory/my-file.txt

path/to/file.txt

{
"data": "https://storage.googleapis.com/my-gcs-bucket/documents/upload-file.pdf?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=service-account%40project-123456.iam.gserviceaccount.com%2F20240116%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20240116T100000Z&X-Goog-Expires=3600&X-Goog-SignedHeaders=content-type%3Bhost&X-Goog-Signature=abcdef123456"
}

Get Bucket

Get the information and metadata of an existing Bucket from the Google Cloud Storage | key: getBucket

InputNotesExample
Bucket Name

The name of the Google Cloud Storage bucket. Bucket names contain only lowercase letters, numbers, hyphens, and underscores.

my-gcs-bucket
Connection

{
"data": [
{
"kind": "storage#bucket",
"id": "my-gcs-bucket",
"selfLink": "https://www.googleapis.com/storage/v1/b/my-gcs-bucket",
"projectNumber": "123456789012",
"name": "my-gcs-bucket",
"timeCreated": "2024-01-10T08:00:00.000Z",
"updated": "2024-01-15T14:30:00.000Z",
"metageneration": "3",
"location": "US-EAST1",
"locationType": "region",
"storageClass": "STANDARD",
"etag": "CAM=",
"iamConfiguration": {
"bucketPolicyOnly": {
"enabled": false
},
"uniformBucketLevelAccess": {
"enabled": false
},
"publicAccessPrevention": "inherited"
},
"versioning": {
"enabled": false
},
"labels": null,
"lifecycle": {
"rule": []
},
"cors": [],
"encryption": null,
"logging": null,
"website": null,
"billing": null,
"retentionPolicy": null,
"defaultEventBasedHold": false
}
]
}

Get File

Get the information and metadata of a file from Google Cloud Storage | key: getFile

InputNotesExample
Bucket Name

The name of the Google Cloud Storage bucket. Bucket names contain only lowercase letters, numbers, hyphens, and underscores.

my-gcs-bucket
Connection
File Name

The file path within the bucket. Do not include a leading slash.

path/to/file.txt

{
"data": {
"kind": "storage#object",
"id": "bucket-name/file-name.txt/1234567890123456",
"name": "file-name.txt",
"bucket": "bucket-name",
"generation": "1234567890123456",
"metageneration": "1",
"contentType": "text/plain",
"timeCreated": "2021-01-01T00:00:00.000Z",
"updated": "2021-01-01T00:00:00.000Z",
"storageClass": "STANDARD",
"timeStorageClassUpdated": "2021-01-01T00:00:00.000Z",
"size": "1234",
"md5Hash": "abc123==",
"mediaLink": "https://storage.googleapis.com/download/storage/v1/b/bucket-name/o/file-name.txt",
"crc32c": "abc123==",
"etag": "abc123=="
},
"contentType": "text/plain"
}

List Buckets

List buckets in a Google Cloud Storage project | key: listBuckets

InputNotesExample
Connection
Fetch All Results

When true, automatically fetches all pages of results using pagination.

false

{
"data": [
{
"kind": "storage#bucket",
"id": "my-gcs-bucket",
"selfLink": "https://www.googleapis.com/storage/v1/b/my-gcs-bucket",
"projectNumber": "123456789012",
"name": "my-gcs-bucket",
"timeCreated": "2024-01-10T08:00:00.000Z",
"updated": "2024-01-15T14:30:00.000Z",
"metageneration": "3",
"location": "US-EAST1",
"locationType": "region",
"storageClass": "STANDARD",
"etag": "CAM="
},
{
"kind": "storage#bucket",
"id": "project-backups",
"selfLink": "https://www.googleapis.com/storage/v1/b/project-backups",
"projectNumber": "123456789012",
"name": "project-backups",
"timeCreated": "2024-01-05T12:00:00.000Z",
"updated": "2024-01-10T09:15:00.000Z",
"metageneration": "1",
"location": "US",
"locationType": "multi-region",
"storageClass": "NEARLINE",
"etag": "CAE="
},
{
"kind": "storage#bucket",
"id": "user-uploads",
"selfLink": "https://www.googleapis.com/storage/v1/b/user-uploads",
"projectNumber": "123456789012",
"name": "user-uploads",
"timeCreated": "2023-12-20T10:00:00.000Z",
"updated": "2024-01-12T16:45:00.000Z",
"metageneration": "5",
"location": "US-WEST1",
"locationType": "region",
"storageClass": "STANDARD",
"etag": "CAU="
}
]
}

List Files

List files in a Google Cloud Storage bucket | key: listFilesV2

InputNotesExample
Bucket Name

The name of the Google Cloud Storage bucket. Bucket names contain only lowercase letters, numbers, hyphens, and underscores.

my-gcs-bucket
Connection
Fetch All Results

When true, automatically fetches all pages of results using pagination.

false
Max Results

The maximum number of results to return per page. Must be between 1 and 50.

20
Page Token

The pagination token returned by a previous request. Use this to retrieve the next page of results.

bXkvbGFzdC9wcm9jZXNzZWQvZmlsZS50eHQ
Prefix

Filter results to only files with names starting with this prefix. For example, 'unprocessed/' returns only files in that directory. Leave blank to list all files.

path/to/directory/

{
"data": {
"files": [
"documents/report-2024.pdf",
"documents/presentation-q1.pptx",
"documents/spreadsheet-data.xlsx",
"images/logo.png",
"images/banner.jpg"
],
"pagination": {
"pageToken": "bXkvbGFzdC9wcm9jZXNzZWQvZmlsZS50eHQ=",
"maxResults": 20,
"prefix": "documents/"
}
}
}

Move File

Move a file from one Google Cloud Storage bucket to another | key: moveFile

InputNotesExample
Connection
Destination Bucket

The name of the bucket where the file will be copied. When copying files within a single bucket, use the same bucket name for both source and destination.

my-destination-bucket
Destination File Name

The destination file path within the bucket. Do not include a leading slash.

path/to/destination/file.txt
Source Bucket

The name of the bucket containing the file to copy. When copying files within a single bucket, use the same bucket name for both source and destination.

my-source-bucket
Source File Name

The source file path within the bucket. Do not include a leading slash.

path/to/source/file.txt

{
"data": {
"kind": "storage#object",
"id": "my-destination-bucket/documents/report-2024-copy.pdf/1705411200000000",
"selfLink": "https://www.googleapis.com/storage/v1/b/my-destination-bucket/o/documents%2Freport-2024-copy.pdf",
"mediaLink": "https://storage.googleapis.com/download/storage/v1/b/my-destination-bucket/o/documents%2Freport-2024-copy.pdf?generation=1705411200000000&alt=media",
"name": "documents/report-2024-copy.pdf",
"bucket": "my-destination-bucket",
"generation": "1705411200000000",
"metageneration": "1",
"contentType": "application/pdf",
"storageClass": "STANDARD",
"size": "2457600",
"md5Hash": "5d8eb89ce5dc25d54896006b6583eaa0",
"crc32c": "xgdNfQ==",
"etag": "CODg8PPX5oQDEAE=",
"timeCreated": "2024-01-16T10:00:00.000Z",
"updated": "2024-01-16T10:00:00.000Z",
"timeStorageClassUpdated": "2024-01-16T10:00:00.000Z",
"contentEncoding": null,
"contentDisposition": null,
"contentLanguage": null,
"cacheControl": null,
"metadata": null,
"temporaryHold": false,
"eventBasedHold": false
}
}

Raw Request

Send raw HTTP request to Google Cloud Storage | key: rawRequest

InputNotesExample
Connection
Data

The HTTP body payload to send to the URL.

{"exampleKey": "Example Data"}
File Data

File Data to be sent as a multipart form upload.

[{key: "example.txt", value: "My File Contents"}]
File Data File Names

File names to apply to the file data inputs. Keys must match the file data keys above.

Form Data

The Form Data to be sent as a multipart form upload.

[{"key": "Example Key", "value": new Buffer("Hello World")}]
Header

A list of headers to send with the request.

User-Agent: curl/7.64.1
Max Retry Count

The maximum number of retries to attempt. Specify 0 for no retries.

0
Method

The HTTP method to use.

Query Parameter

A list of query parameters to send with the request. This is the portion at the end of the URL similar to ?key1=value1&key2=value2.

Response Type

The type of data you expect in the response. You can request json, text, or binary data.

json
Retry On All Errors

If true, retries on all erroneous responses regardless of type. This is helpful when retrying after HTTP 429 or other 3xx or 4xx errors. Otherwise, only retries on HTTP 5xx and network errors.

false
Retry Delay (ms)

The delay in milliseconds between retries. This is used when 'Use Exponential Backoff' is disabled.

0
Timeout

The maximum time that a client will await a response to its request

2000
URL

Input the path only (/storage/v1/b/[BUCKET_NAME]/o/[OBJECT_NAME]), The base URL is already included (https://storage.googleapis.com).

/storage/v1/b/[BUCKET_NAME]/o/[OBJECT_NAME]
Use Exponential Backoff

Specifies whether to use a pre-defined exponential backoff strategy for retries. When enabled, 'Retry Delay (ms)' is ignored.

false

{
"data": {
"kind": "storage#object",
"id": "my-gcs-bucket/path/to/file.txt/1705324800000000",
"name": "path/to/file.txt",
"bucket": "my-gcs-bucket",
"generation": "1705324800000000",
"metageneration": "1",
"contentType": "text/plain",
"storageClass": "STANDARD",
"size": "1024",
"timeCreated": "2024-01-15T10:00:00.000Z",
"updated": "2024-01-15T10:00:00.000Z"
}
}

Save File

Save a file to Google Cloud Storage | key: saveFile

InputNotesExample
Bucket Name

The name of the Google Cloud Storage bucket. Bucket names contain only lowercase letters, numbers, hyphens, and underscores.

my-gcs-bucket
Connection
File Contents

The contents to write to a file. This can be a string of text, it can be binary data (like an image or PDF) that was generated in a previous step.

My File Contents
File Metadata

When true, returns the file metadata after saving. Read access to the bucket is required.

true
File Name

The file path within the bucket. Do not include a leading slash.

path/to/file.txt
note

File Contents can be a reference to a binary file (JavaScript Buffer) from a previous step. For example, if you have an HTTP Get action that pulls down a .png image, you can reference its step name to write the .png to Google Cloud Storage. Or, File Contents can be simple text, like 'Hello World'.

{
"data": {
"kind": "storage#object",
"id": "my-gcs-bucket/documents/report-2024.pdf/1705324800000000",
"selfLink": "https://www.googleapis.com/storage/v1/b/my-gcs-bucket/o/documents%2Freport-2024.pdf",
"mediaLink": "https://storage.googleapis.com/download/storage/v1/b/my-gcs-bucket/o/documents%2Freport-2024.pdf?generation=1705324800000000&alt=media",
"name": "documents/report-2024.pdf",
"bucket": "my-gcs-bucket",
"generation": "1705324800000000",
"metageneration": "1",
"contentType": "application/pdf",
"storageClass": "STANDARD",
"size": "2457600",
"md5Hash": "5d8eb89ce5dc25d54896006b6583eaa0",
"crc32c": "xgdNfQ==",
"etag": "CODg8PPX5oQDEAE=",
"timeCreated": "2024-01-15T10:00:00.000Z",
"updated": "2024-01-15T10:00:00.000Z",
"timeStorageClassUpdated": "2024-01-15T10:00:00.000Z",
"contentEncoding": null,
"contentDisposition": null,
"contentLanguage": null,
"cacheControl": null,
"metadata": null,
"temporaryHold": false,
"eventBasedHold": false
}
}

Upload Part of a Multipart Upload

Upload a part of a multipart upload to Google Cloud Storage | key: uploadPartOfAMultipartUpload

InputNotesExample
Connection
Destination Bucket

The name of the bucket where the file will be copied. When copying files within a single bucket, use the same bucket name for both source and destination.

my-destination-bucket
File Contents

The contents to write to a file. This can be a string of text, it can be binary data (like an image or PDF) that was generated in a previous step.

My File Contents
File Name

The file path within the bucket. Do not include a leading slash.

path/to/file.txt
Part Number

The position of this part within the multipart upload. Must be an integer between 1 and 10,000.

1
Upload ID

The unique identifier for the multipart upload. This value is returned when the multipart upload is initiated.

VXBsb2FkIElEIGZvciBlbHZpbmcncyBteS1tb3ZpZS5tMnRzIHVwbG9hZA

{
"data": {
"PartNumber": 1,
"ETag": "5fbd6b4faa5393f343d276457f3f7d9f"
}
}

Changelog

2025-10-28

Added inline data sources for buckets and files to enhance data selection capabilities