Hi everyone. Sorry if this questions is rather generic and related to Google Cloud rather than n8n, as I am no expert on that side.
I am trying to fully understand how the google service account works in general and particularly regarding Gmail access. Our intention is/was to have a master service account that could access different user documents (sheets) and gmail accounts of our Workshop Domain in n8n. This is, one access to different user accounts, to avoid having individual credentials created on the console for each (oauth-generic or oauth-single).
- I have a working Google Service Account following the docs at Google Service Account | n8n Docs
- We activated Domain-wide delegation with scope
https://mail.google.com/
- We’ve enabled the Gmail API
The credential validates in n8n and I can choose it when accessing the Gmail node but I must be missing something either at the Google Console Interface or n8n.
I understand I can “impersonate” the credentials, but that gives me an error and nevertheless it would still mean I would need a set of credentials for each different account.
If I try to connect Gmail I get:
## Problem in node ‘Gmail‘
400 - {"error":{"code":400,"message":"Precondition check failed.","errors":[{"message":"Precondition check failed.","domain":"global","reason":"failedPrecondition"}],"status":"FAILED_PRECONDITION"}} - Precondition check failed. (item 0)
I was expecting on the Gmail node I could set and additional value to determine which Gmail account I wanted to access or impersonate via node call, rather than credential wide or other form of configuration. Alternatively, I thought perhaps I could do something similar with different credentials on the Google cloud console side, but have been trying for a while now and
I might be getting this completely wrong, and it is simply not possible, in which case I understand we would need a Google oauth-generic for each of the accounts we want to access.
n8n version: 1.25.1
Database Mysql
Running n8n via Docker
Debian