Google Pub/Sub Trigger icon

Google Pub/Sub Trigger

Listens to Google Pub/Sub messages

Google Pub/Sub Trigger

AI-generated

Overview

This node listens to messages from a specified Google Cloud Pub/Sub topic and subscription. It is useful for workflows that need to react to real-time events or data published to a Pub/Sub topic, such as processing messages from IoT devices, user activity logs, or system alerts. For example, it can trigger a workflow whenever a new message is published to a topic, optionally decoding JSON message data automatically.

Use Case Examples

  1. Trigger a workflow when a new message is published to a Pub/Sub topic.
  2. Automatically decode JSON message data for further processing in the workflow.

Properties

Name Meaning
Project Id. The Google Cloud project ID where the Pub/Sub topic and subscription exist.
Topic The name of the Google Pub/Sub topic to listen to for messages.
Subscription The name of the subscription for the topic. It will be created if it does not exist.
Decode JSON If enabled, the node will automatically decode the message data from JSON format.

Output

JSON

  • id - The unique ID of the received Pub/Sub message.
  • data - The message data, either as a decoded JSON object or a string depending on the Decode JSON setting.
  • attributes - Attributes associated with the Pub/Sub message.

Dependencies

  • Google Cloud Pub/Sub client library
  • Google Auth Library

Troubleshooting

  • Ensure valid Google API credentials are provided; missing or invalid credentials will cause authentication errors.
  • The subscription will be created if it does not exist, but ensure the project ID and topic name are correct to avoid errors.
  • If Decode JSON is enabled but the message data is not valid JSON, parsing errors will occur.

Links

Discussion