I am building out a workflow that requires me to send an email. In this case, I want the email to come from a generic or shared email account. I should note that we are using Google Workspace (Gmail) for email. I also don’t want to specify a specific user’s credentials in this workflow since users come and go (even admins like myself). I assume that service accounts are the way to go. I’ve followed ALL instructions I could find and read every forum post on the subject, but I’m still running into issues.
When creating the credential, IF I DON’T select “impersonate a user”, the credential validates successfully, but when I go to try and send an email using the credential, I receive an error stating:
{ "error": { "code": 400, "message": "Precondition check failed.", "errors": [ { "message": "Precondition check failed.", "domain": "global", "reason": "failedPrecondition" } ], "status": "FAILED_PRECONDITION" } }
When creating the credential, if I DO specify “impersonate a user”, then I get an error saving the credential. The error is:
Private key validation failed: 401 - {"error":"unauthorized_client","error_description":"Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested."}
Am I missing a step somewhere or is there a more suggested workflow? In our case, I’ll need to send email out from a “shared mailbox” and I’ll need to access and modify google sheet files located on a shared drive. My only requirement is that a specific real user isn’t used for authentication to prevent my workflow from breaking if someone gets terminated.
Information on your n8n setup
- n8n version: [email protected]
- Running n8n via N8N Cloud
Thanks in advance!