n8n

How to Automate Gmail Lead Management?

Stop sorting outreach emails by hand. This system reads new Gmail messages, detects guest post and YouTube collaboration requests, sends the right reply, and adds the sender to your Brevo contacts. It is built for marketing teams that handle many partnership inquiries and want fast, consistent answers.

Gmail is checked on an hourly schedule. Two filters screen messages to decide when an automatic reply is safe. An AI text classifier powered by Google Gemini reads the subject and body, then assigns a category. Based on that result, the flow sends a matching HTML reply for guest posts, YouTube videos, or a general response. After sending, it marks the Gmail thread as read, applies a chosen label, and upserts the contact in Brevo for future campaigns.

You will need Gmail access, a sending mailbox, a Brevo API key, and a Google Gemini key. Expect faster first replies, cleaner contact data, and less inbox triage. It fits content sites, YouTubers, agencies, and any brand that gets regular collaboration emails.

What are the key features?

  • Hourly Gmail polling to fetch new messages and keep the inbox current
  • Safety filters using two decision checks to control when to auto reply
  • AI text classification with Google Gemini that reads subject and body
  • Branching replies for guest post and YouTube requests with HTML templates
  • Fallback general reply when no category is matched
  • Mark original Gmail threads as read after sending the response
  • Apply a custom Gmail label to keep processed emails organized
  • Upsert the sender into Brevo contacts for future marketing

What are the benefits?

  • Reduce manual triage from 60 minutes to 5 minutes per batch
  • Automate up to 80 percent of outreach replies with templates
  • Improve contact capture accuracy by about 95 percent
  • Handle up to 5 times more inquiries without extra headcount
  • Connect Gmail and Brevo so leads are ready for campaigns
  • Ensure every sender gets a fast and consistent response

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Gmail, Brevo and Google Gemini. See the Tools Required section above for links to create accounts with these services.
  3. In the n8n Credentials Manager, create a Gmail OAuth2 credential and connect it to the Gmail Trigger node. Follow the on screen prompts to grant access to the mailbox you will monitor.
  4. Open each Email Send node and create an SMTP credential. You can use your Gmail SMTP or any SMTP from your domain provider. Enter host, port, username, and password, then save and test.
  5. In your Brevo account, create an API key. In n8n, open the Brevo node and click Create new credential. Paste the API key and save. Verify by running a test execution.
  6. Create a Google Gemini API key in Google AI Studio. In n8n, open the Google Gemini Chat Model node, click Create new credential for the PaLM or Gemini API, and paste the key.
  7. Open the Gmail Trigger node. Confirm poll time is set to every hour and the correct mailbox is selected. Optionally add a search query if you only want to watch a label or folder.
  8. Review the two If nodes named Emails from Existing Contracts and Reply. Set conditions that define which senders or subjects should get an automated response.
  9. Edit the HTML in Guest Post, YouTube, and General reply templates. Update brand name, links, pricing, and contact details. Set the From name and address to your sending mailbox.
  10. Open the Apply Label node and choose the label you want for processed threads. Create a new label in Gmail if needed, then select it in the node.
  11. In the Brevo upsert node, confirm the email field maps to the sender address. If you use lists or attributes, add those mappings now.
  12. Send three test emails to your monitored inbox: one about a guest post, one about a YouTube video, and one general inquiry. Check that the right reply is sent, the thread is marked read and labeled, and the contact appears in Brevo.
  13. If emails fail to send, check SMTP authentication, SPF and DKIM records, and mailbox sending limits. If classification fails, verify your Gemini API key and quota.
  14. Once tests pass, activate the workflow. Monitor the n8n executions list for the first few days and adjust filters or templates as needed.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Brevo

Sign up

Free plan: $0 / mo, API key available, 300 transactional emails/day

Gmail

Sign up

No cost: Personal Gmail (Gmail API has no usage-based pricing; quotas apply)

Google Gemini

Sign up

Free tier: $0 via Gemini API; e.g., Gemini 2.5 Flash-Lite free limits 1,000 requests/day (15 RPM, 250k TPM). Paid from $0.10/1M input tokens and $0.40/1M output tokens.

Credits:
Developed by Amjid Ali. Email: amjid@amjidali.com
LinkedIn | Website | YouTube channel
Buy N8N Mastery Book: Amazon
Courses: lms.syncbricks.com

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.