{
  "name": "04 Summarize incoming email",
  "nodes": [
    {
      "id": "825a6d02-7277-4808-a62d-eb8782479b9d",
      "name": "New email",
      "type": "n8n-nodes-base.emailReadImap",
      "typeVersion": 2,
      "position": [
        0,
        300
      ],
      "parameters": {
        "mailbox": "INBOX",
        "postProcessAction": "read",
        "format": "simple",
        "options": {}
      }
    },
    {
      "id": "6bc4bbbb-123a-45f3-a80b-ecaf433a2b48",
      "name": "Summarize",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.5,
      "position": [
        240,
        300
      ],
      "parameters": {
        "promptType": "define",
        "text": "=From: {{ $json.from }}\nSubject: {{ $json.subject }}\n\n{{ ($json.textPlain || '').slice(0, 4000) }}",
        "messages": {
          "messageValues": [
            {
              "message": "You summarize business emails for a busy business owner. Write in English, exactly two lines:\nGist: <what the sender wants, in one sentence>\nAction: <what the owner needs to do, or 'none'>\nDo not make up anything that is not in the email."
            }
          ]
        }
      },
      "notes": "AI: reads free text. Becomes a rule once it turns out to be the same kind of email every time.",
      "notesInFlow": true
    },
    {
      "id": "52f2bce3-f638-4fa9-8fdf-bfa873120664",
      "name": "Chat model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOllama",
      "typeVersion": 1,
      "position": [
        480,
        520
      ],
      "parameters": {
        "model": "qwen2.5:7b",
        "options": {
          "temperature": 0.2
        }
      }
    },
    {
      "id": "4751d371-fd53-4476-875c-2a0d950330af",
      "name": "Summary to owner",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        480,
        300
      ],
      "parameters": {
        "fromEmail": "info@example.com",
        "toEmail": "you@example.com",
        "subject": "=Summary: {{ $('New email').item.json.subject }}",
        "emailFormat": "text",
        "text": "={{ $json.text }}\n\nFrom: {{ $('New email').item.json.from }}",
        "options": {
          "appendAttribution": false
        }
      }
    },
    {
      "id": "5c7e7ce0-250c-4fd1-8407-96dc9c5d8ddb",
      "name": "Read me",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -40,
        -160
      ],
      "parameters": {
        "content": "## Summarize incoming email\nTested on November 11, 2026, with n8n 2.47.3. Model: qwen2.5:7b via Ollama.\n\n**Fill in:** IMAP and SMTP accounts, your own address, and a chat model. If you don't run a local model, swap 'Chat model' for your provider's chat model node.",
        "height": 220,
        "width": 520,
        "color": 7
      }
    }
  ],
  "connections": {
    "New email": {
      "main": [
        [
          {
            "node": "Summarize",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize": {
      "main": [
        [
          {
            "node": "Summary to owner",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Chat model": {
      "ai_languageModel": [
        [
          {
            "node": "Summarize",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  }
}