{
  "id": "ZkrcFjipfY6GNmFZ",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "AI Generated Zoom Summary",
  "tags": [
    {
      "id": "TOmp11D0RTZnlXKe",
      "name": "Creator Hub",
      "createdAt": "2025-07-27T06:39:31.509Z",
      "updatedAt": "2025-07-27T06:39:31.509Z"
    }
  ],
  "nodes": [
    {
      "id": "0d6d7996-0c0d-4968-906c-7164b26d998a",
      "name": "Markdown",
      "type": "n8n-nodes-base.markdown",
      "position": [
        -1040,
        -480
      ],
      "parameters": {
        "html": "={{ $json.html ||  $json.textAsHtml}}",
        "options": {
          "bulletMarker": "-",
          "keepDataImages": true
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4c5d9061-f24d-49a3-a3a1-98f3cd669228",
      "name": "Edit Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        -768,
        -480
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "bd32465b-c630-4406-8f65-1b3665d1c7cb",
              "name": "subject",
              "type": "string",
              "value": "={{ $json.subject }}"
            },
            {
              "id": "48dc379d-3089-4b2d-b32e-3a1fa7e4e60e",
              "name": "from",
              "type": "string",
              "value": "={{ $json.headers.from }}"
            },
            {
              "id": "3d83b302-6263-40a8-98d3-c0259437f443",
              "name": "date",
              "type": "string",
              "value": "={{ $json.date }}"
            },
            {
              "id": "61503c66-8aeb-4e40-800f-f6b06dbb75f0",
              "name": "metadata['received-spf']",
              "type": "string",
              "value": "={{ $json.headers['received-spf'] }}"
            },
            {
              "id": "4c9b52f9-9c86-4ece-87d6-60eaf33e5820",
              "name": "metadata['delivered-to']",
              "type": "string",
              "value": "={{ $json.headers['delivered-to'] }}"
            },
            {
              "id": "7713ec78-d86f-41c8-b8f5-797ec4e19112",
              "name": "metadata['authentication-results']",
              "type": "string",
              "value": "={{ $json.headers['arc-authentication-results'] }}"
            },
            {
              "id": "91e34aa7-e321-4140-bb05-c1a581913120",
              "name": "data",
              "type": "string",
              "value": "={{ $json.data || $json.textPlain}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c9461d9f-6273-41ab-ae19-a926eceb35d1",
      "name": "Generate Summary",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -128,
        -528
      ],
      "parameters": {
        "text": "={{ $json.data }}",
        "options": {
          "systemMessage": "=# Meeting Summarizer AI Agent - System Prompt\n\nYou are a professional meeting summarizer. You MUST follow this exact sequence:\n\n## EXECUTION SEQUENCE (MANDATORY)\n1. **FIRST**: Generate and output both formatted content blocks\n2. **SECOND**: Call the \"Send Email\" tool using the generated content\n\n## TASK\nProcess meeting transcript \u2192 Generate structured summary in 2 formats \u2192 Send email\n\n## CONTENT REQUIREMENTS\n\n### Required Sections (Extract from transcript):\n1. **Header**: Meeting title, date/time/timezone, duration, organizer, purpose\n2. **Attendees**: Names and roles  \n3. **Overview**: 5-10 sentence executive summary\n4. **Key Discussion Points**: Main topics discussed (bold any decisions)\n5. **Action Items**: Tasks with assignee, due date, priority\n6. **Things to Remember**: Important notes/follow-ups\n7. **Closing**: Brief wrap-up\n\n### Formatting Rules:\n- Use \"[Not Provided]\" for missing information\n- Bold all decisions and commitments\n- Keep professional, concise tone\n- Make content scannable\n\n## STEP 1: OUTPUT FORMATTED CONTENT\n\nYou MUST output both blocks in this exact format:\n\n```\n[EMAIL_HTML]\n<table style=\"width:100%;max-width:600px;margin:0 auto;font-family:Arial,Helvetica,sans-serif;color:#000000;background:#ffffff;border-collapse:collapse\">\n  <tr><td style=\"padding:20px\">\n    <h1 style=\"color:#0056b3;margin:0 0 10px 0\">{Meeting Title}</h1>\n    <p style=\"margin:0 0 5px 0\"><strong>Date:</strong> {Date} | <strong>Time:</strong> {Time} {Timezone}</p>\n    <p style=\"margin:0 0 5px 0\"><strong>Duration:</strong> {Duration} | <strong>Organizer:</strong> {Organizer}</p>\n    <p style=\"margin:0 0 20px 0\"><strong>Purpose:</strong> {Purpose}</p>\n    \n    <h2 style=\"color:#0056b3;margin:20px 0 10px 0\">Attendees</h2>\n    <table style=\"width:100%;border-collapse:collapse;margin:0 0 20px 0\">\n      <tr style=\"background:#f5f5f5\">\n        <td style=\"padding:8px;border:1px solid #ddd\"><strong>Name</strong></td>\n        <td style=\"padding:8px;border:1px solid #ddd\"><strong>Role</strong></td>\n      </tr>\n      <!-- Add attendee rows -->\n    </table>\n    \n    <h2 style=\"color:#0056b3;margin:20px 0 10px 0\">Overview</h2>\n    <p style=\"margin:0 0 20px 0\">{Overview content}</p>\n    \n    <h2 style=\"color:#0056b3;margin:20px 0 10px 0\">Key Discussion Points</h2>\n    <ul style=\"margin:0 0 20px 0;padding-left:20px\">\n      <!-- Add discussion points -->\n    </ul>\n    \n    <h2 style=\"color:#0056b3;margin:20px 0 10px 0\">Action Items</h2>\n    <ol style=\"margin:0 0 20px 0;padding-left:20px\">\n      <!-- Add action items -->\n    </ol>\n    \n    <h2 style=\"color:#0056b3;margin:20px 0 10px 0\">Things to Remember</h2>\n    <ul style=\"margin:0 0 20px 0;padding-left:20px\">\n      <!-- Add items to remember -->\n    </ul>\n    \n    <h2 style=\"color:#0056b3;margin:20px 0 10px 0\">Closing Note</h2>\n    <p style=\"margin:0\">{Closing statement}</p>\n  </td></tr>\n</table>\n[/EMAIL_HTML]\n\n[GOOGLE_DOCS_TEXT]\nMEETING TITLE: {Meeting Title}\nDATE: {Date} TIME: {Time} {Timezone} DURATION: {Duration}\nORGANIZER: {Organizer}\nPURPOSE: {Purpose}\n\nATTENDEES\n{Name} \u2014 {Role}\n{Name} \u2014 {Role}\n\nOVERVIEW\n{5-10 sentence executive summary}\n\nKEY DISCUSSION POINTS\n\u2022 {Discussion point}\n\u2022 {Discussion point with DECISION: decision made}\n\nACTION ITEMS\n1. {Task} \u2014 {Assignee} \u2014 Due: {Date} \u2014 Priority: {Priority}\n2. {Task} \u2014 {Assignee} \u2014 Due: {Date} \u2014 Priority: {Priority}\n\nTHINGS TO REMEMBER\n\u2022 {Important note}\n\u2022 {Follow-up item}\n\nCLOSING NOTE\n{Brief wrap-up statement}\n[/GOOGLE_DOCS_TEXT]\n```\n\n## STEP 2: SEND EMAIL TOOL\n\n**ONLY AFTER** outputting both content blocks above, call the \"Send Email\" tool with these parameters:\n\n- `to`: Extract emails from transcript or use \"[Not Provided]\"\n- `cc`: Optional additional recipients (default: \"\")\n- `subject`: \"Meeting Summary: {Meeting Title} \u2013 {YYYY-MM-DD}\"\n- `html_body`: The HTML content (everything between [EMAIL_HTML] markers, excluding the markers)\n- `text_body`: The plain text content (everything between [GOOGLE_DOCS_TEXT] markers, excluding the markers)\n\n## CRITICAL RULES\n\n1. **NEVER** call the \"Send Email\" tool before generating and outputting the formatted content blocks\n2. **ALWAYS** show both [EMAIL_HTML] and [GOOGLE_DOCS_TEXT] blocks to the user first\n3. **THEN** call the tool using the exact content from those blocks\n4. Fill in actual content from the meeting transcript - do not leave placeholder text\n5. If information is missing, use \"[Not Provided]\" but still generate complete summaries\n\n## ERROR PREVENTION\n\n- If transcript is unclear: Extract what you can and note \"[Not Provided]\" for missing items\n- If no attendees found: Create single row with \"[Not Provided]\" in both columns  \n- If no action items: Write \"No specific action items were identified in this meeting\"\n- Always generate complete HTML and text versions before calling the email tool"
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "9a5f39c8-b9d2-40ca-8f1f-7677ac674c26",
      "name": "Update a document",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        -480,
        96
      ],
      "parameters": {
        "actionsUi": {
          "actionFields": [
            {
              "text": "={{ $('DocFormat').item.json.message.content.content }}",
              "action": "insert"
            }
          ]
        },
        "operation": "update",
        "documentURL": "={{ $json.id }}"
      },
      "credentials": {
        "googleDocsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "91e2b358-de19-435b-a5a8-2b26a103c17e",
      "name": "Create a document",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        -784,
        96
      ],
      "parameters": {
        "title": "={{ $json.message.content.title }}",
        "folderId": "default"
      },
      "credentials": {
        "googleDocsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "89436018-84e6-4682-8ac0-894e5cffb59c",
      "name": "DocFormat",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -1184,
        -64
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "GPT-4.1"
        },
        "options": {
          "topP": 1,
          "temperature": 0.3
        },
        "messages": {
          "values": [
            {
              "content": "={{ $json.data }}"
            },
            {
              "role": "=system",
              "content": "=You are a formatting specialist AI agent. You will transform Markdown input from {{ $json.data }} into valid JSON for creating a Google Doc\u2013ready plain\u2011text document.\n\n## TASKS\n1. Extract the Subject value from the input.\n2. Sanitize the Subject to create a safe filename (the JSON \"title\").\n3. Convert the remaining content into a clean, Google Docs\u2013friendly plain\u2011text layout (the JSON \"content\").\n4. Output a JSON object with exactly two keys in this order: \"title\", \"content\".\n\n## OUTPUT CONSTRAINTS\n- Output ONLY a single JSON object. No code fences, no comments, no extra keys, no trailing commas.\n- JSON must be valid UTF\u20118, with proper escaping for quotes (\\\") and backslashes (\\\\).\n- Use \\n for line breaks inside the \"content\" string. Do not include literal unescaped newlines.\n\n## SUBJECT EXTRACTION\n- Primary: If a line matches /^Subject\\s*:\\s*(.+)\\s*$/i, use the captured value.\n- Secondary: If no Subject line, use the first level\u20111 heading (e.g., a line starting with \"# \").\n- Tertiary: If neither exists, use the first non\u2011empty line truncated to 80 characters.\n- Fallback: If no suitable text, use \"Meeting_Notes\".\n\n## TITLE SANITIZATION (\"title\")\n- Trim leading/trailing whitespace.\n- Replace spaces with underscores.\n- Remove or replace these characters with underscore: / \\ : * ? \" < > | # % { } $ ! ' @ + ` = ^ ~ [ ] ( ) ; , .\n- Collapse multiple underscores to a single underscore.\n- Limit to 120 characters; trim from the end if longer.\n- Preserve alphanumerics and Unicode letters/numbers where safe; normalize to NFC.\n- If empty after sanitization, use \"Meeting_Notes\".\n\n## CONTENT FORMAT (\"content\")\nProduce plain text only (no Markdown), using this exact structure and headings. Use a single blank line between sections and no trailing spaces. Use \"- \" as the bullet prefix. Replace missing fields with [Not Provided].\n\nMeeting Notes\n=============\n\nSubject: [Subject]\nMeeting Date: [Meeting Date]\nTime: [Time]\nDuration: [Duration]\n\nRoles\n-----\nOrganizer: [Organizer]\nAttendees: [Attendees]\n\nOverview\n--------\n[One to three sentences.]\n\nKey Discussion Points\n---------------------\n- [Point 1]\n- [Point 2]\n- [Point 3]\n\nAction Items / Follow-Ups\n-------------------------\n- Task: [Task]\n  Assignee: [Assignee]\n  Due: [Due Date]\n  Priority: [Priority]\n\nThings to Remember\n------------------\n- [Reminder 1]\n- [Reminder 2]\n\nClosing Note\n------------\n[Short closing sentence inviting review/follow-up.]\n\n## CONVERSION RULES\n- Replace all placeholders with extracted values; if a value is missing, insert [Not Provided].\n- Remove all Markdown syntax from the input (e.g., #, ##, **, *, _, >, inline code, tables).\n- Lists: convert any list style (*, -, 1.) to \"- \" bullets in the final output.\n- Emphasis: drop bold/italic styling; retain words as plain text (no Markdown markers).\n- Tables: convert to bullet blocks using \"Field: Value\" pairs per row; do not attempt column alignment.\n- Normalize whitespace: collapse multiple spaces to single spaces within lines; preserve intended paragraph breaks.\n- Do not include invisible control characters or non\u2011breaking spaces.\n\n## EDGE CASES\n- Malformed or partial Markdown: best\u2011effort parsing; prioritize content extraction over styling.\n- Oversized content: keep all content; do not truncate, but maintain formatting rules.\n- Email addresses, URLs, and IDs: keep as plain text.\n- Ensure there are no dangling or duplicate section headers; include empty sections with [Not Provided] where needed.\n\n## VALIDATION\n- Ensure the final output is valid JSON and contains both keys: \"title\" (string) and \"content\" (string).\n- No additional keys, arrays, or objects.\n- No code fences or explanatory text before or after the JSON object.\n"
            }
          ]
        },
        "jsonOutput": true
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "57e18985-bb3a-4182-98e0-2bb3afa53ae4",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -112,
        -64
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "6a57c8ce-dc50-403c-a182-0fb644cf1404",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1840,
        -720
      ],
      "parameters": {
        "width": 672,
        "height": 512,
        "content": "## \ud83d\udce7 **EMAIL TRIGGER (GMAIL) - Entry Point**\n**What it does:**\n- Monitors your email inbox for new Zoom meeting summaries\n - Check for subject: 'Meeting assets', 'Zoom', 'Meeting Assets'\n- You may add a Trigger for Sender: no-reply@zoom.us"
      },
      "typeVersion": 1
    },
    {
      "id": "c53117a0-979c-4368-b99b-239cced75185",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        -720
      ],
      "parameters": {
        "width": 624,
        "height": 416,
        "content": "## \ud83d\udcdd **MARKDOWN CONVERTER - Content Processing**\n**Configuration:**\n- Converts HTML content to markdown format\n- Uses \"-\" as bullet markers\n- Preserves data images\n- Makes content easier to process by AI"
      },
      "typeVersion": 1
    },
    {
      "id": "c1c573e8-e270-4f21-ae50-aeb77a809dae",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        -768
      ],
      "parameters": {
        "width": 672,
        "height": 560,
        "content": "## \ud83e\udd16 **GENERATE SUMMARY - AI Processing Hub**\n\n**AI Instructions:**\n- Creates EMAIL-SAFE HTML for email clients\n- Generates Google Docs compatible text\n- Professional formatting with proper structure\n- Includes: Header, Attendees, Overview, Discussion Points, Action Items\n\n**\ud83d\udd17 Connected Tools:**\n- **Send Email Tool** (via AI tool connection)\n- **GPT-4.1 Language Model** (for processing)"
      },
      "typeVersion": 1
    },
    {
      "id": "d6737471-a63d-4349-9067-95aa7346b550",
      "name": "Apply Formatting",
      "type": "n8n-nodes-base.markdown",
      "position": [
        240,
        -352
      ],
      "parameters": {
        "html": "={{ $json.output }}",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "8cefd430-13d2-4744-a3af-e1f6207577df",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1504,
        -144
      ],
      "parameters": {
        "width": 592,
        "height": 400,
        "content": "## \ud83d\udcc4 **DOCFORMAT - Google Docs Preparation**\n\n**Process:**\n1. Extracts subject for document title\n2. Sanitizes title for filename safety\n3. Formats content for Google Docs\n4. Returns JSON with title and content\n\n**Output Structure:**\n```json\n{\n  \"title\": \"Sanitized_Meeting_Title\",\n  \"content\": \"Google Docs formatted text...\"\n}\n```"
      },
      "typeVersion": 1
    },
    {
      "id": "d0734d45-4754-432f-b15a-8215f2714bc3",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        -144
      ],
      "parameters": {
        "width": 640,
        "height": 432,
        "content": "## \ud83d\udcc1 **CREATE A DOCUMENT - Google Docs Integration**\n\n**Configuration:**\n- Uses title from DocFormat output\n- Creates in default folder. Change this to specific folder name.\n- Authenticated with Google Docs OAuth2\n\n**\ud83d\udd17 Flow:** DocFormat \u2192 Create Document \u2192 Update Document"
      },
      "typeVersion": 1
    },
    {
      "id": "27352f49-fb07-4e53-be73-b463480f90cd",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -1792,
        -528
      ],
      "parameters": {
        "simple": false,
        "filters": {
          "q": "subject: 'Meeting assets', 'Zoom', 'Meeting Assets'",
          "readStatus": "unread"
        },
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "1fb05ae4-9ea8-4d81-8e3f-a3148979eecb",
      "name": "Mark a message as read",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -1584,
        -384
      ],
      "parameters": {
        "messageId": "={{ $json.id }}",
        "operation": "markAsRead"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "4b126e38-bb28-47d3-8a80-3e8b7d004a96",
      "name": "No Operation, do nothing1",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -1360,
        -384
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c8852068-3b60-4780-b08b-5e6506babd93",
      "name": "gpt-4O",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -416,
        -352
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {
          "topP": 1,
          "temperature": 0.3,
          "frequencyPenalty": 0
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "737f1067-5bf5-4113-af7a-9cc1ae6d1705",
      "name": "Send Email",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        -128,
        -336
      ],
      "parameters": {
        "sendTo": "={{ $('Gmail Trigger').item.json.headers.to }}",
        "message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', ``, 'string') }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Subject', ``, 'string') }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "99cbaa6c-4395-4239-9fed-ecb1fe5030cc",
  "connections": {
    "gpt-4O": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Summary",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Markdown": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DocFormat": {
      "main": [
        [
          {
            "node": "Create a document",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email": {
      "ai_tool": [
        [
          {
            "node": "Generate Summary",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "Generate Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "Markdown",
            "type": "main",
            "index": 0
          },
          {
            "node": "Mark a message as read",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Apply Formatting": {
      "main": [
        [
          {
            "node": "DocFormat",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Summary": {
      "main": [
        [
          {
            "node": "Apply Formatting",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a document": {
      "main": [
        [
          {
            "node": "Update a document",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update a document": {
      "main": [
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark a message as read": {
      "main": [
        [
          {
            "node": "No Operation, do nothing1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}