Recipe Watch Drive Changes

by googleworkspacea3768d0e82adNo licenseListed Oct 8, 2026Updated Oct 8, 2026

Subscribe to change notifications on a Google Drive file or folder.

Instructions onlyDevOps & Cloud
AI-generated overview

Sets up and maintains Google Drive change-notification subscriptions using the gws events CLI.

What it does
This recipe walks through subscribing to change notifications on a Google Drive file or folder. It shows the gws events subscriptions create command with a target resource, event type, Pub/Sub notification endpoint and payload options, then how to list active subscriptions and renew one before it expires. The deliverable is an active, maintained subscription rather than a file or report.
When to use it
Use when you need to be notified about updates to a specific Google Drive file or drive, or when an existing subscription is nearing expiry and must be renewed. It fits operational monitoring setups that route Drive events through Pub/Sub.
Requirements
Requires the gws CLI binary and the gws-events skill; a Google Drive resource, a Pub/Sub topic and project for the notification endpoint, and authenticated access to Google Workspace events. Ships no scripts; instructions only.

Watch for Drive Changes

PREREQUISITE: Load the following skills to execute this recipe: gws-events

Subscribe to change notifications on a Google Drive file or folder.

Steps

  1. Create subscription: gws events subscriptions create --json '{"targetResource": "//drive.googleapis.com/drives/DRIVE_ID", "eventTypes": ["google.workspace.drive.file.v1.updated"], "notificationEndpoint": {"pubsubTopic": "projects/PROJECT/topics/TOPIC"}, "payloadOptions": {"includeResource": true}}'
  2. List active subscriptions: gws events subscriptions list
  3. Renew before expiry: gws events +renew --subscription SUBSCRIPTION_ID

Source and attribution

Source:googleworkspace/cliinskills/recipe-watch-drive-changesat commita3768d0

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal