Hi, so I just opened up an administration account on Google Workspace. I’m about to do the Domain Wide Delegration and I think that I have to get the Client ID and the Key from the Admin account.
I want to make sure I’m doing this correctly:
I created a Service Account inside the Google Cloud Console under my admin account (marc95@timealign-ai.com) and generated a JSON key file.
I took the 21-digit numeric OAuth 2.0 Client ID from that Service Account and pasted it into Google Workspace Admin Console (admin.google.com) under Domain-Wide Delegation with the scope [https://www.googleapis.com/auth/calendar](https://www.googleapis.com/auth/calendar).
In n8n, I am using the Service Account credentials with marc95@timealign-ai.com set as the impersonated user (subject email).
Hi @Marc2
Those three steps match the documented flow. n8n validates a service account credential against a wider scope set than the operation you actually want, so a delegation entry holding only the calendar scope comes back as 401 unauthorized_client on save even when the Google side is correct, tracked as gh issue 20581. Put the full set in the same Domain-Wide Delegation entry:
The Starter edition isn’t a problem. Domain-wide delegation isn’t restricted by Workspace edition. Google’s documentation lists no edition restrictions, only super admin privileges, which you have.
Your three steps are correct. The only thing missing is enabling the Google Calendar API in the Cloud project itself. Although delegation allows the service account to act as a user, the API still has to be activated. It is switched off by default in a new project. If you skip this step, you will receive a 403 error message saying that the API hasn’t been used in the project. This error message can be misleading as it suggests an authentication problem, but this is not the case.
It’s also worth knowing that delegation isn’t instant. According to n8n’s documentation, it takes between five minutes and 24 hours for impersonation to work. Therefore, don’t assume that it’s misconfigured if it fails right after saving.
Impersonating yourself as admin is fine, the subject just has to be a real user in the domain.