Auto-Triage School Emails into Google Calendar and Drive
New school email in Gmail → AI extracts schedule, items-to-bring, notices, and contacts → routes into Google Drive and Calendar with a daily reminder
- Who
- Parents or caregivers who receive many school emails and want automatic organization
- You get
- Emails classified into schedules, items-to-bring, notices, and contacts; calendar events created; daily morning reminder of tomorrow’s required items
- You need
- n8n · gmail · google-drive · google-calendar
Constraints
Requires an internet-connected n8n instance (self-hosted or cloud). Prerequisites: Google account with Gmail, Google Calendar, and Google Drive enabled; Google OAuth2 credentials configured in n8n. The Workflow Configuration node needs Drive folder IDs (photosFolderId, noticesFolderId, contactsFolderId) and a reminderEmail. The AI node uses an OpenAI API key. The reminder email uses the Japanese placeholder 持ち物 (items to bring), which should be adapted to your school’s language.
What they did
Author anna0726 published an n8n workflow template. It listens for new emails via Gmail Trigger, uses Information Extractor + OpenAI Chat Model (gpt-4.1-mini) to classify emails into four categories (Schedule, What to Bring, Notice, Contacts), extracts structured fields, then routes through a Switch node to Google Drive (notice text, contacts, photos) and Google Calendar (events). A separate Schedule Trigger branch queries tomorrow’s calendar events containing 持ち物 each morning and sends a reminder email.
How it went
No author-reported effectiveness data. Template page shows 338 views (author_report: view count from api).
Worth knowing
1. The reminder email uses the Japanese placeholder 持ち物 (items to bring); adapt to your school’s language. 2. Calendar events default to 1 hour after start if no end time is given; all-day event logic requires manual adjustment. 3. The attachment branch only filters image mimeType; non-image attachments are dropped. 4. Contact extraction only reads the From field; complex signatures are not further parsed. 5. This site has not tested the workflow; verify classification accuracy with test emails before processing live school mail.
n8n workflow template
Structure checked · Not run-testedUse “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.
Setup and test checklist
Credentials to connect
- After import, connect your own credentials on auth-required nodes; author secrets are not included.
Configuration to replace
- Source template is n8n public workflow #11529 (~23 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
- Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.
Test input and expected output
- Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
- Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.
Template changes
- Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
- No business-logic edits; verify keys, quotas and privacy compliance before use.
Template retrieved: 2026-10-25
Steps
Capture and classify new emails
After importing the template into n8n, configure the trigger and AI extraction nodes: 1. **When Email Arrives** (Gmail Trigger): select your connected Gmail credential and set the poll interval (default everyMinute). 2. **Get a message** (Gmail): use the expression `={{ $json.id.toString().trim() }}` to load the full email (subject, body, metadata). 3. **Workflow Configuration** (Set node): fill shared variables—photosFolderId, noticesFolderId, contactsFolderId (Google Drive folder IDs) and reminderEmail (address for daily reminders). 4. **Extract Email Info** (Information Extractor): enter `=={{ $json.textPlain || $json.textHtml || $json.snippet }}` in the text field, and paste the systemPromptTemplate below into the System Prompt area. Connect this node to **OpenAI Chat Model** (default gpt-4.1-mini). 5. **Route by Category** (Switch): route by output.category—Schedule / What to Bring → create calendar event and notice file; Notice → save notice file only; has attachments → enter the attachment branch.
Execution prompt · Source text。Extract Email Info node System Prompt field (options.systemPromptTemplate)
Analyze this school-related email and extract structured information. First, categorize the email into exactly ONE of the following: - \"Schedule\" (予定・イベント・行事の案内、日時と場所が書いてあるもの) - \"What to Bring\" (持ち物リスト、準備物のお知らせ) - \"Notice\" (連絡事項・お知らせだが、特に日時や持ち物がメインではないもの) - \"Contacts\" (先生や学校、連絡先情報がメインのメール) Field rules: - category: One of \"Schedule\", \"What to Bring\", \"Notice\", or \"Contacts\". - hasAttachments: true if the email mentions attachments or clearly refers to attached files/images, otherwise false. - eventTitle: Short title for the event (e.g., 運動会, 個人面談, 授業参観). - eventDescription: A short natural language summary of what the event is about. - eventDate: If any date/time is mentioned, convert it to full ISO 8601 with timezone, e.g. \"2024-12-25T12:30:00+09:00\". - If the year is missing (e.g., \"12月25日\"), assume the next upcoming occurrence of that date. - If only a date (no time) is given, use 09:00 as a default time. - itemsToBring: A concise Japanese list of things to bring (e.g. \"体操服, 上履き, 赤白帽子\"). If no items are required, use an empty string. - contacts: Any phone numbers, email addresses, or named contacts (先生の名前、学校の連絡先など). If none, use an empty string. - subject: The subject of the email as written in the original message. - id: The email ID passed in the input. IMPORTANT: - If the email includes both schedule information AND items to bring, you may choose \"What to Bring\" as category but STILL fill eventDate and eventTitle. - Always try to fill eventDate when a date can be inferred from the text. - Do NOT invent information that is clearly not in the email. CRITICAL OUTPUT INSTRUCTION: Output ONLY valid raw JSON for the defined attributes. Do NOT use markdown code blocks (no ```json). Do NOT add any explanation or extra text. Return just the JSON object.
Execution prompt · Source text。Extract Email Info node text input field
=={{ $json.textPlain || $json.textHtml || $json.snippet }}Save to Drive and Calendar by category
Based on the Switch routing, each branch performs the following: - **Save Notice to Drive** (Google Drive, createFromText): file name `=Notice - {{ $json.output.eventTitle }}.txt`, content uses the template below, saved to noticesFolderId. - **Prepare Calendar Event** (Set): builds calendarEventTitle, calendarEventDescription (including 持ち物 list), calendarEventsStart, calendarEventEnd (defaults to 1 hour after start if no end time). - **Add to Calendar** (Google Calendar): creates the event using the fields above; select the target calendar (default [email protected]). - **Get Email Attachments** (Gmail, operation=get, downloadAttachments=true) → **Filter Photos Only** (Filter, condition `$binary.attachment_0.mimeType` contains `image`) → **Save Photos to Drive** (Google Drive, inputDataFieldName=attachment_0, saved to photosFolderId). - **Extract Contacts** (Set): extracts From, Subject, current timestamp → **Filter** (contactInfo notEmpty) → **Save Contacts to Drive** (createFromText, saved to contactsFolderId).
Execution prompt · Source text。Save Notice to Drive node content field (createFromText)
=Title: {{ $json.output.eventTitle }} Date: {{ $json.output.eventDate }} Category: {{ $json.output.category }} Items to Bring: {{ $json.output.itemsToBring }} Description: {{ $json.output.eventDescription }}Execution prompt · Source text。Save Contacts to Drive node content field (createFromText)
=Contact Information: {{ $json.contactInfo }} Extracted from: {{ $json.emailSubject }} Date: {{ $json.extractedDate }}Daily reminder for tomorrow’s items to bring
Independent branch triggered by Schedule Trigger every morning (default 8:00): 1. **Get Tomorrow's Events** (Google Calendar, getAll): query all events for tomorrow (timeMin/timeMax use `$now.plus({days: 1}).startOf('day')` / `.endOf('day')`). 2. **Filter What to Bring Events** (Filter): keep events whose description contains 持ち物. 3. **Send Reminder Email** (Gmail): send a summary email to reminderEmail (or read from event creator.email), subject and body use the expressions below.
Execution prompt · Source text。Send Reminder Email node message field
=={{ `【明日の予定】\n${$json.summary}\n\n開始: ${$json.start.dateTime || $json.start.date}\n終了: ${$json.end.dateTime || $json.end.date}\n\n${$json.description}` }}Execution prompt · Source text。Send Reminder Email node subject field
=={{ $json.summary || '明日の予定のお知らせ' }}
Prompt you can copy
Setup guidance · Editorial suggestion。Hand to setup assistant to confirm inputs and permissions before configuring nodes
This block is the prompt. Ads are never placed here.
You are setting up the n8n template 11529 "School Email Auto-Triage and Organization Hub". First confirm the prerequisites: 1. Internet-connected n8n instance with Gmail, Google Drive, Google Calendar, and OpenAI nodes available; 2. Google OAuth2 credentials configured (Gmail, Drive, Calendar may share one OAuth or use separate ones); 3. OpenAI API key configured; 4. Google Drive folders created and their folder IDs copied (photos, notices, contacts); 5. The email address that will receive daily reminders. Once confirmed, import workflow.json or install from the template gallery, replace the placeholder values in Workflow Configuration, adapt the systemPromptTemplate in Extract Email Info to your school’s language (keep the JSON-only output requirement), then activate the workflow and test with real school emails.
To adapt for non-Japanese school emails, replace the Japanese examples in systemPromptTemplate with your local language while keeping the "Output ONLY valid raw JSON" enforcement.
Source
Organize school emails with AI, Google Calendar and Drive auto-triage system · anna0726 · n8n.io · 2025-12-05
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.