DocumentationFundamentals

GCP Cloud Storage

Receive GCS object notifications as webhooks and upload webhook data to Google Cloud Storage using Webhook Relay service connections.

Connect Webhook Relay to Google Cloud Storage (GCS) to store incoming webhook data as GCS objects (output).

Prerequisites

  • A GCP service connection with a service account that has Cloud Storage permissions
  • A GCS bucket in your GCP project

GCP Roles

For GCS Output (upload objects):

  • roles/storage.objectCreator

GCS Output — Upload Webhook Data to Cloud Storage

GCS outputs store incoming webhook data as objects in your GCS bucket. Each webhook is saved as a separate file.

GCP GCS output

Configuration

FieldRequiredDescription
bucket_nameYesGCS bucket name
prefixNoObject name prefix (e.g. webhooks/)
file_formatNoStorage format: json (default), body_only, har

Object Path

Objects are stored with a date-based path:

{prefix}/{year}/{month}/{day}/{log_id}.json

For example: webhooks/2026/02/24/<WEBHOOK UUID>.json

Browse your GCP GCS bucket

Example: Bridge AWS SNS to GCS

Archive AWS SNS notifications as objects in a GCS bucket. Useful when your storage and analytics are on GCP but events originate in AWS:

  1. Create an AWS service connection with SNS subscribe permissions
  2. Create a GCP service connection with GCS write permissions
  3. Create a bucket in Webhook Relay
  4. Add an AWS SNS input on the bucket
  5. Add a GCS output on the bucket

Every message published to the SNS topic is stored as an object in your GCS bucket.

Transform Before Storing

Use a Function to extract or reshape the data before writing to GCS:

const snsMessage = JSON.parse(r.body)

// Store just the message content with metadata
const archived = {
    source: "aws-sns",
    topic: snsMessage.TopicArn,
    message: JSON.parse(snsMessage.Message),
    timestamp: snsMessage.Timestamp
}

r.setBody(JSON.stringify(archived))

See the JSON encoding guide for more transformation examples.

Example: GCS Events to Any HTTPS API

Forward GCS object notifications to any HTTPS endpoint — trigger external workflows without deploying Cloud Functions:

  1. Create a GCP service connection
  2. Create a bucket with a GCS input pointing to your GCS bucket
  3. Add a public destination as an output

When new objects are uploaded to GCS, Webhook Relay delivers the notification to your API. You can use Functions to add custom headers, filter by file type, or reformat the notification:

const gcsEvent = JSON.parse(r.body)

// Only forward image uploads
if (!gcsEvent.contentType.startsWith("image/")) {
    r.stopForwarding()
    return
}

// Add auth and forward
r.setHeader("Authorization", "Bearer " + cfg.get("API_TOKEN"))

Example: Mirror GCS to AWS S3

Replicate objects from a GCS bucket to an AWS S3 bucket for cross-cloud redundancy:

  1. Create a GCP service connection with GCS viewer permissions
  2. Create an AWS service connection with S3 write permissions
  3. Create a bucket with a GCS input (with body_only file format) and an AWS S3 output

New objects uploaded to your GCS bucket are automatically replicated to S3. Use the prefix setting on both sides to organize files.

Did this page help you?