Skip to main content

Prioritize exception queues with Gemini, Google Sheets, Slack and Gmail

Workflow preview

Workflow preview
100%
Prioritize exception queues with Gemini, Google Sheets, Slack and Gmail preview
Open on n8n.io

1. Workflow Overview

Quick Overview This workflow receives a webhook trigger, reads exception records from Google Sheets, uses Google Gemini (Generative Language API) to rank and summarize them, posts a prioritized rep...

Best for

  • Automation automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.googlesheets, n8n-nodes-base.code, n8n-nodes-base.httprequest, n8n-nodes-base.if, n8n-nodes-base.gmail, n8n-nodes-base.stickynote, n8n-nodes-base.set

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by WeblineIndia.

Original n8n.io source

1.1 Workflow description

Title
Prioritize exception queues with Gemini, Google Sheets, Slack and Gmail
Workflow name
Prioritize exception queues with Gemini, Google Sheets, Slack and Gmail

Quick Overview

This workflow receives a webhook trigger, reads exception records from Google Sheets, uses Google Gemini (Generative Language API) to rank and summarize them, posts a prioritized report to Slack, writes summary metrics back to Google Sheets, and emails a critical alert via Gmail when needed.

How it works

  1. Receives a webhook request to start an exception-queue analysis run.
  2. Reads the current exception list from a Google Sheets worksheet and stops with a “No open exceptions found” webhook response if there are no rows.
  3. Formats the sheet rows into a structured text list and sends it to the Google Gemini API to generate a ranked, scored priority list plus summary counts.
  4. Parses the Gemini response and builds Slack Block Kit content, an HTML email body for critical items, and fields for saving analysis metadata.
  5. Appends or updates a summary row in a second Google Sheets worksheet with the AI summary and severity counts.
  6. Posts the ranked exception report to a Slack channel.
  7. If any critical exceptions are detected, sends an alert email via Gmail, then returns a JSON “Done” response to the original webhook caller with processing statistics.

Setup

  1. Add credentials for Google Sheets OAuth2, Slack OAuth2, and Gmail OAuth2 in n8n.
  2. Provide a Google Gemini API key and update the HTTP request to use it (preferably via an n8n credential or environment variable rather than hard-coding).
  3. Update the Google Sheets document ID and ensure Sheet1 contains columns like ExceptionID, Title, Severity, System, and ReportedAt, and Sheet2 has columns for summary and count fields used by the workflow.
  4. Select the target Slack channel in the Slack node and confirm it matches where you want the priority report posted.
  5. Configure the Gmail node with the recipient(s) and ensure your webhook URL (path: /exception-trigger) is used by the system that should trigger the analysis.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Receive Exception Request

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 2 - Read Exceptions from Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4

Block 3 - Format Data for AI

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 4 - AI — Rank & Prioritize

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 5 - Save Summary to Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4

Block 6 - Check Critical Alerts

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 7 - Send Critical Email

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.2

Block 8 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Config Variables

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 13 - Exceptions Available?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 14 - No Exceptions Found

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.1

Block 15 - AI Results

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 16 - Slack Report

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.2

Block 17 - Success

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.1

3. Summary Table

Workflow Prioritize exception queues with Gemini, Google Sheets, Slack and Gmail
Complexity advanced
Nodes 17
Categories Automation
Author WeblineIndia
Published 16 Jun 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16434/16434.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Prioritize exception queues with Gemini, Google Sheets, Slack and Gmail do?

Quick Overview This workflow receives a webhook trigger, reads exception records from Google Sheets, uses Google Gemini (Generative Language API) to rank and summarize them, posts a prioritized rep...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Automation use case.