GCP Pub/Sub Node

The GCP (Google Cloud Platform) Pub/Sub Node allows a workflow to publish a message to a Google Pub/Sub queue on a topic of your choosing.

GCP Pub/Sub Node

Configuration

Configuration for the node is broken up into four sections.

Authentication

First, we must enter our Google Cloud Storage credentials.

Note: We recommend that you create a service account key specifically for use in Losant workflows that has appropriate access to relevant storage buckets.

GCP Pub/Sub Node Authentication

The next configuration field will depend on the Account Key Method selected.

  • If you selected Integration as your Account Key Method, choose a Google Pub/Sub Integration you have created for your application.
  • If you selected Service Credential as your Account Key Method, Credential Name Template can either be a string template that references your Service Credential name or you can select a Service Credential you have created for your application.
  • If you selected Direct Input (JSON Template) as your Account Key Method, Account Key JSON Template can either be a string template that references your Google Service Account JSON Key or you may enter it in directly.
  • If you selected Direct Input (Payload Path) as your Account Key Method, Account Key Payload Path is a payload path that references a Google Service Account Key that has access to publish to the selected topic.

The third configuration field appears for all Account Key Methods except for Integrations.

  • Project ID Template: Can either be a string template that references your Project ID, or it can be left blank to use the default Project ID associated with your credential. This option is available for all Account Key Methods. In Edge workflows, this option can only be defined for Gateway Edge Agent version v1.42.0 or above.

Topic & Message

The Topic Template is the topic on which the message will be published. (Note: It is not necessary to be subscribed to a topic in order to publish to it.)

  • Message Data Template: Select the format of the message template:

  • Message Template / Payload Path: Enter the message data in the selected format.

Attributes

You may optionally include some attributes along with your message. Attributes are a map of key/value pairs. There are three methods by which you may include the attributes:

  • Individual Fields allows you to enter each key/value separately, with the key and the value both accepting string templates.
  • Json Template accepts an object of key/value pairs in one block. The object may not contain any nested properties, and Handlebars helpers may be used for either the keys or values.
  • Payload Path accepts a payload path to an object of key/value pairs on your payload.

Result Path

Optionally, you can store the message response on the current payload by entering a payload path here.

Was this page helpful?


Still looking for help? You can also search the Losant Forums or submit your question there.