AutomationFlowsAI & RAG › Inbox Insight

Inbox Insight

Inbox Insight. Uses openAi, emailSend, postgres. Webhook trigger; 9 nodes.

Webhook trigger★★★★☆ complexityAI-powered9 nodesOpenAIEmail SendPostgres
AI & RAG Trigger: Webhook Nodes: 9 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the Emailsend → OpenAI 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": "Inbox Insight",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "f12fc46a-945f-48c0-84d0-8884ea0eecf6",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        -240
      ],
      "id": "195f6da3-4844-48e6-b3a0-2050b7098312",
      "name": "Webhook"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI"
        },
        "messages": {
          "values": [
            {
              "content": "=# Email Parsing Prompt for Sleep & Wellness Data Extraction\n\n## System Instructions\nYou are an AI assistant specialized in extracting sleep and wellness data from personal emails. Your task is to analyze email content and subject line to extract specific health-related metrics in a structured JSON format.\n\n## Core Task\nParse the provided email content and subject line to extract the following fields as accurately as possible:\n\n### Required Fields:\n- **sleep_hours**: Number of hours slept (extract from text, estimate if approximate)\n- **mood_score**: Mood rating from 1-10 (1=very bad, 10=excellent)\n- **energy_level**: Energy level from 1-10 (1=exhausted, 10=very energetic)\n- **activity**: Brief summary of activities mentioned\n- **stress_level**: Stress level from 1-10 (1=very relaxed, 10=extremely stressed)\n- **weather**: Weather information if mentioned (null if not discussed)\n- **note**: Encouraging message summarizing the user's day and accomplishments\n\n## Parsing Guidelines\n\n### Email Subject Analysis:\n- Analyze the subject line for mood indicators, urgency, or wellness themes\n- Look for keywords like: \"great day\", \"rough night\", \"feeling better\", \"stressed out\"\n- Consider emojis or special characters that indicate emotional state\n- Use subject context to inform mood and stress level scoring\n\n### Historical Context Integration:\n- If historical mood data is provided, review the user's latest mood entry\n- Compare current mood indicators with previous entry to identify trends when available\n- Note improvements or declines in wellness metrics if historical data exists\n- Use historical context to provide more accurate assessments when possible\n- If no historical data available, analyze current email independently\n\n### Sleep Hours Extraction:\n- Look for explicit mentions: \"slept 8 hours\", \"got 6.5 hours of sleep\"\n- Parse time ranges: \"went to bed at 10pm, woke up at 6am\" = 8 hours\n- Handle approximations: \"slept poorly\", \"barely got any sleep\" = estimate low (3-5 hours)\n- If unclear but sleep is mentioned, provide best estimate\n- If no sleep info found, return null\n\n### Mood Score (1-10):\n- **1-3**: Terrible, awful, depressed, very sad, miserable\n- **4-5**: Bad, down, not great, struggling, frustrated  \n- **6-7**: Okay, fine, average, neutral, so-so\n- **8-9**: Good, happy, positive, great, upbeat\n- **10**: Excellent, amazing, fantastic, euphoric, perfect\n\n### Energy Level (1-10):\n- **1-3**: Exhausted, drained, no energy, can't function\n- **4-5**: Tired, low energy, sluggish, dragging\n- **6-7**: Moderate energy, okay, getting by\n- **8-9**: Energetic, good energy, productive, active\n- **10**: Super energetic, full of energy, unstoppable\n\n### Activity Summary:\n- Summarize main activities mentioned in 1-2 sentences\n- Focus on significant events, not routine tasks\n- If no activities mentioned, return \"No specific activities mentioned\"\n\n### Stress Level (1-10):\n- **1-3**: Very relaxed, calm, peaceful, zen, no worries\n- **4-5**: Mild stress, some concerns, manageable pressure\n- **6-7**: Moderate stress, noticeable pressure, some anxiety\n- **8-9**: High stress, overwhelmed, anxious, pressure\n- **10**: Extreme stress, panic, crisis mode, breaking point\n\n### Weather Information:\n- Extract any weather mentions: sunny, rainy, cold, hot, temperature, etc.\n- Include temperature if mentioned\n- If no weather discussed, return null\n- Format as brief description: \"Sunny and warm\", \"Rainy, 15\u00b0C\"\n\n### Encouraging Note:\n- Create a personalized, encouraging message (2-3 sentences)\n- **Always include the user's name** to make it personal and engaging\n- **Reference historical context if provided** (e.g., \"I noticed your mood improved since last time!\")\n- Acknowledge the user's activities and efforts positively\n- Highlight any accomplishments or positive aspects mentioned\n- **Compare with previous entries if available** to celebrate improvements or offer support for challenges\n- Offer gentle motivation or recognition\n- Keep tone warm, supportive, and uplifting\n- Examples: \n  - With history: \"Great job getting that workout in despite feeling tired, Sarah! I can see your energy levels are improving compared to last week.\"\n  - Without history: \"Great job getting that workout in despite feeling tired, Sarah! Taking care of your health shows real commitment.\"\n\n## Output Format\nAlways respond with valid JSON only:\n\n```json\n{\n  \"sleep_hours\": 7.5,\n  \"mood_score\": 6,\n  \"energy_level\": 4,\n  \"activity\": \"Worked from home, had lunch with Sarah, evening yoga class\",\n  \"stress_level\": 7,\n  \"weather\": \"Rainy and cold\",\n  \"note\": \"Nice work fitting in that yoga class even after a busy work day, Alex! Taking time for self-care shows you're prioritizing your wellbeing.\"\n}\n```\n\n## Important Rules:\n1. Always return valid JSON format\n2. Use null for missing information, not empty strings\n3. Numbers should be integers or decimals (not strings)\n4. **Consider both current email AND historical context if provided** when making assessments\n5. **Analyze email subject line** for additional mood/wellness indicators\n6. Be conservative with estimates - if unclear, err on the side of neutral values\n7. Focus on the overall tone and content, not individual words\n8. Consider context clues and implied information\n9. **Use historical trends if available** to provide more accurate and personalized notes\n\n## Example Analysis Process:\n1. **Analyze email subject line** for mood/wellness indicators\n2. **Review historical mood data if provided** to understand user's baseline and trends\n3. Read the entire email content thoroughly\n4. Identify explicit mentions of each field\n5. **Compare current state with previous entries if historical data available**\n6. Infer missing values from context, tone, and historical patterns when possible\n7. Rate subjective scores based on language patterns and available context\n8. **Create personalized note** that acknowledges progress or offers appropriate support\n9. Format as clean JSON response\n\n---\n\n## Input Data\n\n**User's name:** {{ $('Webhook').item.json.body.FromName }}\n\n**Email subject:** {{ $('Webhook').item.json.body.Subject }}\n\n**Historical mood data (optional):** No historical data for now\n*Note: This may be null if no previous entries exist. If available, this contains the user's previous mood_score, energy_level, stress_level, sleep_hours, created_at timestamp, and activity summary.*\n\n**Email content to analyze:**\n{{ $('Webhook').item.json.body.TextBody }}\n\nPlease analyze the above information and return the extracted data in the specified JSON format. Remember to use the user's name in the encouraging note and incorporate historical context if available.",
              "role": "system"
            }
          ]
        },
        "jsonOutput": true,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        660,
        60
      ],
      "id": "9426a325-3c28-450a-b218-e7a8f475586e",
      "name": "Aura Agent",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "classify",
        "input": "=From email address : {{ $json.body.From }}\nFrom : {{ $json.body.FromName }}\nSubject : {{ $json.body.Subject }}\nEmail Content : {{ $json.body.TextBody }}",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        220,
        -240
      ],
      "id": "6cf1568a-6bf6-46e2-93f1-a008e6b5232b",
      "name": "Classify Text For Violations",
      "notesInFlow": false,
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "d74970f5-1f29-47d4-90ab-0df7e0b7b320",
              "leftValue": "={{ $json.categories['sexual/minors'] }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            },
            {
              "id": "3572bc11-bab5-4517-8d4c-2b6e6b10e9cc",
              "leftValue": "={{ $json.categories.hate }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            },
            {
              "id": "0f954ccc-55ec-418a-9623-0de115d17c3d",
              "leftValue": "={{ $json.categories['hate/threatening'] }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            },
            {
              "id": "a736ebef-cd1d-4154-b707-b17245a35dc4",
              "leftValue": "={{ $json.categories['harassment/threatening'] }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            },
            {
              "id": "95fe6da4-59ac-4848-adc0-2adda25290e5",
              "leftValue": "={{ $json.categories.violence }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            },
            {
              "id": "b0f27c9e-abc7-421f-a248-397c703e9ef6",
              "leftValue": "={{ $json.categories.sexual }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "or"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        440,
        -240
      ],
      "id": "63cb9f45-9cc0-4788-b715-c5b5dfce2225",
      "name": "If"
    },
    {
      "parameters": {
        "fromEmail": "InboxInsights Alerts <violations@inboxinsights.me>",
        "toEmail": "={{ $('Webhook').item.json.body.From }}",
        "subject": "BLOCKED: Inappropriate Content Detected",
        "emailFormat": "text",
        "text": "=Your email sent on {{ $('Webhook').item.json.body.Date }} with the subject \"{{ $('Webhook').item.json.body.Subject }}\" has been BLOCKED due to inappropriate content.\n\n**VIOLATION DETECTED:**\nOur automated systems have identified content that violates our communication standards. This type of content is not acceptable and will not be tolerated.\n\n**IMMEDIATE ACTION REQUIRED:**\n- Your message has been permanently blocked\n- Further violations may result in your email address being blacklisted\n- All inappropriate communications are logged and may be reported\n\nIf you believe this action was taken in error, we are sorry! Don't forget it's just a demo project !\n\n\n---\nCompliance Department\nhttps://www.inboxinsights.me/\n\nReference ID: {{ $('Webhook').item.json.body.MessageID }}\nFrom : {{ $('Webhook').item.json.body.From }}",
        "options": {
          "appendAttribution": false,
          "ccEmail": "maxime.l.beaudoin@gmail.com"
        }
      },
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        738,
        -340
      ],
      "id": "c48b0658-b2e4-40e3-9103-517b52467820",
      "name": "Send Alerts",
      "notesInFlow": true,
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      },
      "notes": "Send alert to the source and inboxinsights.me team"
    },
    {
      "parameters": {
        "operation": "upsert",
        "schema": {
          "__rl": true,
          "value": "public",
          "mode": "list",
          "cachedResultName": "public"
        },
        "table": {
          "__rl": true,
          "value": "email_violations",
          "mode": "list",
          "cachedResultName": "email_violations"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "sexual": "={{ $('Classify Text For Violations').item.json.categories.sexual }}",
            "hate": "={{ $('Classify Text For Violations').item.json.categories.hate }}",
            "harassment": "={{ $('Classify Text For Violations').item.json.categories.harassment }}",
            "self_harm": "={{ $('Classify Text For Violations').item.json.categories['self-harm'] }}",
            "sexual_minors": "={{ $('Classify Text For Violations').item.json.categories['sexual/minors'] }}",
            "hate_threatening": "={{ $('Classify Text For Violations').item.json.categories['hate/threatening'] }}",
            "violence_graphic": "={{ $('Classify Text For Violations').item.json.categories['violence/graphic'] }}",
            "self_harm_intent": "={{ $('Classify Text For Violations').item.json.categories['self-harm/intent'] }}",
            "self_harm_instructions": "={{ $('Classify Text For Violations').item.json.categories['self-harm/instructions'] }}",
            "harassment_threatening": "={{ $('Classify Text For Violations').item.json.categories['harassment/threatening'] }}",
            "violence": "={{ $('Classify Text For Violations').item.json.categories.violence }}",
            "sexual_score": "={{ $('Classify Text For Violations').item.json.category_scores.sexual }}",
            "hate_score": "={{ $('Classify Text For Violations').item.json.category_scores.hate }}",
            "harassment_score": "={{ $('Classify Text For Violations').item.json.category_scores.harassment }}",
            "self_harm_score": "={{ $('Classify Text For Violations').item.json.category_scores['self-harm'] }}",
            "sexual_minors_score": "={{ $('Classify Text For Violations').item.json.category_scores['sexual/minors'] }}",
            "hate_threatening_score": "={{ $('Classify Text For Violations').item.json.category_scores['hate/threatening'] }}",
            "violence_graphic_score": "={{ $('Classify Text For Violations').item.json.category_scores['violence/graphic'] }}",
            "self_harm_intent_score": "={{ $('Classify Text For Violations').item.json.category_scores['self-harm/intent'] }}",
            "self_harm_instructions_score": "={{ $('Classify Text For Violations').item.json.category_scores['self-harm/instructions'] }}",
            "harassment_threatening_score": "={{ $('Classify Text For Violations').item.json.category_scores['harassment/threatening'] }}",
            "violence_score": "={{ $('Classify Text For Violations').item.json.category_scores.violence }}",
            "email_entry_id": "={{ $('Webhook').item.json.body.MessageID }}",
            "flagged": "={{ $('Classify Text For Violations').item.json.flagged }}"
          },
          "matchingColumns": [
            "email_entry_id"
          ],
          "schema": [
            {
              "id": "id",
              "displayName": "id",
              "required": false,
              "defaultMatch": true,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "email_entry_id",
              "displayName": "email_entry_id",
              "required": true,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "flagged",
              "displayName": "flagged",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "boolean",
              "canBeUsedToMatch": false,
              "removed": false
            },
            {
              "id": "sexual",
              "displayName": "sexual",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "boolean",
              "canBeUsedToMatch": false
            },
            {
              "id": "hate",
              "displayName": "hate",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "boolean",
              "canBeUsedToMatch": false
            },
            {
              "id": "harassment",
              "displayName": "harassment",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "boolean",
              "canBeUsedToMatch": false
            },
            {
              "id": "self_harm",
              "displayName": "self_harm",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "boolean",
              "canBeUsedToMatch": false
            },
            {
              "id": "sexual_minors",
              "displayName": "sexual_minors",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "boolean",
              "canBeUsedToMatch": false
            },
            {
              "id": "hate_threatening",
              "displayName": "hate_threatening",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "boolean",
              "canBeUsedToMatch": false
            },
            {
              "id": "violence_graphic",
              "displayName": "violence_graphic",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "boolean",
              "canBeUsedToMatch": false
            },
            {
              "id": "self_harm_intent",
              "displayName": "self_harm_intent",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "boolean",
              "canBeUsedToMatch": false
            },
            {
              "id": "self_harm_instructions",
              "displayName": "self_harm_instructions",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "boolean",
              "canBeUsedToMatch": false
            },
            {
              "id": "harassment_threatening",
              "displayName": "harassment_threatening",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "boolean",
              "canBeUsedToMatch": false
            },
            {
              "id": "violence",
              "displayName": "violence",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "boolean",
              "canBeUsedToMatch": false
            },
            {
              "id": "sexual_score",
              "displayName": "sexual_score",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": false
            },
            {
              "id": "hate_score",
              "displayName": "hate_score",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": false
            },
            {
              "id": "harassment_score",
              "displayName": "harassment_score",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": false
            },
            {
              "id": "self_harm_score",
              "displayName": "self_harm_score",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": false
            },
            {
              "id": "sexual_minors_score",
              "displayName": "sexual_minors_score",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": false
            },
            {
              "id": "hate_threatening_score",
              "displayName": "hate_threatening_score",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": false
            },
            {
              "id": "violence_graphic_score",
              "displayName": "violence_graphic_score",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": false
            },
            {
              "id": "self_harm_intent_score",
              "displayName": "self_harm_intent_score",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": false
            },
            {
              "id": "self_harm_instructions_score",
              "displayName": "self_harm_instructions_score",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": false
            },
            {
              "id": "harassment_threatening_score",
              "displayName": "harassment_threatening_score",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": false
            },
            {
              "id": "violence_score",
              "displayName": "violence_score",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": false
            },
            {
              "id": "created_at",
              "displayName": "created_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "dateTime",
              "canBeUsedToMatch": false,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.6,
      "position": [
        1040,
        -40
      ],
      "id": "4e90a0c2-70c8-4f94-ad62-a937ba3f673e",
      "name": "Insert violations data",
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "upsert",
        "schema": {
          "__rl": true,
          "mode": "list",
          "value": "public"
        },
        "table": {
          "__rl": true,
          "value": "mood_entries",
          "mode": "list",
          "cachedResultName": "mood_entries"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "mood_score": "={{ $json.message.content.mood_score }}",
            "energy_level": "={{ $json.message.content.energy_level }}",
            "sleep_hours": "={{ $json.message.content.sleep_hours }}",
            "email_entry_id": "={{ $('Webhook').item.json.body.MessageID }}",
            "activity": "={{ $json.message.content.activity }}",
            "note": "={{ $json.message.content.note }}",
            "stress_level": "={{ $json.message.content.stress_level }}",
            "weather": "={{ $json.message.content.weather }}",
            "from": "={{ $('Webhook').item.json.body.From }}",
            "original_text": "={{ $('Webhook').item.json.body.TextBody }}",
            "from_name": "={{ $('Webhook').item.json.body.FromName }}",
            "subject": "={{ $('Webhook').item.json.body.Subject }}"
          },
          "matchingColumns": [
            "email_entry_id"
          ],
          "schema": [
            {
              "id": "id",
              "displayName": "id",
              "required": false,
              "defaultMatch": true,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "email_entry_id",
              "displayName": "email_entry_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "mood_score",
              "displayName": "mood_score",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": false
            },
            {
              "id": "energy_level",
              "displayName": "energy_level",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": false
            },
            {
              "id": "stress_level",
              "displayName": "stress_level",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": false,
              "removed": false
            },
            {
              "id": "note",
              "displayName": "note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": false,
              "removed": false
            },
            {
              "id": "weather",
              "displayName": "weather",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": false,
              "removed": false
            },
            {
              "id": "sleep_hours",
              "displayName": "sleep_hours",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": false
            },
            {
              "id": "activity",
              "displayName": "activity",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": false
            },
            {
              "id": "original_text",
              "displayName": "original_text",
              "required": true,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": false,
              "removed": false
            },
            {
              "id": "from",
              "displayName": "from",
              "required": true,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": false,
              "removed": false
            },
            {
              "id": "from_name",
              "displayName": "from_name",
              "required": true,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": false,
              "removed": false
            },
            {
              "id": "created_at",
              "displayName": "created_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "dateTime",
              "canBeUsedToMatch": false,
              "removed": true
            },
            {
              "id": "subject",
              "displayName": "subject",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": false,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.6,
      "position": [
        1040,
        160
      ],
      "id": "f96b22b1-6267-44fc-8ea3-b0faad22c7be",
      "name": "Insert Mood",
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "content": "## Content Violation Processing\n\nBlocks violating content and sends notification emails. We using [OpenAi Moderation](https://platform.openai.com/docs/guides/moderation)\n\n",
        "height": 400,
        "width": 440
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        160,
        -420
      ],
      "id": "5775bfd0-b413-4f21-8ccd-43dddd4e75a8",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "## Aura Agent\n\nThis is the part where we analyse the email and prepare the mood data",
        "height": 360,
        "width": 320
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        640,
        -100
      ],
      "id": "4d088d6e-638b-4879-967c-879032c25f8a",
      "name": "Sticky Note1"
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Classify Text For Violations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aura Agent": {
      "main": [
        [
          {
            "node": "Insert Mood",
            "type": "main",
            "index": 0
          },
          {
            "node": "Insert violations data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classify Text For Violations": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "Send Alerts",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Aura Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Alerts": {
      "main": [
        []
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "fc8ff747-8157-492e-b9f9-ca92c213223e",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "jCynVa9DbZDR8wnW",
  "tags": []
}

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

Inbox Insight. Uses openAi, emailSend, postgres. Webhook trigger; 9 nodes.

Source: https://github.com/maximebeaudoin/inboxinsights/blob/d148c5310f125801f9c0ce49afd4e202cb4d8873/n8n/Inbox_Insight.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

Pyragogy AI Village - Orchestrazione Master (Architettura Profonda V2). Uses start, postgres, openAi, emailSend. Webhook trigger; 37 nodes.

Start, Postgres, OpenAI +4
AI & RAG

Pyragogy AI Village - Orchestrazione Master (Architettura Profonda V2). Uses start, postgres, openAi, emailSend. Webhook trigger; 36 nodes.

Start, Postgres, OpenAI +4
AI & RAG

Pyragogy AI Village - Orchestrazione Master (Architettura Profonda V2). Uses start, postgres, openAi, emailSend. Webhook trigger; 35 nodes.

Start, Postgres, OpenAI +3
AI & RAG

My-Workflow-Jgvj7Vwvk7Wvsgvp. Uses start, postgres, openAi, emailSend. Webhook trigger; 35 nodes.

Start, Postgres, OpenAI +3
AI & RAG

Send-Outreach. Uses postgres, openAi, httpRequest, emailSend. Webhook trigger; 15 nodes.

Postgres, OpenAI, HTTP Request +1