Capture Incoming Emails

Support Inbox Commander - Challenge 1 of 6
Difficulty
1/10
Tags
Gmail TriggerEdit Fields (Set)GmailWebhooks
Requirements
Gmail OAuth credentials

The outcome: After this challenge, every email hitting your inbox will automatically flow into n8n for processing. No more manually checking, sorting, or forwarding - your inbox becomes a data stream you can automate.

Why this matters: Email is still the #1 business communication channel. Companies spend thousands on help desk software that does exactly this - capture and route emails. You're building the foundation for your own AI-powered email system.

The Gmail Trigger node polls your inbox and fires whenever new emails arrive. You'll extract the essential fields needed for the classification and routing you'll build in later challenges.

Before you start: You'll need Gmail OAuth credentials set up in n8n. Follow the official n8n guide if you haven't done this yet.

What you'll learn:

  • Gmail Trigger - automatically detect new emails
  • Email data structure - what fields are available (sender, subject, body, ID)
  • Edit Fields node - extract and reshape data for downstream processing

Your Task

  1. 1Copy the exercise below
  2. 2Paste into your n8n editor (Ctrl+V)
  3. 3Solve it — use hints if you get stuck
  4. 4Check the solution when done

Set up email capture for your support inbox:

  1. Add a Gmail Trigger node configured to poll every minute
  2. Add an Edit Fields node to extract:
    • Sender's email address
    • Subject line
    • Email body text
    • Email ID (for later actions)

Test it: Send yourself a test email and check that the workflow triggers and extracts the fields correctly.

Expected output: A clean object with sender, subject, body, and id fields.

Hint: If some fields are missing in the output, check the Gmail Trigger node options.

Hints

Step 1: Configure Gmail Trigger

  1. Add a Gmail Trigger node and connect your Gmail credentials
  2. Set Poll Times to "Every Minute" for testing
  3. Important: Open Options and turn OFF "Simplify". This is essential to get the full email body. With Simplify ON, the body text is hidden.

Step 2: Find Your Fields

  1. Execute the workflow (send yourself a test email)
  2. Click on the Gmail Trigger output to see the available fields
  3. Look for: from, subject, text, and id in the output data

Step 3: Map Fields with Drag-and-Drop

  1. Add an Edit Fields (Set) node with Mode: "Manual Mapping"
  2. Create four fields: sender, subject, body, id
  3. For each field value, click into the value box, then find and drag the corresponding field from the Input panel on the left
  4. The exact path varies by email, so use what you see in YOUR output rather than copying expressions

Troubleshooting:

  • If body/text is missing, go back and turn OFF "Simplify" in Gmail Trigger Options

Explanation

Understanding Gmail Trigger:

The Gmail Trigger polls your inbox at the specified interval. When it finds new emails since the last check, it fires and passes the email data through your workflow. Each email becomes one execution item.

The Simplify Setting:

By default, Gmail Trigger has "Simplify" turned ON in Options. This reduces the output to basic metadata (sender, subject, date) but hides the email body content. For most automation workflows, you need the body, so turn OFF Simplify to get the full email structure including:

  • from - sender information (nested structure with address)
  • to - recipient information
  • subject - email subject line
  • text - plain text body (only available with Simplify OFF)
  • html - HTML body (only available with Simplify OFF)
  • id - Gmail's unique message ID
  • threadId - conversation thread ID

Why Extract Fields?

Using Edit Fields to create a clean object makes your workflow easier to debug and modify. Instead of navigating complex nested structures in later nodes, you have predictable field names.

Drag-and-Drop vs Expressions:

n8n lets you drag fields from the Input panel directly into field values. This is often easier than writing expressions manually, and it ensures you're using the exact field path from your data. If you see example expressions online, they might not match your email structure exactly.

Next Step:

With emails captured, you're ready to classify their intent in the next challenge.

Copy the Solution

Paste into n8n with Ctrl+V to compare with your approach.

Login to see the exercise

Create an account to access challenges and track your progress.

Log in to see exercise
Step 1 of 6

Next up

Classify Email Intent

Related Content

Continue your learning journey with these related challenges and guides: