PubNub icon

PubNub

Interact with PubNub real-time messaging platform

Message → Publish

AI-generated

Summary

Publish a message to a PubNub channel.

Inputs

  • channel (required) — The PubNub channel name to publish the message to.
  • message (required) — The message payload to publish; can be a string, number, or JSON object.
  • publishOptions — Additional publishing options such as storeInHistory, meta, and ttl.

Output shape

an object representing the publish response (e.g., acknowledgment or timetoken)

The response may be empty if the node is configured to return only success/failure; on success it contains the server's reply.

Examples

Example 1: Publish a simple text message to a channel

channel: "alerts", message: "Server started", publishOptions: {storeInHistory:true}

Example 2: Publish a JSON payload with metadata and TTL

channel: "updates", message: {"user":"admin"}, publishOptions: {meta:{"source":"n8n"}, ttl:12}

Example 3: Publish a numeric value without extra options

channel: "metrics", message: 42, publishOptions: {}

Discussion