Setting up a Google service account credentials in n8n

Describe the problem/error/question

Creating a new credential under the Google service account API spins on “testing” after hitting save. I believe the private key may be the problem. The credentials were downloaded from Google by JSON and included “\n” line breaks. I have tested with leaving “\n” in the key, deleting it from the key, and deleting it from the key and entering a new line where the “\n” was. All have produced the same result.

Additionally, I am not sure if there is a specific API I need to enable from the API Library. I enabled the Google Drive API during this test.

What is the error message (if any)?

Please share your workflow

N/A

Share the output returned by the last node

N/A

Information on your n8n setup

  • n8n version: 1.98.1
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system: Mac

I am not too sure yet, but based on what you have described and the docs here, you seem to be on the right track. Could you double-check that the private key does not have the " marks?

Assuming you’re using a current version, you want to include those \n characters. The docs tell you to get the entire private_key value from the json download. I just tried it and it worked fine copying the entire value and using that in the credential.

Make sure you have permissions setup for the account, it might not validate properly if the permissions aren’t there.

Do include the —BEGIN PRIVATE KEY— and the similar end key tag.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.