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
- Open the Google Cloud Console and sign in with the Google account you want to use.
- Click the project menu and choose New Project. Name it and click Create.
- Open APIs & Services, then Library.
- Search for Gmail API and click Enable.
- 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.
- Open Credentials and click Create Credentials, then OAuth client ID.
- Choose Web application.
Part 2: Link n8n
- In n8n, open Credentials and click Create Credential.
- Search for Gmail OAuth2 API.
- Copy the OAuth Redirect URL from the screen.
- In Google, paste it under Authorized redirect URIs and click Create.
- Copy the Client ID and Client Secret into n8n.
- Click Sign in with Google. Choose your account.
- 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.
- Save the credential.
Test it
- Create a new workflow and add a Gmail node.
- Choose the credential.
- Set the resource to Message and the operation to Send.
- Fill in To, Subject and the message text.
- 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.