Skip to main content

Send Google Pub/Sub node

The Send Google Pub/Sub node publishes a message on a Google Cloud Pub/Sub topic. It is the sending-side counterpart of the Google Pub/Sub event trigger, which consumes the messages via a subscription. It is used to decouple systems via the Google event bus, to notify other services or workflows connected to the same topic and to integrate with the Google Cloud ecosystem (Cloud Functions, Dataflow, BigQuery, etc.).

Parameters​

ParameterTypeRequiredDefaultDescription
AppApp❌—Application associated with the node. See Apps.
Project IDString✅—Identifier of the target Google Cloud project.
TopicString✅—Pub/Sub topic on which to publish the message.
GCP authentication methodAuthentication method✅—Ecosystem method used to publish on Pub/Sub.
Message bodyJSON✅—Data of the message to publish (JSON recommended).
Message attributesKey-value❌—Key-value pairs useful for routing or metadata.

Project ID​

Google Cloud project to which the topic belongs (e.g.: my-project-12345).

Topic​

Target Pub/Sub topic:

  • Topic name or full path according to the Ecosystem interface (e.g.: projects/<project-id>/topics/<topic-name>)
  • Supports Handlebars variables

GCP authentication method​

Select the Google Cloud authentication method used to publish:

  • Service account with Pub/Sub Publisher rights (or equivalent role) on the topic
  • Use an Ecosystem authentication method (GCP / Google type) to store the credentials securely

See also: Use authentication methods in workflows.

Security

Do not store the service account keys or the GCP secrets in clear text in the configuration. Always use an Ecosystem authentication method.

Message body​

Content published on the topic:

  • JSON format recommended
  • Supports Handlebars variables
  • Maximum size compliant with the Pub/Sub limits (up to 10 MB for the message)

Message attributes (optional)​

Pub/Sub message attributes (key-value pairs) for routing or metadata on the subscriber side.

Input​

The node receives the workflow context data (trigger or previous nodes) and injects it into the message body via Handlebars variables:

{
"event": "order.created",
"orderId": "{{context.order.id}}",
"amount": "{{context.order.amount}}",
"customerId": "{{context.order.customerId}}"
}

Output​

The Send Google Pub/Sub node generates no context variable: it publishes the message then the workflow continues. The published message is then consumed by the Google Pub/Sub event trigger or any other subscriber of the topic.

Errors​

No specific failure condition is documented for this node. On execution failure, add an On Error node to the workflow to handle the error cleanly.

Limits​

  • Maximum message size: up to 10 MB (Pub/Sub limits).

Example​

Publish an event after an order: after a business processing, fill in the node fields:

  • Project ID: my-gcp-project
  • Topic: orders-events
  • Message body:
{
"event": "order.created",
"orderId": "{{context.order.id}}",
"amount": "{{context.order.amount}}",
"customerId": "{{context.order.customerId}}"
}

The message body is entered in the Message body field, not in a separate configuration — it accepts the Handlebars context variables.

See also​