Adding Google Sheets OAuth2 to n8n

Before you start, make sure you have:

You can reuse the same OAuth 2.0 Client ID you created for Gmail. Google Cloud OAuth credentials work across multiple APIs.


Step 1: Get your OAuth credentials from Google Cloud

  1. Go to console.cloud.google.com
  2. Select your project
  3. Go to APIs & Services → Credentials
  4. Find your OAuth 2.0 Client ID and click it
  5. Copy your Client ID and Client Secret

Step 2: Create the credential in n8n

  1. Open your n8n instance
  2. Click Settings in the left sidebar
  3. Click Credentials
  4. Click Add credential in the top right
  5. Search for Google Sheets and select Google Sheets OAuth2 API
  6. Paste your Client ID and Client Secret from Step 1
  7. Click Sign in with Google
  8. A browser window will open. Sign in with your Google account
  9. Grant the requested permissions
  10. You will be redirected back to n8n. The credential will show as connected

Step 3: Copy your credential ID

  1. After saving, look at the URL in your browser
  2. Copy the ID at the end

Example: https://your-n8n.com/credentials/def456 → your credential ID is def456


Troubleshooting

"Error: redirect_uri_mismatch" Add this to your authorised redirect URIs in Google Cloud Console: https://your-n8n.com/rest/oauth2-credential/callback

The Google Sheet is not being found Make sure the Google account you authenticated with has access to the spreadsheet you are trying to use. Share the sheet with that account if needed.