Google Pub/Sub Trigger icon

Google Pub/Sub Trigger

Listens to Google Pub/Sub messages

Overview

This node listens to messages from a specified Google Cloud Pub/Sub topic subscription. It is useful for workflows that need to react to real-time events or messages published to a Pub/Sub topic. For example, it can be used to trigger workflows when new data is published to a topic, such as processing incoming orders, notifications, or sensor data.

Use Case Examples

  1. Trigger a workflow when a new message is published to a Pub/Sub topic for order processing.
  2. Listen to a topic for system alerts and automatically handle them in a 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. The subscription will be created if it does not exist.
Decode JSON If enabled, the message data will be automatically decoded from JSON format.

Output

JSON

  • id - The unique ID of the received Pub/Sub message.
  • data - The message payload, 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-cloud/pubsub)
  • Google Auth Library (google-auth-library)

Troubleshooting

  • Ensure valid Google API credentials are provided; missing or invalid credentials will cause authentication errors.
  • The subscription name must be unique within the project; if a subscription with the same name exists but is linked to a different topic, message listening may fail.
  • If 'Decode JSON' is enabled but the message data is not valid JSON, parsing errors will occur. Disable this option or ensure message data is valid JSON.
  • Timeout error may occur during manual trigger execution if no message is received within 30 seconds; this timeout does not apply to active workflows.

Links

Discussion