Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Connect n8n with Gmail

This guide shows you how to let n8n read and send emails using your Gmail account.

VPS and Cloud Servers2 min read20 steps

What is n8n?

n8n is a free tool, which you can run on your own server, that links apps together. You build a workflow, which is a chain of steps. Each step is a box called a node. Ask Hostvento support whether n8n is supported on your plan.

n8n needs your permission to use Gmail. You give it with OAuth. OAuth is a safe way to allow an app into your account without sharing your password. It is like giving a guest a key that opens only one room.

Part 1: Set up Google

  1. Open the Google Cloud Console and sign in with the Google account you want to use.
  2. Click the project menu and choose New Project. Name it and click Create.
  3. Open APIs & Services, then Library.
  4. Search for Gmail API and click Enable.
  5. Open the OAuth consent screen page. Choose a user type, add an app name and your email, and save. While the app is in testing mode, add your Gmail address under test users.
  6. Open Credentials and click Create Credentials, then OAuth client ID.
  7. Choose Web application.
  1. In n8n, open Credentials and click Create Credential.
  2. Search for Gmail OAuth2 API.
  3. Copy the OAuth Redirect URL from the screen.
  4. In Google, paste it under Authorized redirect URIs and click Create.
  5. Copy the Client ID and Client Secret into n8n.
  6. Click Sign in with Google. Choose your account.
  7. If Google warns that the app is not verified, this is normal for your own test app. Click the option to continue, then click Allow.
  8. Save the credential.

Test it

  1. Create a new workflow and add a Gmail node.
  2. Choose the credential.
  3. Set the resource to Message and the operation to Send.
  4. Fill in To, Subject and the message text.
  5. Click Execute step. Check your inbox or sent folder.

To react to new emails, use the Gmail Trigger node. It checks your inbox on a timer and starts the workflow for each new mail.

If it fails

  • A redirect error means the link in Google does not match the one in n8n exactly.
  • An access error means your address is missing from the test users.
  • OAuth works best when n8n runs on a secure https address.
Tip: Do not send many emails at once. Gmail has sending limits and may block an account that sends too much.

Quick recap

  • Enable the Gmail API in Google Cloud.
  • Create an OAuth client with the n8n redirect link.
  • Paste the Client ID and Secret into n8n and sign in.
  • Test with a Gmail node.
  • Keep email volume low.