Google Chat Error

Updating this documentation Google credentials | n8n Docs

Using Service Account#

From your Google Cloud Console dashboard:

  1. Click on the hamburger menu and select APIs & Services > Credentials.
  2. Click on + CREATE CREDENTIALS and select Service account.
  3. Enter a name in the Service account name field.
  4. Click on the CREATE button.
  5. Based on your use-case, you may want to Select a role and Grant users access to this service account using the corresponding sections.
  6. Click Done.
  7. Select your newly created service account under the Service Accounts section and open the Keys tab.
  8. Click on ADD KEY and select Create new key.
  9. In the modal that appears, select JSON and click Create. n8n saves the file to your computer.

From you n8n instance:

  1. Enter a Credentials Name.
  2. In the Service Account Email field, enter the email associated with your new Service Account (visible in the Details tab).
  3. Enter the Private Key from the downloaded JSON file. If you are running an n8n version older than 0.156.0: replace all instances of \n in the JSON file with new lines.
  4. Optional: Click the toggle to enable Impersonate a User and enter the desired email.
  5. Save your credentials.

Now you must enable each Google service API that you want to use.

The following video demonstrates the steps mentioned above.

Enable APIs#

To enable an API, follow the steps below:

  1. Access your Google Cloud Console.
  2. From the hamburger menu select APIs & Services > Library.
  3. Search for and select the API(s) you want to enable.
  4. Click on the ENABLE button.

Google Chat Configuration

In the same chat API screen - click on the tab called Configuration
Fill in the details - the input values will be what you will refer to when you add this “app” to any Google Chat workspace

The App Name is the “App” you will be finding for and adding in Google Chat
The Avatar URL has to be any logo image

Further down check these settings

The App URL is not really relevant to sending messages but best to give it any https URL that you control
Finally in the permissions section - you can allow your whole domain to have access or restrict it to some people only.

Save the configuration.

Testing and using the App/Bot in Google Chat

To test in Google Chat - first start a 1:1 conversation with the bot to make sure it is accessible (sometimes it takes a few minutes for the bot to show up after you hit the Save above

** :warning:** Important - When you chat with the app/bot or add the app/bot to a Space, type in all the characters of the name. In the above example the App/Bot was named n8nbot.
If you just type n8n, the autocomplete will NOT show you the app at all - just keep typing n8nbot and then you will see it

Create a new space to test

It is s good idea to use a test space. The space (probably) need to allow people outside the org to join

Then add the app to this space

How to use this app in a n8n Node

Finally to use n8n to send messages to this space get the space identifier using this method
image

Add a new webhook - it doesn’t matter what it is called - it is not being used for anything
The section
spaces/AAAA_41A_L4 (no slash at the end)
is the value to be used in the n8n node to send a message like this

5 Likes