> For the complete documentation index, see [llms.txt](https://docs.frends.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.frends.com/tasks/tasks/google-pub-sub/consume.md).

# Consume

Task version: 1.0.0

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.GooglePubSub/tree/main/Frends.GooglePubSub.Consume>

## Task Parameters

{% tabs %}
{% tab title="Input" %}

| Name                               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ProjectID : `String`               | <p>The project ID.</p><p><br>Default: <code>-</code><br>Example: <code>my-project-123456</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| SubscriptionID : `String`          | <p>The subscription ID.</p><p><br>Default: <code>-</code><br>Example: <code>my-project-123456</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| 🗝ServiceAccountKeyJSON : `String` | <p>The JSON service account key that one can generate in the Google Cloud portal.</p><p><br>Default: <code>-</code><br>Example: <code>{ "type": "service\_account", "project\_id": "something", "private\_key\_id": "fdsafdsafdsalmnop12345678909876543212344", "private\_key": "-----BEGIN PRIVATE KEY-----\nMIIE.......Hw==\n-----END PRIVATE KEY-----\n", "client\_email": "<someone@something.iam.gserviceaccount.com>", "client\_id": "123456789012345678900", "auth\_uri": "<https://accounts.google.com/o/oauth2/auth>", "token\_uri": "<https://oauth2.googleapis.com/token>", "auth\_provider\_x509\_cert\_url": "<https://www.googleapis.com/oauth2/v1/certs>", "client\_x509\_cert\_url": "<https://www....nt.com>" }</code></p> |
| {% endtab %}                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

{% tab title="Options" %}

| Name                    | Description                                                                                                                                                                            |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Timeout : `Int32`       | <p>Sets the timeout for the pull request to PubSub.</p><p>Too short timeout can lead to DeadlineExceeded exception.</p><p><br>Default: <code>20</code><br>Example: <code>20</code></p> |
| MaxResults : `Int32`    | <p>Maximum amount of messages that is pulled from the PubSub.</p><p><br>Default: <code>20</code><br>Example: <code>20</code></p>                                                       |
| Acknowledge : `Boolean` | <p>Determines if messages are acknowledged after consuming them.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                |
| {% endtab %}            |                                                                                                                                                                                        |
| {% endtabs %}           |                                                                                                                                                                                        |

## Task Result

| Name                             | Description                                                                                                                                                              |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Messages : `List<OutputMessage>` | <p>Messages consumed from Google PubSub.<br>Example: <code>\[ { "Hello world!", { "myCustomAttr1": "myAttrValue1" }, "271", "2024-02-27T07:53:25Z", "key" } ]</code></p> |

## Task Changelog

Changelog for Task Frends.GooglePubSub.Consume.

### \[1.0.0] - 2024-02-27

#### Changed

* Initial implementation


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.frends.com/tasks/tasks/google-pub-sub/consume.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
