GCP.WorkspaceEvents reference
Subscription
Section titled “Subscription”Source:
src/GCP/WorkspaceEvents/Subscription.ts
A Google Workspace Events subscription.
Subscriptions have no labels field, so Alchemy stamps ownership onto
the destination Pub/Sub topic (alchemy-wesub-*) for list / nuke.
targetResource, the Pub/Sub topic, payload options, and Drive options
are identity — changing them replaces the subscription. Event types and
expiration update in place. Creating a subscription requires Workspace
Events OAuth scopes for the target resource (Chat, Drive, or Meet).
Subscription: Creating a Subscription
Section titled “Subscription: Creating a Subscription”Chat space messages to a Pub/Sub topic
const topic = yield* GCP.PubSub.Topic("ChatEvents", {});const sub = yield* GCP.WorkspaceEvents.Subscription("SpaceEvents", { targetResource: "//chat.googleapis.com/spaces/SPACE_ID", eventTypes: ["google.workspace.chat.message.v1.created"], pubsubTopic: topic.name,});Generated topic
const sub = yield* GCP.WorkspaceEvents.Subscription("MeetEvents", { targetResource: "//meet.googleapis.com/spaces/SPACE_ID", eventTypes: ["google.workspace.meet.conference.v2.started"],});Subscription: Updating a Subscription
Section titled “Subscription: Updating a Subscription”// Same logical id, changed props: the engine updates it in place.const sub = yield* GCP.WorkspaceEvents.Subscription("SpaceEvents", { targetResource: "//chat.googleapis.com/spaces/SPACE_ID", eventTypes: [ "google.workspace.chat.message.v1.created", "google.workspace.chat.message.v1.updated", ], pubsubTopic: topic.name, ttl: "86400s",});TasksPushNotificationConfig
Section titled “TasksPushNotificationConfig”Source:
src/GCP/WorkspaceEvents/TasksPushNotificationConfig.ts
A push-notification config for a Workspace Events / A2A task.
The API has no labels field and the token is sent to the receiver, so Alchemy writes no ownership marker: it tracks the config by name (a generated config id embeds the stack, stage, and logical id). Task and config id are identity — changing either replaces the config. There is no patch method; changing the URL, token, or authentication replaces the config. Creating a config requires an existing task.
TasksPushNotificationConfig: Creating a Config
Section titled “TasksPushNotificationConfig: Creating a Config”HTTPS webhook for a task
const config = yield* GCP.WorkspaceEvents.TasksPushNotificationConfig( "Updates", { task: "tasks/TASK_ID", url: "https://example.com/workspace-events", },);Bearer authentication
const config = yield* GCP.WorkspaceEvents.TasksPushNotificationConfig( "Updates", { task: "tasks/TASK_ID", url: "https://example.com/workspace-events", authentication: { schemes: ["Bearer"], credentials: "token" }, },);