Workflows· Operations & Project Management

    The Inbox Router

    A workflow that automatically classifies incoming emails, applies the matching label, and immediately alerts you when something is urgent.

    automatinganalyticalstructuring

    Description

    Steps

    Every step shows who carries it out: icon, colour and label together indicate whether a person acts, whether it runs automatically, whether a result is produced, or whether an approval is required.

    01Person

    The workflow starts hourly or immediately, as soon as a new email arrives.

    02Automated

    03Automated

    04Automated

    05Result

    Key
    PersonAutomatedResultApproval

    Requirements and operations

    Requirements

    • Email tool with labeling Gmail, Outlook, or a comparable tool, with write access.
    • Notification tool Slack, Teams, Discord, or email for the Urgent alert.
    • LLM access An API key for OpenAI, Claude, or Gemini.
    • Labels in the email tool Urgent, Info, Spam, and Follow-up set up in advance.

    Testing

    • Send test emails Send three to four emails covering all categories (Urgent, Info, Follow-up, Spam) to yourself.
    • Check labels Verify that every email received the matching label.
    • Check the alert Verify that a notification was triggered on Urgent.
    • Check the report Verify that the statistics and the three most urgent emails in the daily report are correct.

    Go-live

    • Approval to start Activate the workflow only once every test case runs cleanly.
    • Review mode Let the workflow run for one to two weeks and review the classifications before switching it on without oversight.
    • Sharpen the context Add senders and typical topics to the prompt, the more precise the work context, the more accurate the classification.
    • Expand Extend the workflow as needed with a spam auto-archive, reply drafts, or automatic CRM tasks.

    Common issues

    • Work context too generic Add senders and typical topics to the prompt, otherwise misclassifications pile up.
    • Labels missing in the email tool Create the four labels in advance, before activating the workflow.
    • No write access Check the integration's permissions to the email tool.
    • Alert does not arrive Check the webhook URL or channel ID of the notification tool.

    Builder Prompt

    GOAL
    Build a workflow that automatically sorts incoming emails via AI into one of four categories, Urgent, Follow-up, Info, or Spam, applies the matching label in the email tool, sends an immediate notification when something is Urgent, and optionally dispatches a daily short report.
    
    Adapt the structure to the concepts of your automation tool, for example nodes, steps, zaps, or agent actions. While doing so, preserve the trigger logic, the sequence, the parallelism, and the data flow.
    
    TRIGGER
    Type: a new incoming email, for example in Gmail or Outlook. Alternatively, scheduled hourly as a batch over all new emails since the last run.
    Filter: only the desired inbox or label, for example the main inbox. Emails already categorized are skipped.
    
    STEPS
    1. Extract email data: sender, subject, content, and date received.
    2. AI step: classification. Use the classification prompt below exactly. The output is JSON with the fields category, rationale, and priority. After this, step 3 and step 4 run in parallel.
    3. Set label: the JSON field category is mapped to the label of the same name in the email tool, Urgent, Follow-up, Info, or Spam. The four labels must already exist in the tool.
    4. Condition: only when category equals Urgent, a notification is triggered in Slack, Teams, or by email, with sender, subject, and rationale.
    5. Output, optional: a daily inbox report. Use the summary prompt below exactly, over all emails categorized that day. Delivery by email or Slack.
    
    PROMPTS, COPY EXACTLY AND UNCHANGED
    Classification prompt:
    """
    You are an email triage assistant. Address the user in a professional manner throughout. Analyze the following email and assign it to exactly one of the following categories. If information relevant to the classification is missing, mark your assessment as an assumption rather than presenting it as certain.
    
    Email details:
    Sender: [SENDER]
    Subject: [SUBJECT]
    Content: [EMAIL_CONTENT]
    Received on: [DATE_RECEIVED]
    
    Categories:
    1. Urgent: time-critical requests, escalations, important customer communication, urgent appointments
    2. Follow-up: emails that require a response or action but are not time-critical
    3. Info: newsletters, notifications, FYI emails with no action required
    4. Spam: advertising, unwanted emails, newsletters from unknown senders
    
    Context of your work:
    [WORK_CONTEXT]
    
    Output format, JSON only:
    {
      "category": "Urgent|Follow-up|Info|Spam",
      "rationale": "Short rationale in 1 sentence",
      "priority": "high|medium|low"
    }
    """
    
    Summary prompt:
    """
    Create a concise summary of the email triage results, addressing the user in a professional manner throughout.
    
    Categorized emails:
    [EMAIL_LIST]
    
    Statistics:
    Total: [TOTAL_COUNT]
    Urgent: [URGENT_COUNT]
    Follow-up: [FOLLOWUP_COUNT]
    Info: [INFO_COUNT]
    Spam: [SPAM_COUNT]
    
    Output format:
    Create a structured summary with:
    1. Heading "Email triage [DATE/TIME]"
    2. Statistics overview
    3. The three most urgent emails with sender and subject
    4. A recommendation on which emails to handle first
    
    Keep the summary to a maximum of 200 words.
    """
    
    DATA FLOW
    Step 1 to step 2: [SENDER], [SUBJECT], [EMAIL_CONTENT], [DATE_RECEIVED].
    Step 2 to step 3 and 4: the JSON fields category, rationale, and priority.
    Daily run to step 5: [EMAIL_LIST], [TOTAL_COUNT], [URGENT_COUNT], [FOLLOWUP_COUNT], [INFO_COUNT], [SPAM_COUNT].
    
    ERROR HANDLING
    AI returns no valid JSON: retry once, then set the default category Follow-up and log the error.
    Label does not exist: log the error, do not abort the workflow. Create the labels in advance.
    Notification fails: check the webhook URL or channel ID, log the error.
    No write access in the email tool: report it as an open configuration item.
    
    PLACEHOLDER CONVENTION
    All placeholders in square brackets are variables. Map them dynamically to data from previous steps, as described in the data flow. Exception: [WORK_CONTEXT] is not dynamic. Set it manually before activation, with role, topics, and important senders. List such manual placeholders separately at the end.
    
    SELF CHECK BEFORE COMPLETION
    Check, before you report the workflow as finished:
    1. Are all steps connected correctly, including the parallelism of step 3 and 4 and the Urgent condition?
    2. Are both prompts inserted completely and unchanged, and are all placeholders mapped?
    3. Is the JSON output from step 2 parsed correctly, with category, rationale, and priority?
    4. Are all points listed that require manual configuration: inbox connection, LLM API key, channel ID, the four labels, and [WORK_CONTEXT]?

    Working prompts

    Prompt for email categorization

    Assigns a single email to one of the four categories based on sender, subject, and content.

    You are an email triage assistant. Address the user in a professional manner throughout. Analyze the following email and assign it to exactly one of the following categories. If information relevant to the classification is missing, mark your assessment as an assumption rather than presenting it as certain.
    
    Email details:
    Sender: [SENDER]
    Subject: [SUBJECT]
    Content: [EMAIL_CONTENT]
    Received on: [DATE_RECEIVED]
    
    Categories:
    1. Urgent: time-critical requests, escalations, important customer communication, urgent appointments
    2. Follow-up: emails that require a response or action but are not time-critical
    3. Info: newsletters, notifications, FYI emails with no action required
    4. Spam: advertising, unwanted emails, newsletters from unknown senders
    
    Context of your work:
    [WORK_CONTEXT]
    
    Output format, JSON only:
    {
      "category": "Urgent|Follow-up|Info|Spam",
      "rationale": "Short rationale in 1 sentence",
      "priority": "high|medium|low"
    }

    Prompt for the inbox summary

    Summarizes the emails categorized on a given day into a short report.

    Create a concise summary of the email triage results, addressing the user in a professional manner throughout.
    
    Categorized emails:
    [EMAIL_LIST]
    
    Statistics:
    Total: [TOTAL_COUNT]
    Urgent: [URGENT_COUNT]
    Follow-up: [FOLLOWUP_COUNT]
    Info: [INFO_COUNT]
    Spam: [SPAM_COUNT]
    
    Output format:
    Create a structured summary with:
    1. Heading "Email triage [DATE/TIME]"
    2. Statistics overview
    3. The three most urgent emails with sender and subject
    4. A recommendation on which emails to handle first
    
    Keep the summary to a maximum of 200 words.

    JSON export

    Setup

    Two routes lead to the same result. Pick the one that fits your setup.

    Suitable when you want to build the workflow in your own automation tool.

    1. Open your workflow tool, for example n8n, Make, Zapier or Langdock.
    2. Create a new workflow and give it a name.
    3. Choose the AI-assisted build option if your tool offers one.
    4. Paste the builder prompt from above in full.
    5. Check the result against the step sequence in this document, then add your access credentials and channels.

    Suitable when you want to take the workflow over unchanged.

    1. Download the JSON file from the JSON export section.
    2. Open the workflow area of your tool and create a new workflow.
    3. Give it a name and confirm.
    4. Open the menu on the workflow name and choose to import a JSON file.
    5. Upload the file, then add your own access credentials.
    6. Run a test before you activate the workflow.

    Last reviewed:

    In the workshop this becomes your method.

    A single prompt becomes a repeatable method. We show that in the workshop From Prompt to Method.

    View workshops

    Related resources

    Browse all resources

    Conversation, not pitch

    Understand first, then decide. We take time for an initial conversation, without sales pressure, without obligation.

    Schedule a call