AutomationFlowsAI & RAG › Notion AI Summary & Tags

Notion AI Summary & Tags

ByParnain @parnian on n8n.io

What This Workflow Does:

Event trigger★★★★☆ complexityAI-powered6 nodesNotion TriggerAgentOpenAI ChatHTTP RequestNotion
AI & RAG Trigger: Event Nodes: 6 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #4431 — we link there as the canonical source.

This workflow follows the Agent → HTTP Request 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": "Notion AI Summary",
  "tags": [],
  "nodes": [
    {
      "id": "aaaef809-2697-45fc-8c74-280705dbc881",
      "name": "Notion Trigger",
      "type": "n8n-nodes-base.notionTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "databaseId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_DATABASE_ID",
          "cachedResultUrl": "https://www.notion.so/YOUR_DATABASE_ID",
          "cachedResultName": "Content Database"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b30ce08a-37de-4ef4-ab3c-a495083c6b05",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        420,
        0
      ],
      "parameters": {
        "text": "=You are a helpful assistant.\nSummarize the following content in 3-5 sentences.\nThen suggest 3\u20136 concise tags (single-word or short phrases).\n{{ $json.data }}\n\nRespond as in valid markdown:\n**Summary**: <summary>\n**Tags**: tag1, tag2, ...\n\n",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "a426c93f-e835-43dc-a76b-c700102b2d94",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        420,
        220
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "af0c9fdb-4da3-4cf2-afd9-870ba19585bf",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        220,
        0
      ],
      "parameters": {
        "url": "={{ $json.URL }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "User-Agent",
              "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"
            },
            {
              "name": "Accept",
              "value": "text/html"
            },
            {
              "name": "Accept-Language",
              "value": "en-US,en;q=0.9"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "5ccfd70a-6294-4cff-8257-e50d0bd435f8",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        780,
        0
      ],
      "parameters": {
        "jsCode": "// Step 1: Get all items\nconst items = $input.all();\nconst result = [];\n\nfor (const item of items) {\n  const text = item.json.output;\n\n  const summaryMatch = text.match(/\\*\\*Summary\\*\\*:\\s*([\\s\\S]*?)\\s*\\*\\*Tags\\*\\*:/i);\n  const tagsMatch = text.match(/\\*\\*Tags\\*\\*:\\s*([^\\n\\r]*)/i);\n\n  if (!summaryMatch || !tagsMatch) {\n    throw new Error(\"Couldn't extract summary or tags from AI output\");\n  }\n\n  const summary = summaryMatch[1].trim();\n  const tagsStr = tagsMatch[1].trim();\n  const tags = tagsStr\n    .split(\",\")\n    .map(tag => tag.trim())\n    .filter(tag => tag.length > 0);\n\n  result.push({\n    json: {\n      aiSummary: summary,\n      tags: tags\n    }\n  });\n}\n\nreturn result;"
      },
      "typeVersion": 2
    },
    {
      "id": "8d9b5467-f59e-4121-9751-2182972cc9fe",
      "name": "Notion",
      "type": "n8n-nodes-base.notion",
      "position": [
        1000,
        0
      ],
      "parameters": {
        "pageId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Notion Trigger').item.json.id }}"
        },
        "simple": false,
        "options": {},
        "resource": "databasePage",
        "operation": "update",
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "AI summary|rich_text",
              "text": {
                "text": [
                  {
                    "text": "={{ $json.aiSummary }}",
                    "annotationUi": {}
                  }
                ]
              },
              "richText": true
            },
            {
              "key": "Tags|multi_select",
              "multiSelectValue": "={{ $json.tags }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    }
  ],
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "v1",
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "Notion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notion Trigger": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

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

About this workflow

What This Workflow Does:

Source: https://n8n.io/workflows/4431/ — 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 template helps you automate the initial screening of job candidates by analyzing resumes against your specific job descriptions using AI.

Notion, Notion Trigger, OpenAI Chat +2
AI & RAG

Thread Extraction: Automatically detects and extracts all tweets from a provided Twitter thread (flood) link. Translation: Translates each extracted tweet into your target language using OpenAI. Rewri

Agent, OpenAI Chat, HTTP Request +3
AI & RAG

This template is built for content creators, founders, solopreneurs, content marketers, and agencies who want to publish consistent, research-backed content across 4 social platforms without writing,

Notion, Agent, OpenAI Chat +6
AI & RAG

This n8n workflow demonstrates a simple multi-agent setup to perform the task of competitor research. It showcases how using the HTTP request tool could reduce the number of nodes needed to achieve a

OpenAI Chat, Tool Http Request, Output Parser Structured +3
AI & RAG

AI Blog Publisher – Automated Blog Content Workflow This workflow is designed for individuals and teams who regularly publish content on their blog and want to automate the entire process from start t

WordPress, HTTP Request, Memory Buffer Window +9