{
  "id": "bRHtBcsehqMzUZoq",
  "name": "Audio Email to Japanese Transcript with AI Summary and Multi-Channel Notification",
  "tags": [],
  "nodes": [
    {
      "id": "a8b66045-a245-4587-9836-7d048d7f0452",
      "name": "New Gmail with Audio",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -1104,
        592
      ],
      "parameters": {
        "simple": false,
        "filters": {
          "labelIds": []
        },
        "options": {
          "downloadAttachments": true
        },
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "82255a69-6d1d-4c77-a148-e80a8c5810b5",
      "name": "Generate Year-Month Folder Path",
      "type": "n8n-nodes-base.code",
      "position": [
        -432,
        592
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const now = new Date();\nconst year = now.getFullYear();\nconst month = String(now.getMonth() + 1).padStart(2, '0');\n\n// \u30d5\u30a9\u30eb\u30c0\u30d1\u30b9\u3092\u4f5c\u6210\nconst folderPath = `${year}/${month}`;\n\nreturn {\n  json: {\n    folderPath: folderPath,\n    year: year,\n    month: month,\n    // \u5143\u306eJSON\u30c7\u30fc\u30bf\uff08\u30d5\u30a1\u30a4\u30eb\u540d\u306a\u3069\uff09\u3082\u5f15\u304d\u7d99\u3050\n    ...item.json\n  },\n  // \u2605\u3053\u3053\u304c\u91cd\u8981\uff01\u5143\u306e\u97f3\u58f0\u30d5\u30a1\u30a4\u30eb\uff08Binary\uff09\u3092\u6b21\u306e\u30ce\u30fc\u30c9\u306b\u6e21\u3059\n  binary: item.binary\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "5ee3567c-a908-41c8-86a3-b4b6dd03a383",
      "name": "Create Folder If Not Exists",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -208,
        512
      ],
      "parameters": {
        "name": "={{ $json.folderPath }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {
          "folderColorRgb": "",
          "simplifyOutput": true
        },
        "folderId": {
          "__rl": true,
          "mode": "id",
          "value": "1WpgifJYwIeD1Uc4j-DxnBM6V-0E0HB_O"
        },
        "resource": "folder"
      },
      "typeVersion": 3
    },
    {
      "id": "1a323e7c-1233-4e5c-b13c-ec1e4f876a19",
      "name": "Upload Audio to Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        256,
        688
      ],
      "parameters": {
        "name": "={{ $('Merge').item.json.fileExtension }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Merge').item.json.id }}"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "d6f27f9e-bba7-459d-b238-6a1009eb3b99",
      "name": "Generate AI Summary",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        480,
        400
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-4o"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "={{ 'Analyze the following Japanese transcript and generate a JSON summary with the following fields: title (brief title), points (key discussion points as array), decisions (decisions made as array), actionItems (action items with owner and deadline as array). Transcript: ' + $json.data }}\n\nIMPORTANT: Please output all values (title, points, decisions, actionItems) in Japanese."
            }
          ]
        },
        "jsonOutput": true
      },
      "typeVersion": 1.8
    },
    {
      "id": "1f851f78-814e-4cab-a925-b62e4a4e1fe9",
      "name": "Convert Transcript to TXT",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        1056,
        592
      ],
      "parameters": {
        "options": {
          "fileName": "={{ $('Merge').item.json.fileName }}.txt"
        },
        "operation": "toText",
        "sourceProperty": "data"
      },
      "typeVersion": 1.1
    },
    {
      "id": "0c1464c3-f7bb-4f8b-a07e-825d5d1d4b74",
      "name": "Convert Summary to MD",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        1056,
        400
      ],
      "parameters": {
        "options": {
          "fileName": "={{ $('Merge').first().json.fileName }}_summary.md"
        },
        "operation": "toText",
        "sourceProperty": "summaryContent",
        "binaryPropertyName": "=data"
      },
      "typeVersion": 1.1
    },
    {
      "id": "34cecdd4-8dab-4a15-9007-7c6a466fcc12",
      "name": "Upload Transcript to Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1280,
        592
      ],
      "parameters": {
        "name": "={{ $binary.data.fileName }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create Folder If Not Exists').item.json.id }}"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "12f404d8-34da-43cd-a7a2-b02c13e30141",
      "name": "Upload Summary to Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1280,
        400
      ],
      "parameters": {
        "name": "={{ $binary.data.fileName }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create Folder If Not Exists').item.json.id }}"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "95892354-7afd-4212-a9ff-b5dc920022c0",
      "name": "Share Transcript File",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1504,
        592
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Upload Transcript to Drive').item.json.id }}"
        },
        "options": {},
        "operation": "share",
        "permissionsUi": {
          "permissionsValues": {
            "role": "reader",
            "type": "user",
            "emailAddress": "={{ $json.owners[0].emailAddress }}"
          }
        }
      },
      "typeVersion": 3
    },
    {
      "id": "3b2c45eb-bb29-47bb-83d0-d531045249dd",
      "name": "Share Summary File",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1504,
        400
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Upload Summary to Drive').item.json.id }}"
        },
        "options": {},
        "operation": "share",
        "permissionsUi": {
          "permissionsValues": {
            "role": "reader",
            "type": "user",
            "emailAddress": "={{ $json.lastModifyingUser.emailAddress }}"
          }
        }
      },
      "typeVersion": 3
    },
    {
      "id": "8acd4fa0-0117-48f5-9b69-ab4c8bfd4dc0",
      "name": "Prepare Sheets Data",
      "type": "n8n-nodes-base.code",
      "position": [
        1728,
        496
      ],
      "parameters": {
        "jsCode": "// \u25a0\u5404\u30ce\u30fc\u30c9\u306e\u540d\u524d\u5b9a\u7fa9\nconst NODE_MERGE = 'Merge';\nconst NODE_FORMATTED = 'Edit Fields';          // \u2605\u3053\u3053\u304b\u3089\u6574\u5f62\u6e08\u307f\u8981\u7d04\u3092\u53d6\u308a\u307e\u3059\nconst NODE_AI_RAW = 'Generate AI Summary';     // \u4e88\u5099\uff1aAI\u306e\u751f\u30c7\u30fc\u30bf\nconst NODE_TRANSCRIPT = 'HTTP Request';\nconst NODE_LINK_T = 'Share Transcript File';\nconst NODE_LINK_S = 'Share Summary File';\n\n// 1. \u30d5\u30a1\u30a4\u30eb\u540d\u3068\u4ef6\u540d\u306e\u53d6\u5f97\nlet fileName = 'unknown.mp3';\nlet subject = 'No Subject';\ntry {\n  const mergeData = $(NODE_MERGE).first().json;\n  if (mergeData.fileName) fileName = mergeData.fileName;\n  if (mergeData.emailSubject) subject = mergeData.emailSubject;\n  else if (mergeData.subject) subject = mergeData.subject;\n} catch(e) {}\n\n// 2. \u6587\u5b57\u8d77\u3053\u3057\u306e\u53d6\u5f97\nlet fullTranscript = '';\ntry {\n    const tData = $(NODE_TRANSCRIPT).first().json;\n    if (tData.data) fullTranscript = tData.data;\n    else if (tData.text) fullTranscript = tData.text;\n    else fullTranscript = '\uff08\u30c7\u30fc\u30bf\u306a\u3057\uff09';\n} catch (e) { fullTranscript = '\uff08\u53d6\u5f97\u5931\u6557\uff09'; }\n\n// 3. \u30b5\u30de\u30ea\u30fc\u306e\u53d6\u5f97\uff08\u4fee\u6b63\u30dd\u30a4\u30f3\u30c8\uff09\nlet cleanSummary = '';\n\n// A\u30d7\u30e9\u30f3: \u300cEdit Fields\u300d\u30ce\u30fc\u30c9\u306b\u3042\u308b\u6574\u5f62\u6e08\u307f\u30c6\u30ad\u30b9\u30c8(summaryContent)\u3092\u53d6\u5f97\ntry {\n  const fmtData = $(NODE_FORMATTED).first().json;\n  if (fmtData.summaryContent) {\n    cleanSummary = fmtData.summaryContent;\n  }\n} catch (e) {\n  // Edit Fields\u304c\u307e\u3060\u5b9f\u884c\u3055\u308c\u3066\u3044\u306a\u3044\u7b49\u306e\u5834\u5408\n}\n\n// B\u30d7\u30e9\u30f3: \u3082\u3057A\u304c\u30c0\u30e1\u306a\u3089\u3001\u300cGenerate AI Summary\u300d\u304b\u3089\u751f\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\nif (!cleanSummary) {\n  try {\n    const aiData = $(NODE_AI_RAW).first().json;\n    // OpenAI\u30ce\u30fc\u30c9\u306e\u51fa\u529b\u306f message.content \u306b\u5165\u3063\u3066\u3044\u307e\u3059\n    const content = aiData.message ? aiData.message.content : aiData.summary;\n    \n    if (content) {\n      if (typeof content === 'string') cleanSummary = content;\n      else cleanSummary = JSON.stringify(content, null, 2); // \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306a\u3089\u6587\u5b57\u5316\n    }\n  } catch (e) {}\n}\n\nif (!cleanSummary) cleanSummary = '\uff08\u30b5\u30de\u30ea\u30fc\u53d6\u5f97\u5931\u6557\uff09';\n\n// 4. \u5171\u6709\u30ea\u30f3\u30af\u306e\u53d6\u5f97\nlet linkT = '';\nlet linkS = '';\n// 60\u884c\u76ee\u4ed8\u8fd1\uff1a\u30c8\u30e9\u30f3\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u30ea\u30f3\u30af\u53d6\u5f97\ntry { \n    // Upload\u30ce\u30fc\u30c9\u306e\u540d\u524d\u3092\u6b63\u78ba\u306b\u6307\u5b9a\u3057\u307e\u3059\n    linkT = $('Upload Transcript to Drive').first().json.webViewLink; \n} catch(e) { \n    linkT = \"\"; \n}\n\n// 61\u884c\u76ee\u4ed8\u8fd1\uff1a\u30b5\u30de\u30ea\u30fc\u306e\u30ea\u30f3\u30af\u53d6\u5f97\ntry { \n    // Upload\u30ce\u30fc\u30c9\u306e\u540d\u524d\u3092\u6b63\u78ba\u306b\u6307\u5b9a\u3057\u307e\u3059\n    linkS = $('Upload Summary to Drive').first().json.webViewLink; \n} catch(e) { \n    linkS = \"\"; \n}\n\n// 5. \u51fa\u529b\nreturn {\n  json: {\n    timestamp: new Date().toISOString(),\n    emailSubject: subject,\n    fileName: fileName,\n    summary: cleanSummary,\n    transcript: fullTranscript,\n    summaryLink: linkS,\n    transcriptLink: linkT\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "0c512265-94a2-423d-b5e6-c1712880e6a9",
      "name": "Log to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1952,
        496
      ],
      "parameters": {
        "columns": {
          "value": {
            "Links": "={{ $json.summaryLink }}",
            "Subject\r\n": "={{ $json.emailSubject }}",
            "Summary\r\n": "={{ $json.summary }}",
            "Transcrip": "={{ $json.transcript }}",
            "File Name\r\n": "={{ $json.fileName }}",
            "Timestamp\r\n": "={{ $json.timestamp }}"
          },
          "schema": [
            {
              "id": "Timestamp\r\n",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Timestamp\r\n",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Subject\r\n",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Subject\r\n",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "File Name\r\n",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "File Name\r\n",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Summary\r\n",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Summary\r\n",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Links",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Transcrip",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Transcrip",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "\u30b7\u30fc\u30c81"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1DZF15hsHZ1xEo1eaxKxL1lNuvQzv4XKApOHXUR4FvBY",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1DZF15hsHZ1xEo1eaxKxL1lNuvQzv4XKApOHXUR4FvBY/edit?usp=drivesdk",
          "cachedResultName": "n8n\uff12"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "5152433d-a660-44d8-b153-0ce2ac5e72d8",
      "name": "Send Gmail Notification",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2176,
        400
      ],
      "parameters": {
        "sendTo": "={{ $('New Gmail with Audio').item.json.from.value[0].address }}",
        "message": "=<h2>Meeting Summary</h2>\n<p><strong>Subject:</strong> {{ $json.Subject }}</p>\n<p><strong>Summary:</strong><br>\n{{ $json.Summary.replace(/\\n/g, '<br>') }}\n</p>\n<p><strong>Links:</strong><br>\n{{ $json.Links }}\n</p>",
        "options": {
          "appendAttribution": false
        },
        "subject": "n8n"
      },
      "typeVersion": 2.1
    },
    {
      "id": "f3e93230-9d13-44d3-90c0-299c75ab0a1d",
      "name": "Send Slack Notification",
      "type": "n8n-nodes-base.slack",
      "position": [
        2176,
        592
      ],
      "parameters": {
        "text": "=*New Audio Transcription Complete*\n\n*Subject:* {{ $json.Subject }}\n*File Name:* {{ $json['File Name'] }}\n\n*Summary:*\n{{ $json.Summary }}\n\n*Links:*\n{{ $json.Links }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C0A3GEB36SJ",
          "cachedResultName": "all-n8n"
        },
        "otherOptions": {
          "includeLinkToWorkflow": true
        },
        "authentication": "oAuth2"
      },
      "typeVersion": 2.3
    },
    {
      "id": "3f78237a-898e-4490-a434-b6831566fa2e",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "position": [
        -880,
        592
      ],
      "parameters": {
        "jsCode": "// \u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u30921\u3064\u305a\u3064\u306e\u30a2\u30a4\u30c6\u30e0\u306b\u5206\u5272\u3057\u3001\n// \u30d0\u30a4\u30ca\u30ea\u30c7\u30fc\u30bf\u306e\u30ad\u30fc\u3092\u6a19\u6e96\u306e \"data\" \u306b\u7d71\u4e00\u3059\u308b\u30b3\u30fc\u30c9\n\nconst newItems = [];\n\nfor (const item of items) {\n  // \u30d0\u30a4\u30ca\u30ea\u30c7\u30fc\u30bf\uff08\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\uff09\u304c\u3042\u308b\u5834\u5408\u306e\u307f\u51e6\u7406\n  if (item.binary) {\n    // attachment_0, attachment_1 \u306a\u3069\u306e\u30ad\u30fc\u3092\u3059\u3079\u3066\u30eb\u30fc\u30d7\u51e6\u7406\n    for (const key of Object.keys(item.binary)) {\n      newItems.push({\n        json: {\n          // \u30d5\u30a3\u30eb\u30bf\u7528\u306b\u30d5\u30a1\u30a4\u30eb\u540d\u3084\u62e1\u5f35\u5b50\u3092JSON\u60c5\u5831\u3068\u3057\u3066\u53d6\u308a\u51fa\u3057\u3066\u304a\u304f\n          fileName: item.binary[key].fileName,\n          fileExtension: item.binary[key].fileExtension,\n          mimeType: item.binary[key].mimeType,\n          originalSubject: item.json.subject || \"No Subject\" // \u5143\u306e\u4ef6\u540d\u3082\u5f15\u304d\u7d99\u3050\n        },\n        binary: {\n          // n8n\u306e\u6a19\u6e96\u7684\u306a\u51e6\u7406\u306b\u5408\u308f\u305b\u3001\u30ad\u30fc\u540d\u3092 \"data\" \u306b\u7d71\u4e00\u3059\u308b\n          data: item.binary[key]\n        }\n      });\n    }\n  }\n}\n\nreturn newItems;"
      },
      "typeVersion": 2
    },
    {
      "id": "0c62eafa-d01c-481e-95e1-00116b1a7396",
      "name": "Filter",
      "type": "n8n-nodes-base.filter",
      "position": [
        -656,
        592
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "cbf07c46-fc45-40e5-b76f-fbee74dd978e",
              "operator": {
                "type": "string",
                "operation": "regex"
              },
              "leftValue": "={{ $json.fileExtension }}",
              "rightValue": "=mp3|wav|m4a|ogg"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "a2882507-4f5d-4e4c-8e21-e8c7141ad861",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        16,
        592
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2
    },
    {
      "id": "b6ba6813-b8bd-47c5-9583-2ebeec621ba7",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        832,
        400
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "4f070d63-ec97-4cf4-9f78-8151670fa9a9",
              "name": "summaryContent",
              "type": "string",
              "value": "=# {{ $json.message.content.title }}\n\n## \u8981\u70b9\n- {{ $json.message.content.points ? $json.message.content.points.join('\\n- ') : '\u306a\u3057' }}\n\n## \u6c7a\u5b9a\u4e8b\u9805\n- {{ $json.message.content.decisions ? $json.message.content.decisions.join('\\n- ') : '\u306a\u3057' }}\n\n## \u30a2\u30af\u30b7\u30e7\u30f3\u30a2\u30a4\u30c6\u30e0\n- {{ $json.message.content.actionItems ? $json.message.content.actionItems.join('\\n- ') : '\u306a\u3057' }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "11849b69-5dba-43b7-9714-470b4fb70d90",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        256,
        496
      ],
      "parameters": {
        "url": "https://api.openai.com/v1/audio/transcriptions",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "file",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            },
            {
              "name": "model",
              "value": "gpt-4o-transcribe"
            },
            {
              "name": "prompt",
              "value": "\u65e5\u672c\u8a9e\u3067\u9010\u8a9e\u7684\u306b\u6587\u5b57\u8d77\u3053\u3057\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u8981\u7d04\u3057\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002\u63a8\u6e2c\u3067\u88dc\u5b8c\u3057\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002"
            },
            {
              "name": "temperature",
              "value": "0"
            },
            {
              "name": "language",
              "value": "ja"
            },
            {
              "name": "response_format",
              "value": "text"
            }
          ]
        },
        "nodeCredentialType": "httpBearerAuth"
      },
      "typeVersion": 4.2
    },
    {
      "id": "6a6a42d1-ea8d-40ba-9b25-959b1609cfcb",
      "name": "Template Overview (read me)",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1456,
        -480
      ],
      "parameters": {
        "color": 5,
        "width": 1200,
        "height": 880,
        "content": "## Overview\n\nThis template watches your Gmail inbox for emails with audio attachments, transcribes the audio in **Japanese**, generates an **AI meeting-style summary** (JSON + Markdown), saves everything to **Google Drive**, logs the result to **Google Sheets**, then notifies via **Gmail** and **Slack**.\n\n## Who\u2019s it for\n\n- People who receive voice notes / meeting recordings by email\n- Teams that want fast Japanese transcripts + structured action items\n- Anyone who wants an automatic archive + searchable log\n\n## How it works\n\n1. Trigger on new Gmail with attachments\n2. Split attachments into items and keep only audio files\n3. Create a `YYYY/MM` folder in Drive (if missing) and upload the audio\n4. Transcribe audio with OpenAI (Japanese, verbatim)\n5. Summarize the transcript into JSON and format it as Markdown\n6. Upload transcript + summary files to Drive and generate share links\n7. Append a row to Google Sheets\n8. Send notifications (Gmail + Slack)\n\n## How to set up\n\n- Add your credentials in: **Gmail**, **Google Drive**, **Google Sheets**, **Slack**, and **OpenAI**\n- Update the Drive parent folder and the Sheets document if needed\n\n## Requirements\n\n- Gmail account with access to the inbox you want to monitor\n- Google Drive + Google Sheets access\n- Slack workspace + target channel\n- OpenAI API access (transcription + chat summary)"
      },
      "typeVersion": 1
    },
    {
      "id": "1b6161bf-1da9-4a8c-a0e3-5b605103cb3b",
      "name": "Step 1 - Intake",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1232,
        816
      ],
      "parameters": {
        "width": 620,
        "height": 360,
        "content": "## 1) Gmail intake + attachment prep\n\n**Nodes**\n- **New Gmail with Audio**: polls Gmail and downloads attachments\n- **Code in JavaScript**: splits emails into one item per attachment and normalizes binary to `binary.data`\n- **Filter**: keeps only audio files (`mp3|wav|m4a|ogg`)\n\n**Customize**\n- Extend supported formats by editing the regex in **Filter**\n- If you want \u201cspecific sender only\u201d, add a Gmail filter in **New Gmail with Audio**"
      },
      "typeVersion": 1
    },
    {
      "id": "5491f4b8-3dba-48fe-92cd-2c71b07a8f12",
      "name": "Step 2 - Drive storage",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -336,
        896
      ],
      "parameters": {
        "width": 980,
        "height": 388,
        "content": "## 2) Drive folder + upload original audio\n\n**Nodes**\n- **Generate Year-Month Folder Path**: builds `YYYY/MM` from the current date and passes binary forward\n- **Create Folder If Not Exists**: creates the month folder under your chosen Drive parent folder\n- **Merge**: combines \u201cfolder info\u201d + \u201cfile info\u201d\n- **Upload Audio to Drive**: uploads the original audio into the created folder\n\n**Customize**\n- Change the folder structure inside **Generate Year-Month Folder Path** (e.g., `YYYY/MM/DD`)"
      },
      "typeVersion": 1
    },
    {
      "id": "ef783f26-ca1f-4262-9210-e16a8b463c8a",
      "name": "Step 3 - AI transcription & summary",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        -16
      ],
      "parameters": {
        "width": 980,
        "height": 336,
        "content": "## 3) Transcribe + summarize with AI\n\n**Nodes**\n- **HTTP Request**: calls OpenAI Audio Transcriptions API (`gpt-4o-transcribe`) and returns plain text (Japanese, no summarization)\n- **Generate AI Summary**: turns the transcript into a structured JSON summary (title / points / decisions / actionItems)\n- **Edit Fields**: formats the JSON summary into a readable Markdown document (`summaryContent`)\n\n**Customize**\n- Adjust the transcription prompt in **HTTP Request**\n- Adjust summary structure / wording in **Generate AI Summary** and **Edit Fields**"
      },
      "typeVersion": 1
    },
    {
      "id": "efd61853-4625-41c7-943a-a480938d9218",
      "name": "Step 4 - Save & share files",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        896,
        800
      ],
      "parameters": {
        "width": 920,
        "height": 324,
        "content": "## 4) Save transcript + summary files to Drive (and share)\n\n**Nodes**\n- **Convert Transcript to TXT** \u2192 **Upload Transcript to Drive** \u2192 **Share Transcript File**\n- **Convert Summary to MD** \u2192 **Upload Summary to Drive** \u2192 **Share Summary File**\n\nThis creates two files per audio:\n- `... .txt` (full transcript)\n- `..._summary.md` (formatted summary)"
      },
      "typeVersion": 1
    },
    {
      "id": "c7d784d1-850c-44c4-9fdd-5c69d66c1322",
      "name": "Step 5 - Log & notifications",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1632,
        -32
      ],
      "parameters": {
        "width": 820,
        "height": 352,
        "content": "## 5) Log + notify\n\n**Nodes**\n- **Prepare Sheets Data**: collects subject, file name, transcript, summary, and Drive links into one JSON object\n- **Log to Google Sheets**: appends a row to your sheet\n- **Send Gmail Notification**: emails the summary to the original sender\n- **Send Slack Notification**: posts the summary + link to Slack\n\n**Note**\n- Replace any hardcoded channel / sheet targets before publishing the template."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6cbcb6ad-b1a0-482d-976e-5ce976003b08",
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          },
          {
            "node": "Upload Audio to Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter": {
      "main": [
        [
          {
            "node": "Generate Year-Month Folder Path",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Convert Summary to MD",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Generate AI Summary",
            "type": "main",
            "index": 0
          },
          {
            "node": "Convert Transcript to TXT",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Share Summary File": {
      "main": [
        [
          {
            "node": "Prepare Sheets Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate AI Summary": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Sheets Data": {
      "main": [
        [
          {
            "node": "Log to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log to Google Sheets": {
      "main": [
        [
          {
            "node": "Send Gmail Notification",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Slack Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New Gmail with Audio": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Summary to MD": {
      "main": [
        [
          {
            "node": "Upload Summary to Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Share Transcript File": {
      "main": [
        [
          {
            "node": "Prepare Sheets Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Summary to Drive": {
      "main": [
        [
          {
            "node": "Share Summary File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Transcript to TXT": {
      "main": [
        [
          {
            "node": "Upload Transcript to Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Transcript to Drive": {
      "main": [
        [
          {
            "node": "Share Transcript File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Folder If Not Exists": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Generate Year-Month Folder Path": {
      "main": [
        [
          {
            "node": "Create Folder If Not Exists",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}