Skip to main content
The Google Cloud Pub/Sub connector publishes selected Novu webhook events to a topic in your Google Cloud project.
Outbound webhooks are available on Team and Enterprise plans.

Prerequisites

  • A Google Cloud project
  • An existing Pub/Sub topic, created before you configure the endpoint
  • A service account with a JSON key that can publish to that topic
  • A subscription attached to the topic so you can pull messages during verification

Required permission

Publishing requires the pubsub.topics.publish permission, which is included in the predefined roles/pubsub.publisher role. Grant it on the topic rather than the project:
See Pub/Sub access control for the full role reference. Paste the complete JSON key into the credentials field and treat it as a secret.

Configuration

Transformation contract

The handler receives one delivery batch:
  • input.events, an array whose length is capped by the endpoint batch size
  • input.events[].eventType, the Novu event type, for example message.sent
  • input.events[].payload, the webhook body
The webhook body wraps the resource in an envelope. payload.object is the resource type as a string, such as "message", and the resource itself is under payload.data.object. For message events, fields such as subscriberId and channel are therefore at event.payload.data.object. Other event families use different resource shapes, so guard extracted fields with defaults. The return shape is defined by the template the Novu Dashboard ships with this connector, and it differs from the return shape of the queue and object storage connectors. Read the JSDoc comment above the template’s handler for the exact keys, and do not paste a handler from another connector page. To customize it safely:
  1. Send an example event without changing the template.
  2. Inspect the transformation output in the endpoint’s Logs.
  3. Pull the corresponding message from a Pub/Sub subscription.
  4. Change one field at a time and repeat the test.
A decoded subscriber message can represent the selected Novu event like this:
Use the endpoint Logs and the pulled Pub/Sub message to confirm the exact shape before changing the transformation.

Configure in the Dashboard

1

Prepare Pub/Sub

Create the topic and attach a subscription that you can pull from during testing. Prepare credentials JSON that can publish to the topic.
2

Add the endpoint

Open Webhooks in the Novu Dashboard, select Endpoints, click Add Endpoint, and choose .
3

Enter connection details

Enter Project ID, Topic, and Credentials.
4

Configure the transformation

Preserve the Dashboard template for the first test. After it succeeds, change one field at a time and compare the published message with the endpoint log.
5

Select event types

Choose the event types to publish. Start with one event type so the first subscriber message is easy to identify.
6

Test the endpoint

Create the endpoint. Open Testing, select a subscribed event type, and click Send Example. Confirm success in Logs, pull the message from your subscription, decode its data as JSON, and compare it with the logged transformation output.

Verify delivery

Pull one message from the verification subscription without acknowledging it:
Pub/Sub message data is base64 encoded on the wire, so decode it before comparing with the transformation output shown in the endpoint’s Logs. If the pull returns nothing while Logs reports success, another subscriber likely acknowledged the message first. Use a dedicated verification subscription with no active consumers.

Troubleshooting

  • Authentication fails: Validate the credentials JSON and confirm it belongs to the configured project.
  • The topic is not found: Check the exact project ID and topic name. Confirm the topic already exists.
  • Novu reports success but the subscriber is empty: Confirm the subscription is attached to the configured topic and inspect subscription filters or retention settings.
  • The message shape is unexpected: Restore the Dashboard template, send another example, and compare the endpoint log with the decoded subscriber message.
  • Some event types never publish: Review the endpoint’s selected event types and test each one separately.

Official references