{
  "id": "W9i1cihq9stuqDUb",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Auto Log Fireflies Meetings to CRM",
  "tags": [],
  "nodes": [
    {
      "id": "e756faea-df52-407a-a91b-7a69a7d44c05",
      "name": "Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1696,
        -224
      ],
      "parameters": {
        "color": 4,
        "width": 540,
        "height": 1252,
        "content": "## Fireflies Meeting to CRM Logger \u2014 Webhook + Fireflies + Google Sheets\n\nThis workflow automatically saves your Fireflies meeting transcripts into your CRM spreadsheet. When a Fireflies meeting finishes, Fireflies sends a notification to this workflow's webhook. The workflow then pulls the full transcript, figures out which person on the call was the client (not someone from your own team), finds that client in your Lead Database sheet, and logs the entire conversation under their record. If the client is not found in the database, the workflow simply stops without creating anything.\n\nThis is useful for sales and agency teams who want every client call automatically attached to the right lead \u2014 no manual copy-paste after meetings.\n\n## How it works\n- **1. Webhook \u2014 Receive Fireflies Notification** receives a POST request from Fireflies containing the meeting ID when a meeting is processed\n- **2. Fireflies \u2014 Get Transcript** fetches the full meeting transcript, speaker list, and date using the meeting ID\n- **3. Code \u2014 Clean Transcript Data** detects the client name (the speaker who is NOT from your own team) and builds the full transcript text\n- **4. Google Sheets \u2014 Find Lead** looks up that client name in your Lead Database tab and returns their row (including their Lead ID)\n- **5. IF \u2014 Lead Found?** checks whether a Lead ID was returned. TRUE: the client exists, continue to log. FALSE: client not in database, stop\n- **6. Google Sheets \u2014 Log to Conversation Logs** appends the transcript to the Conversation Logs tab, linked to the client's Lead ID\n- **No Operation** is the dead end for clients who are not in your database\n\n## Set up steps\n1. Install the Fireflies community node: Settings \u2192 Community Nodes \u2192 Install `@firefliesai/n8n-nodes-fireflies`\n2. In **2. Fireflies \u2014 Get Transcript** \u2014 connect your Fireflies API credential (get the API key from your Fireflies dashboard \u2192 Integrations \u2192 API)\n3. In **4. Google Sheets \u2014 Find Lead** and **6. Google Sheets \u2014 Log to Conversation Logs** \u2014 connect your Google Sheets OAuth2 credential and replace `YOUR_GOOGLE_SHEET_ID` with your spreadsheet ID. Your sheet needs two tabs: Lead Database (with a Name column and a Lead ID column) and Conversation Logs (with Lead ID, Date, and Details columns)\n4. In **3. Code \u2014 Clean Transcript Data** \u2014 open the code and replace the team markers (`your company name`, `your team name`) with words that appear in YOUR team's speaker names, so the workflow can tell your team apart from the client\n5. In Fireflies, set up a webhook that points to this workflow's Production webhook URL so meetings are sent here automatically"
      },
      "typeVersion": 1
    },
    {
      "id": "b4022d13-0b2e-4a80-8423-565a0e36c342",
      "name": "Section \u2014 Receive Notification and Get Transcript",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1072,
        48
      ],
      "parameters": {
        "color": 5,
        "width": 548,
        "height": 372,
        "content": "## Receive Notification and Get Transcript\nFireflies sends a webhook with the meeting ID when a meeting is processed. The Fireflies node uses that ID to fetch the full transcript, speaker list, and date."
      },
      "typeVersion": 1
    },
    {
      "id": "9f57cc1f-c23f-4f3b-9311-6cbb38afaec9",
      "name": "Section \u2014 Detect Client and Find Lead",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        16
      ],
      "parameters": {
        "color": 6,
        "width": 436,
        "height": 452,
        "content": "## Detect Client and Find Lead\nCode finds the client name (the speaker who is not on your team) and builds the full transcript text. Google Sheets looks that client up in your Lead Database to get their Lead ID."
      },
      "typeVersion": 1
    },
    {
      "id": "ace36be3-de46-4a7d-9b0e-2fc0d0755784",
      "name": "Section \u2014 Check Match and Log Conversation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -112
      ],
      "parameters": {
        "color": 4,
        "width": 756,
        "height": 740,
        "content": "## Check Match and Log Conversation\nIF checks whether a Lead ID was found. If yes, the full transcript is appended to the Conversation Logs tab under that lead. If no match is found, the workflow stops at the No Operation node."
      },
      "typeVersion": 1
    },
    {
      "id": "f20f7a66-42ff-4e13-9edf-7f3dcfba327a",
      "name": "1. Webhook \u2014 Receive Fireflies Notification",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -944,
        224
      ],
      "parameters": {
        "path": "c09dac2e-9191-43ca-9c1a-1e5b9e9b7393",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2.1
    },
    {
      "id": "f10aabf5-e554-4c08-abde-aa59c344545d",
      "name": "2. Fireflies \u2014 Get Transcript",
      "type": "@firefliesai/n8n-nodes-fireflies.fireflies",
      "position": [
        -704,
        224
      ],
      "parameters": {
        "transcriptId": "={{ $json.body.meeting_id }}"
      },
      "credentials": {
        "firefliesApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "12addfde-1d56-4902-80f2-0008115bb5e8",
      "name": "3. Code \u2014 Clean Transcript Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -464,
        224
      ],
      "parameters": {
        "jsCode": "const d = $json.data;\n\n// Markers that identify YOUR OWN team members in the speaker list.\n// IMPORTANT: replace these with words that appear in your team's\n// speaker names (for example your company name or a teammate name).\n// Any speaker whose name contains one of these is treated as internal.\nconst internalMarkers = ['your company name', 'your team name'];\n\n// The client is the first speaker who is NOT on your team.\nconst speakerNames = (d.speakers || []).map(s => s.name).filter(Boolean);\nconst clientName = speakerNames.find(n =>\n  !internalMarkers.some(m => n.toLowerCase().includes(m.toLowerCase()))\n) || '';\n\n// Build the full transcript text as \"Speaker: line\" for each sentence.\nconst fullTranscript = (d.sentences || [])\n  .map(s => `${s.speaker_name}: ${s.text}`).join('\\n');\n\nreturn [{ json: {\n  meetingId: d.id,\n  clientName,\n  fullTranscript,\n  date: d.dateString || ''\n}}];"
      },
      "typeVersion": 2
    },
    {
      "id": "57a5dcdb-ffb3-45e9-b5a0-f6029e35846b",
      "name": "4. Google Sheets \u2014 Find Lead",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -224,
        224
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "={{ $json.clientName }}",
              "lookupColumn": "Name"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Lead Database"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_SHEET_ID"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "48cc8e72-14e0-414a-b717-a101ac94c3a4",
      "name": "5. IF \u2014 Lead Found?",
      "type": "n8n-nodes-base.if",
      "position": [
        32,
        224
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "65dd5d68-2c2d-4331-9763-5e48eff24e6c",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json['Lead ID'] }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "31bb25f6-db1d-4822-bbbf-dfd1af73623e",
      "name": "6. Google Sheets \u2014 Log to Conversation Logs",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        272,
        128
      ],
      "parameters": {
        "columns": {
          "value": {
            "Date": "={{ $('3. Code \u2014 Clean Transcript Data').item.json.date }}",
            "Details": "={{ $('3. Code \u2014 Clean Transcript Data').item.json.fullTranscript }}",
            "Lead ID": "={{ $json['Lead ID'] }}"
          },
          "schema": [
            {
              "id": "Lead ID",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Lead ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Message Type",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Message Type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Details",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Details",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Type",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Conversation Logs"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_SHEET_ID"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "699bda24-6596-4e97-9b8e-9afd2142c3ac",
      "name": "No Operation \u2014 Client Not in Database",
      "type": "n8n-nodes-base.noOp",
      "position": [
        272,
        320
      ],
      "parameters": {},
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "2fb7dd20-7c93-4cf1-829c-f14482938e86",
  "nodeGroups": [],
  "connections": {
    "5. IF \u2014 Lead Found?": {
      "main": [
        [
          {
            "node": "6. Google Sheets \u2014 Log to Conversation Logs",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation \u2014 Client Not in Database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4. Google Sheets \u2014 Find Lead": {
      "main": [
        [
          {
            "node": "5. IF \u2014 Lead Found?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2. Fireflies \u2014 Get Transcript": {
      "main": [
        [
          {
            "node": "3. Code \u2014 Clean Transcript Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3. Code \u2014 Clean Transcript Data": {
      "main": [
        [
          {
            "node": "4. Google Sheets \u2014 Find Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1. Webhook \u2014 Receive Fireflies Notification": {
      "main": [
        [
          {
            "node": "2. Fireflies \u2014 Get Transcript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}