Import in n8n
Open n8n → go to Workflows → Import from File → select the JSON file you received.
This automation keeps your Gmail inbox organized by:
Fetching recent emails at set intervals
Analyzing the subject and body text with GPT-5 for classification
Automatically applying the correct Gmail labels based on the AI results
Schedule Trigger – Starts the workflow automatically at the interval you define.
Gmail Fetch – Collects the most recent emails from your inbox.
Loop Over Items – Processes each message individually.
AI Text Classifier – Uses GPT-5 to determine the appropriate category.
Add Labels – Applies the Gmail label that matches the classification result.
Loop Back – Repeats the process until all emails are categorized.
Connect Gmail → Authorize Gmail credentials for fetching and labeling emails.
Connect OpenAI → Insert your OpenAI API key in the Chat Model node.
Schedule Trigger → Choose how often the workflow should run (default: every 5 minutes).
Categories → Edit the Label Classifier to match your own categories.
Gmail Labels → Create or adjust Gmail labels to align with your classification setup.
Fetch Settings → Define the time window (default: last 5 minutes) and email limit (default: 10).
Testing → Run a trial with a few emails to confirm correct categorization.
Monitoring → Check execution logs to ensure labeling is applied properly.
Refine categories – Add or modify labels such as Work, Finance, Social, Newsletters, Urgent.
Change intervals – Adjust the schedule to run hourly, daily, or at custom times.
Expand labeling – Add more Gmail label nodes for specific needs like Follow-Up, Archive, or Clients.
Open n8n → go to Workflows → Import from File → select the JSON file you received.
Open nodes marked with a warning, add your API keys (Shopify, Gmail, etc.), then Save and Execute.