Google Cloud Pub/Sub

The Google Cloud Pub/Sub modules enable you to monitor and publish messages or create, update, retrieve, and delete topics and subscriptions in your Google Cloud Pub/Sub.

Getting Started with Google Cloud Pub/Sub

Prerequisites

In order to use Google Cloud Pub/Sub with Integromat, it is necessary to have a Google account. If you do not have one, you can create a Google Cloud Pub/Sub account at accounts.google.com.

The module dialog fields that are displayed in bold (in the Integromat scenario, not in this documentation article) are mandatory!

Connecting Google Cloud Pub/Sub to Integromat

To connect your Google Cloud Pub/Sub account to Integromat, you'll need to obtain the project's Client ID and Client Secret in the Google Cloud Console.

1. Sign in to Google Cloud console using your Google credentials.

2. Click Select a project > NEW PROJECT. Enter the desired project name and click the CREATE button.

ADEbXh151m.gif

3. Select the project you have created.

URMZx0Q4KV.gif

4. Go to APIs & Services > Library.

ikUYh3USkS.gif

5. Search and enable the following required APIs: 

  • Cloud Resource Manager API

The desired service option should display as you type. Click on the API/service you want to connect to Integromat.

PNCrnF04ks.gif

6. Click the ENABLE button to enable the selected API.

7. Open APIs & Services > Library, and search and enable the two remaining required APIs (see step 5 above).

8. Open Big Data > Pub/Sub. This will enable the rest of the required APIs in your project.

7UIuGDTmLN.gif

9. Navigate to APIs & Services > OAuth consent screen.

bw6JL1HSQt.gif

10. Choose the External option, and click the CREATE button.

You will not be charged when selecting this option! For more details, please refer to Google's Exceptions to verification requirements.

11. Fill the required fields as follows and then click the Save and Continue button:

App name

Enter the name of the app asking for consent.

For example Integromat.

Authorized domainsintegromat.com

12. You don't have to set anything in the Scopes and Optional info sections. Click Save and Continue.

13. Navigate to Credentials. Click on the +CREATE CREDENTIALS, and select the OAuth Client ID option.

koPJzTFXFn.gif

14. Fill in the required fields as follows, and then click the CREATE button to create the application:

Application typeWeb application
Namee.g. Integromat
Authorized redirect URIs

https://www.integromat.com/oauth/cb/google-custom

gwzr3mPVAe.gif

15. A dialog containing the app's Client ID and Client Secret is displayed. Save them to a safe place for later use.

explorer_tCReFOgixG.png

16. Go to Integromat, open the Create a connection dialog of the desired Google Cloud Pub/Sub module, enter the Client ID and Client Secret from step 15 above to the respective fields, and click Continue.

chrome_654SO4hJti.png

17. Sign in with your Google account.

18. This app isn't verified window may appear.

The app is your OAuth client you have created above.

19. Click on the Advanced link, and then on the Go to Integromat (unsafe) link to allow access using your custom OAuth client.

RsUKiYLB6k.gif

20. Click Allow to grant Integromat permission.

2020-11-04_18_01_33-Sign_in_-_Google_Accounts.png

21. Click the Allow button to confirm your choices.

2020-11-04_18_03_57-Sign_in_-_Google_Accounts.png

The connection to your Google Cloud Pub/Sub has been established.

Message

Watch Messages

Triggers when a message is published for the specified topic.

Webhook nameEnter the name for the webhook.
ConnectionEstablish a connection to your Pub/Sub.
ProjectSelect the project that contains the topic you want to watch for published messages.
Topic NameSelect the topic you want to watch for published messages.
Subscription FilterSet the filter according to the filter syntax. If the filter is set, only messages that match this filter are returned.
Message Retention Duration

Enter the duration in seconds. Specify how long to retain unacknowledged messages in the subscription's backlog, from the moment a message is published.

Minimum 10 minutes, maximum 7 days. The default is 7 days.
Duration in seconds with up to nine fractional digits, terminated by 's'. Example: 3.5s.

Order Messages with an Ordering Key

If enabled, messages published with the same orderingKey in the message will be returned in the order in which they are received by the Pub/Sub system. Otherwise, they may be delivered in any order.

Enable Dead Lettering

Check to enable a dead letter policy, which specifies the conditions for dead lettering messages.
Then, set the name of the topic to which dead letter messages should be published and the number of delivery attempts.

Retry after Exponential Backoff Delay

Check to enable a policy that specifies how Pub/Sub retries message delivery. Uncheck to retry immediately. Retry delay will be exponential based on provided minimum and maximum backoffs. https://en.wikipedia.org/wiki/Exponential_backoff.

Set the minimum and maximum backoff (in seconds).

Labels

Specify labels.

See Creating and managing labels.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

Publish Messages

Publishes a message to the specified topic.

ConnectionEstablish a connection to your Pub/Sub.
Topic Name

Enter the topic path in the following format: projects/{project}/topics/{topic}.

Or use the Search button to browse the desired topic.

Messages

Either message or attribute will be required to publish.

DataEnter the message you want to publish to this topic.
AttributesEnter attributes for the message.

Topic

List Topics

Returns a list of topics in the specified project.

ConnectionEstablish a connection to your Pub/Sub.
ProjectSelect or map the ID of the project you want to retrieve topics from.
LimitSet the maximum number of topics Integromat will return during one execution cycle.

List Topic Subscriptions

Returns a list of topic subscriptions.

ConnectionEstablish a connection to your Pub/Sub.
Topic Name

Enter the topic path in the following format: projects/{project}/topics/{topic}.

Or use the Search button to browse the desired topic you want to list subscriptions for.

Limit

Set the maximum number of subscriptions Integromat will return during one execution cycle.

Create a Subscription

Creates a new subscription to a specified topic.

ConnectionEstablish a connection to your Pub/Sub.
Subscription ID

Specify the unique resource name.

Project

Select the project or map the ID of the project that contains the topic you want to create a subscription for.

Topic Name

Select the topic or map the ID of the topic you want to create a subscription for.

Enable Push Delivery

Check this option to use Push delivery instead of Pull delivery.

Enable Subscription Expiration

Check to enable a policy that specifies the conditions for this subscription's expiration. A subscription is considered active as long as any connected subscriber is successfully consuming messages from the subscription or is issuing operations on the subscription.

Time To Live

Specify the "time-to-live" duration for an associated resource in seconds. The resource expires if it is not active for a period of ttl. The definition of "activity" depends on the type of the associated resource. The minimum and maximum allowed values for ttl depend on the type of the associated resource, as well. If ttl is not set, the associated resource never expires.

Indicate the duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

Acknowledgement Deadline in Seconds

Enter the approximate amount of time (on a best-effort basis) Pub/Sub waits for the subscriber to acknowledge receipt before resending the message. In the interval after the message is delivered and before it is acknowledged, it is considered to be outstanding. During that time period, the message will not be redelivered (on a best-effort basis).

Subscription Filter

Set the filter according the filter syntax. If the filter is set, only messages that match this filter are returned.

Message Retention Duration

Enter the duration in seconds. Define how long to retain unacknowledged messages in the subscription's backlog, from the moment a message is published.

Minimum 10 minutes, maximum 7 days. The default is 7 days.
Duration in seconds with up to nine fractional digits, terminated by 's'. Example: 3.5s.

Retain Acknowledged Messages

If enabled, messages are not expunged from the subscription's backlog, even if they are acknowledged, until they fall out of the Message Retention Duration window.

Order Messages with an Ordering Key

If enabled, messages published with the same orderingKey in the message will be returned in the order in which they are received by the Pub/Sub system. Otherwise, they may be delivered in any order.

Enabled Dead Lettering

Check to enable a dead letter policy, the policy that specifies the conditions for dead lettering messages.
Then, set the name of the topic to which dead letter messages should be published and the number of delivery attempts.

Retry after Exponential Backoff Delay

Check to enable a policy that specifies how Pub/Sub retries message delivery. Uncheck to retry immediately. Retry delay will be exponential based on provided minimum and maximum backoffs. https://en.wikipedia.org/wiki/Exponential_backoff.

Set the minimum and maximum backoff (in seconds).

Labels

Specify labels.

See Creating and managing labels.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

Update a Subscription

Updates an existing subscription.

ConnectionEstablish a connection to your Pub/Sub.
Subscription Name

Enter the path to the subscription you want to update in the following format: projects/{project}/subscriptions/{sub}. Or, browse the subscription using the Search button.

Please find the descriptions of the fields in the Create a Subscription section above.

Delete a Subscription

Deletes a subscription. All messages retained in the subscription are immediately dropped.
After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription or its topic unless the same topic is specified.

ConnectionEstablish a connection to your Pub/Sub.
Subscription Name

Enter the path to the subscription you want to delete in the following format: projects/{project}/subscriptions/{sub}. Or, browse the subscription using the Search button.

Other

Make an API Call

Allows you to perform a custom API call.

ConnectionEstablish a connection to your Pub/Sub.
URL

Enter a path relative to https://pubsub.googleapis.com.
For example: /v1/projects/{project}/topics/{topic}.

For the list of available endpoints, refer to the Pub/Sub API Documentation.
Method

Select the HTTP method you want to use:

GET
to retrieve information for an entry.

POST
to create a new entry.

PUT
to update/replace an existing entry.

PATCH
to make a partial entry update.

DELETE
to delete an entry.

HeadersEnter the desired request headers. You don't have to add authorization headers; we've already added those for you.
Query StringEnter the request query string.
BodyEnter the body content for your API call.

Example of Use - List Snapshots

The following API call returns all snapshots in the specified topic:

URL:
/v1/projects/{project}/topics/{topic}/snapshots/

Method:
GET

2020-11-06_18_38_32-Integration_Meetup___Integromat.png

The result can be found in the module's Output under BundleBody > snapshots
In our example, 3 snapshots were returned:

2020-11-06_18_39_24-Integration_Meetup___Integromat.png

Popular use cases from our blog

trello2

How to Automatically Turn Tweets Into Inspiring Images [Tutorial]

part4

How to Automate Procurement in Your Shopify Store - Part 4

part3

How to Automate Procurement in Your Shopify Store - Part 3

shopify

How to Automate Procurement in Your Shopify Store - Part 2

crm

8 Powerful and Free CRM Integrations to Boost Your Work

procur

How to Automate Procurement in Your Shopify Store - Part 1

Didn’t find what you were looking for?

Ticket

Create a ticket

Contact our world-class support team and tell us what’s happening.

Create a ticket
Expert

Find an expert

We feature a network of 450+ certified partners across the globe who are ready to help

Find an expert

Automate any workflow in your business

Sign up for a free account today. No credit card required, no time limits on free plan.