Help setting OAuth2 credentials with Google

Are there any more recent instructions/guidelines than Google OAuth2 single service - n8n Documentation on how to get Google OAuth2 working?

I have been trying to create a new Google e-mail account and then use OAuth2 in n8n to connect to it, but to no avail. I will keep trying, but just wondering if something more up-to-date is available.


Hi @angelv - first, welcome to the community! :tada:

Can you let me know which step you’re having trouble with? I just ran through this with a brand new instance and this worked fine for me, both in creating a draft in Gmail and in creating a new Google sheet (I wanted to test multiple nodes just in case).

Two things that might have tripped you up here - have you used Google Cloud Console and created a new credential with the “web application” specification, and retrieved your client ID and secret? When it comes to the URI, it’s perfectly fine to use http://localhost:5678/rest/oauth2-credential/callback as your callback from the node, if you’re also only hosting locally on your machine. Otherwise you’ll just need to ensure it’s directing to where you’re hosting.

For the latter, you’ll need to head into “Enabled APIs and Services” and search for whatever service you’re looking for. One thing to note is if you’re trying to use Sheets, you’ll need both Sheets and Drive as permissions.

If you could share the error message you’re getting after reviewing those steps, that would help us troubleshoot!

1 Like


the main difficulty I had with the instructions is that for the OAuth consent screen they say that for User Type we should select Internal, but this is not possible in my case and I have to choose External [“Because you are not a Google Workspace user, you can only make your app available to external (general audience) users”]. In the end I got it somehow working, but the “Publishing status” is “Testing”, which doesn’t feel right.

Also, after a week, I realized that the workflow was not working anymore, so I executed it manually and I got a message from the Gmail trigger node saying that there was an error (credential expired or something like that), and I had to “Sign to Gmail” again. Sorry I was not more careful when taking notes of the error.

Hi there @angelv , thanks for getting back to me and sorry for the wait over the weekend.

This is actually expected behaviour from Google when selecting the testing status, believe it or not - others have ran into this before, too. You can find that forum topic here:

1 Like

OK, thanks. The first time I tried to publish the app (some time last week), for some reason it didn’t work, but I have now tried again and it worked just fine. And I hope that now it doesn’t stop working after a week.

Many thanks (n8n rocks, by the way :+1: )


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