> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Publish Pub-Sub Message

Add one or more messages to the topic.

<Note>
  External Documentation

  To learn more, visit the [Pub-Sub documentation](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/publish).
</Note>

## Parameters

<div className="integrations-table">
  | Parameter  | Description                                                                                                                                                                                                                                                                                                                                                                                                 |
  | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Messages   | An array of the message objects to be published. The message needs to be Base64 encoded. For more information see [Pub/Sub Documentation](https://cloud.google.com/pubsub/docs/reference/rest/v1/PubsubMessage).<br />   For example:<br /><pre><code>\[<br />  \{<br />    "data": "SGVsbG8gV29ybGQh"<br />  },<br />  \{<br />    "data": "SGVsbG8gQmVhdXRpZnVsIFdvcmxkIQ=="<br />  }<br />]</code></pre> |
  | Project ID | The messages in the request will be published on a topic in this project.                                                                                                                                                                                                                                                                                                                                   |
  | Topic      | The messages in the request will be published on this topic. Can be obtained by using the `List Topics` action.<br />For example:<br /><pre><code>\{<br />  "topics": \[<br />    \{<br />      "name": "projects/test/topics/test-topic"<br />    }<br />  ]<br />}</code></pre><br />In order to extract the topic name we need to take the last part of the name returned, in this case `test-topic`.    |
</div>

## Example Output

```json theme={"dark"}
{
  "messageIds": [
    string
  ]
}
```

## Workflow Library Example

[Publish Pub Sub Message and Send Results Via Email](https://library.blinkops.com/workflows/publish-pub-sub-message-and-send-results-via-email)

<div className="iframe-wrapper">
  <div className="iframe-media">
    <img src="https://mintcdn.com/blinkops-2/ojHYuDeYX5FWuN8a/img/Icons/play-box.svg?fit=max&auto=format&n=ojHYuDeYX5FWuN8a&q=85&s=b8af968e71438a9499c3223c9bd29fb2" alt="Workflow Library" width="16" height="16" data-path="img/Icons/play-box.svg" />

    Preview this Workflow on desktop
  </div>

  <iframe className="iframe" src="https://library.blinkops.com/workflows/publish-pub-sub-message-and-send-results-via-email/canvas" />
</div>
