AutomationFlowsAI & RAG › AI Email Classification with Verifiable Decision Receipts

AI Email Classification with Verifiable Decision Receipts

AI Email Classification with Verifiable Decision Receipts. Uses gmailTrigger, openAi, n8n-nodes-signatrust, gmail. Event-driven trigger; 7 nodes.

Event trigger★★★★☆ complexityAI-powered7 nodesGmail TriggerOpenAIN8N Nodes SignatrustGmail
AI & RAG Trigger: Event Nodes: 7 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the Gmail → Gmail Trigger recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "AI Email Classification with Verifiable Decision Receipts",
  "nodes": [
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "simple": true,
        "filters": {}
      },
      "id": "6d47370e-c573-4446-80f6-e95b0d6a0696",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        300
      ],
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "GPT-4O"
        },
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "=You are an email triage AI. Classify the email and return JSON: {\"category\":\"SPAM|SUPPORT|SALES|OTHER\",\"is_spam\":true,\"reason\":\"...\"}."
            },
            {
              "content": "=Classify this email. JSON only.\n\nFrom: {{ $json.from }}\nSubject: {{ $json.subject }}\nBody:\n{{ $json.snippet }}"
            }
          ]
        },
        "jsonOutput": true,
        "options": {}
      },
      "id": "b8aa05ce-d3be-4037-aee0-88566bc84244",
      "name": "AI Email Classification",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2.1,
      "position": [
        220,
        300
      ],
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "generateReceipt",
        "agentName": "EmailTriageAgent",
        "workflowName": "={{ $workflow.name }}",
        "action": "={{ 'Classified email as ' + $json.message.content.category }}",
        "decision": "={{ JSON.stringify($json.message.content) }}",
        "additionalFields": {
          "modelProvider": "openai",
          "modelUsed": "gpt-4o-mini",
          "decisionType": "classification",
          "riskLevel": "low",
          "humanReview": false,
          "policies": "data-handling-v1",
          "permissions": "email.classify",
          "tags": "email, triage, automation"
        }
      },
      "id": "88d06852-2438-49b1-8165-55893b621818",
      "name": "Signatrust: Receipt",
      "type": "n8n-nodes-signatrust.signatrust",
      "typeVersion": 1,
      "position": [
        440,
        300
      ],
      "credentials": {
        "signatrustApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "id": "73dcb603-bbca-4267-914e-2502e483dfbe",
              "leftValue": "={{ $('AI Email Classification').item.json.message.content.is_spam }}",
              "rightValue": "true",
              "operator": {
                "type": "boolean",
                "operation": "true"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "7ff07fef-bb58-4d6b-9a0c-fab6daf2be2c",
      "name": "IF Spam",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        660,
        300
      ]
    },
    {
      "parameters": {
        "operation": "addLabels",
        "messageId": "={{ $('Gmail Trigger').item.json.id }}",
        "labelIds": [
          "SPAM"
        ]
      },
      "id": "aeded956-873d-4b48-85ff-b9e11ca8a6b7",
      "name": "Move to Spam",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        880,
        200
      ],
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {},
      "id": "7afb7823-a4cc-4f6d-870d-7c5d337c69fc",
      "name": "Keep in Inbox",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        880,
        440
      ]
    },
    {
      "parameters": {
        "content": "## AI Email Classification + Signatrust\nEvery automated email classification is signed so that if a message is later disputed (e.g. wrongly marked spam) you have a verifiable record of the AI's decision.",
        "height": 200,
        "width": 430,
        "color": 5
      },
      "id": "940e6c75-1e20-44b4-bfb0-3b87cf61dd17",
      "name": "Sticky Note 48fe7c",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -40,
        30
      ]
    }
  ],
  "connections": {
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "AI Email Classification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Email Classification": {
      "main": [
        [
          {
            "node": "Signatrust: Receipt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Signatrust: Receipt": {
      "main": [
        [
          {
            "node": "IF Spam",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF Spam": {
      "main": [
        [
          {
            "node": "Move to Spam",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Keep in Inbox",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "tags": [
    {
      "name": "AI Email Classification \u2014 Email"
    },
    {
      "name": "AI Email Classification \u2014 Triage"
    },
    {
      "name": "Signatrust (5)"
    },
    {
      "name": "AI Email Classification \u2014 AI"
    }
  ],
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "versionId": "8d9f7dc8-37cd-4f3e-879d-acfd38f176d2"
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

AI Email Classification with Verifiable Decision Receipts. Uses gmailTrigger, openAi, n8n-nodes-signatrust, gmail. Event-driven trigger; 7 nodes.

Source: https://github.com/abokenan444/n8n-signatrust-workflows/blob/main/workflows/05-ai-email-classification.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This workflow delivers a complete, enterprise-grade Gmail automation system designed for high-volume teams. It classifies incoming emails, applies labels, generates AI-powered responses, and routes me

Gmail, OpenAI, Telegram +3
AI & RAG

Automatically organise your Gmail inbox using AI. This workflow categorises every incoming email and applies Gmail labels, keeping only important emails in your inbox while filing everything else auto

OpenAI, Gmail, Gmail Trigger
AI & RAG

Gmail Task Extractor. Uses gmailTrigger, gmail, openAi. Event-driven trigger; 5 nodes.

Gmail Trigger, Gmail, OpenAI
AI & RAG

Domain Outbound Machine is an n8n workflow designed to fully automate the domain sales process: lead generation, email extraction, personalized outreach, and automated email sending. It also stores ex

Google Sheets, HTTP Request, Gmail +1
AI & RAG

Monitor YouTube channels, fetch stats, classify videos as viral (≥ 1000 likes) or normal, and auto‑generate LinkedIn/email summaries with GPT‑4. Deliver via Gmail or SMTP. Clear node names, examples,

RSS Feed Read, HTTP Request, OpenAI +1