Design and apply Gmail label systems with OpenAI and human approval
Ready for 3.0What this workflow does
This AI workflow has 21 nodes and runs when someone submits an n8n form (“Gmail Inbox Label Setup”). Along the way it connects Gmail and OpenAI.
How it runs
Trigger: When someone submits an n8n form (“Gmail Inbox Label Setup”).
- Fetch Gmail Inbox Sample (Gmail): get many
- Normalize Emails Data (Code): runs custom JavaScript code
- Compile Emails Overview (Code): runs custom JavaScript code
- AI Suggest Labels (OpenAI): uses OpenAI
- Prepare Labels Proposal (Code): runs custom JavaScript code
- Seek Label Approval (n8n Form): shows the next form page
- Check Label Approval (If): checks a condition and branches into true / false
- Format Approved Labels (Code): runs custom JavaScript code
- Display Rejection Message (n8n Form): shows the next form page
- Generate Approved Labels in Gmail (Gmail): create (label)
…plus 10 more steps. See the full node list below.
Services it uses
Other OpenAI + Gmail templates (1,623)
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (6)
- n8n Form Trigger
n8n-nodes-base.formTrigger - Gmail
n8n-nodes-base.gmail - Code
n8n-nodes-base.code - OpenAI
@n8n/n8n-nodes-langchain.openAi - n8n Form
n8n-nodes-base.form - If
n8n-nodes-base.if
From the author
Quick overview This workflow samples recent Gmail inbox emails, uses OpenAI to propose a tailored Gmail label system, and requires human approval before creating labels and classifying messages, then applies the chosen label to each email and marks it with an…