{
  "id": "hjNrs3gy65AXCrBv",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Send FireFlies Meeting Racap via email",
  "tags": [],
  "nodes": [
    {
      "id": "230afc9a-293b-4801-8d24-4df63af87843",
      "name": "Get a transcript",
      "type": "@firefliesai/n8n-nodes-fireflies.fireflies",
      "position": [
        -272,
        1072
      ],
      "parameters": {
        "transcriptId": "={{ $json.meetingId }}"
      },
      "credentials": {
        "firefliesApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5fcde973-5017-48c5-be50-a6fdbe0c8893",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -576,
        768
      ],
      "parameters": {
        "filters": {
          "q": "subject:Your meeting recap",
          "sender": "user@example.com"
        },
        "pollTimes": {
          "item": [
            {
              "mode": "everyHour",
              "minute": 1
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9385ac1b-cc24-47ca-ad85-3eba9be423b3",
      "name": "Get a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -304,
        768
      ],
      "parameters": {
        "simple": false,
        "options": {},
        "messageId": "={{ $json.id }}",
        "operation": "get"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "6dda6aed-c0a2-447a-86e6-41cf3848cdde",
      "name": "Information Extractor",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        192,
        768
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {
          "systemPromptTemplate": "You are an expert extraction algorithm.\nOnly extract relevant information from the text.\nIf you do not know the value of an attribute asked to extract, you may omit the attribute's value."
        },
        "attributes": {
          "attributes": [
            {
              "name": "meeting_notes",
              "required": true,
              "description": "Estrai il link del meeting"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "315b19ec-e999-427d-b9b0-b24a66dfc16d",
      "name": "Set email content",
      "type": "n8n-nodes-base.set",
      "position": [
        -64,
        768
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "095e5770-57bb-4471-83a6-f83a00887c9d",
              "name": "text",
              "type": "string",
              "value": "={{ $json.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2fe281dc-f29e-422f-9bef-52ac0a3c8305",
      "name": "Get Meeting Id",
      "type": "n8n-nodes-base.code",
      "position": [
        560,
        768
      ],
      "parameters": {
        "jsCode": "// Loop over input items and extract meeting ID from the URL\nfor (const item of $input.all()) {\n const url = item.json.output.meeting_notes;\n \n // Find the position of \"::\" and \"?\"\n const startIndex = url.indexOf(\"::\") + 2;\n const endIndex = url.indexOf(\"?\");\n \n // Extract the meeting ID\n const meetingId = url.substring(startIndex, endIndex);\n \n // Replace the entire item with only the meeting ID\n item.json = { meetingId: meetingId };\n}\n\nreturn $input.all();"
      },
      "typeVersion": 2
    },
    {
      "id": "588e4d6b-2832-455b-8348-60bc2af89a9f",
      "name": "Get meeting overview",
      "type": "n8n-nodes-base.set",
      "position": [
        128,
        1072
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "3b86bb4c-e4fc-4af7-a644-cbef02675eed",
              "name": "short_summary",
              "type": "string",
              "value": "={{ $json.data.summary.short_summary }}"
            },
            {
              "id": "fc5a137a-a77d-4480-8c82-f7066ba2a9e5",
              "name": "short_overview",
              "type": "string",
              "value": "={{ $json.data.summary.short_overview }}"
            },
            {
              "id": "b84c63d6-2b28-4d0a-bb6e-b3c1b74cd0df",
              "name": "overview",
              "type": "string",
              "value": "={{ $json.data.summary.overview }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "bae36642-b235-4c55-bb3a-b40db5de7355",
      "name": "Email Agent",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        448,
        1072
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-2.5-pro",
          "cachedResultName": "models/gemini-2.5-pro"
        },
        "options": {
          "systemMessage": "=# Meeting Summary Email Generator - System Prompt\n\nYou are an AI assistant specialized in creating comprehensive meeting summary emails. Your task is to compose a complete email based on meeting discussions to send to all participants.\n\n## Key Requirements\n\n- Be precise and thorough in reporting everything discussed, with NO placeholders\n- Create a subject line that summarizes the meeting content\n- Write without preambles or introductory text\n- Output MUST be in the following JSON format only:\n\n```json\n{\n  \"subject\": \"...\",\n  \"text\": \"...\"\n}\n```\n\n## Output Format\n\nWhere:\n- `\"object\"` contains the email subject line\n- `\"text\"` contains the complete email body\n\n## Important Notes\n\nEnsure the email body includes all discussion points, decisions made, action items, and relevant details from the meeting. Do not use generic placeholders like [insert details], [name], or [date] - all content must be specific and complete."
        },
        "messages": {
          "values": [
            {
              "content": "=Short summary:\n{{ $json.short_summary }}\n\nShort overview:\n{{ $json.short_overview }}\n\nOverview:\n{{ $json.overview }}"
            }
          ]
        },
        "jsonOutput": true
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f84a2c67-3a74-4caf-bd9b-765953d58a5d",
      "name": "Get valid json",
      "type": "n8n-nodes-base.code",
      "position": [
        -256,
        1456
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\n\nreturn items.map(item => {\n  const rawText = item.json.content.parts[0].text;\n\n  const parsed = JSON.parse(rawText);\n\n  return {\n    json: parsed,\n  };\n});\n"
      },
      "typeVersion": 2
    },
    {
      "id": "4936ba09-b9f7-4a03-8630-ab9f506f1eee",
      "name": "MD to HTML",
      "type": "n8n-nodes-base.markdown",
      "position": [
        128,
        1456
      ],
      "parameters": {
        "mode": "markdownToHtml",
        "options": {},
        "markdown": "={{ $json.text }}",
        "destinationKey": "text"
      },
      "typeVersion": 1
    },
    {
      "id": "b2eebe76-f9c0-438c-8810-60855b021c26",
      "name": "Send email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        528,
        1456
      ],
      "parameters": {
        "sendTo": "XXX",
        "message": "={{ $json.text }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "={{ $json.subject }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "aaaa1995-bee8-4e70-a7cd-ee46e7715a2a",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -336,
        640
      ],
      "parameters": {
        "color": 7,
        "width": 1056,
        "height": 320,
        "content": "## STEP 1\nWhen a matching email is found, the workflow retrieves the full email content and extracts the meeting recap URL using an Information Extractor.\nThe meeting ID is sent to the Fireflies Node, which retrieves the full transcript and summary data (short summary, short overview, and full overview)."
      },
      "typeVersion": 1
    },
    {
      "id": "16713370-05a6-4b15-ac51-d22827692256",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -336,
        976
      ],
      "parameters": {
        "color": 7,
        "width": 1056,
        "height": 320,
        "content": "## STEP 2\nThe meeting summary data is passed to a Google Gemini node, which generates a complete meeting summary email with a subject line and body in JSON format."
      },
      "typeVersion": 1
    },
    {
      "id": "5b57aa56-dd0a-4e22-bfcf-c61c3d56882a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -336,
        1312
      ],
      "parameters": {
        "color": 7,
        "width": 1056,
        "height": 320,
        "content": "## STEP 3\nSet your email in Gmail node. Then the email is sent via Gmail with the AI-generated subject and HTML body."
      },
      "typeVersion": 1
    },
    {
      "id": "1718e370-de50-44db-9188-062531c0ef62",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        176,
        896
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "2b15be0c-2001-42d1-9ff5-838b9591352a",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -336,
        208
      ],
      "parameters": {
        "width": 1056,
        "height": 416,
        "content": "## Auto-send FireFlies meeting summaries via email using Gemini 2.5 Pro\nThis workflow automatically processes [Fireflies.ai](https://app.fireflies.ai/login?referralCode=01K0V2Z1QHY76ZGY9450251C99) **meeting recap emails**, extracts the meeting transcript, generates a structured summary email, and sends it to a designated recipient.\n\n### **How it works:**\n\nThis workflow automates the full lifecycle of Firefliesi meeting recap emails. It triggers on new Gmail messages with a Fireflies recap, extracts the meeting link and ID, and retrieves the complete transcript through the Fireflies Node. The transcript is then processed by a Google Gemini node, which generates a professional meeting summary email including subject and body in JSON format. A Code Node parses and formats the data, converting Markdown into HTML for proper email presentation. Finally, the formatted summary email is automatically sent via Gmail to the designated recipient.\n\n### **Setup steps:**\n\nBegin by configuring Gmail OAuth2 credentials for both triggers and email sending, and connect Fireflies, OpenAI, and Google Gemini API keys. Adjust Gmail Trigger filters to match your Fireflies recap sender and subject. Update the recipient email in the \u201cSend email\u201d node as needed. Optionally, refine AI prompts in the Information Extractor and Email Agent nodes to personalize tone or extraction accuracy. Once configured, activate the workflow in n8n and test it by sending a Fireflies recap email to verify full automation.\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "861d8576-7676-4289-bc8c-00f739deeb64",
  "connections": {
    "MD to HTML": {
      "main": [
        [
          {
            "node": "Send email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Agent": {
      "main": [
        [
          {
            "node": "Get valid json",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a message": {
      "main": [
        [
          {
            "node": "Set email content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "Get a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Meeting Id": {
      "main": [
        [
          {
            "node": "Get a transcript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get valid json": {
      "main": [
        [
          {
            "node": "MD to HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a transcript": {
      "main": [
        [
          {
            "node": "Get meeting overview",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Information Extractor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Set email content": {
      "main": [
        [
          {
            "node": "Information Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get meeting overview": {
      "main": [
        [
          {
            "node": "Email Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Information Extractor": {
      "main": [
        [
          {
            "node": "Get Meeting Id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}