{
  "id": "Rq47x8l5jPZ0LaUD",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "AI Sales Call Analyst",
  "tags": [],
  "nodes": [
    {
      "id": "45436c7f-d535-48ab-bba6-09e938635cc5",
      "name": "Fireflies Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "position": [
        1728,
        400
      ],
      "parameters": {
        "path": "fireflies-call-completed",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2.1
    },
    {
      "id": "e7595515-a84c-4888-811a-52f020d1f3c0",
      "name": "Get AI App ID",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2784,
        336
      ],
      "parameters": {
        "url": "https://api.fireflies.ai/graphql",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"query\": \"query GetAIAppsOutputs($transcriptId: String) { apps(transcript_id: $transcriptId) { outputs { transcript_id user_id app_id created_at title prompt response } } }\",\n  \"variables\": {\n    \"transcriptId\": \"{{ $json.transcript_id }}\"\n  }\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_TOKEN_HERE"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "855b748d-4126-4401-af4a-f0c2af428e40",
      "name": "Gets Latest Meeting",
      "type": "n8n-nodes-base.code",
      "position": [
        2608,
        336
      ],
      "parameters": {
        "jsCode": "// Flatten all data objects from the wrapped \"success/data\" structure\nconst transcripts = items.map(item => item.json.data);\n\n// Sort by dateString descending\ntranscripts.sort((a, b) => new Date(b.dateString) - new Date(a.dateString));\n\n// Pick the most recent\nconst latest = transcripts[0];\n\n// Return transcript ID and relevant info\nreturn [\n  {\n    json: {\n      transcript_id: latest.id,\n      title: latest.title,\n      meeting_date: latest.dateString,\n      organizer_email: latest.organizer_email,\n      meeting_link: latest.meeting_link\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "cfad5e36-741c-488c-ab0e-fecff8d560ad",
      "name": "Get outputs of an AI app 1",
      "type": "@firefliesai/n8n-nodes-fireflies.fireflies",
      "position": [
        2608,
        528
      ],
      "parameters": {
        "appId": "={{ $('Get AI App ID').item.json.data.apps.outputs[0].app_id }}",
        "resource": "aiApp",
        "transcriptId": "={{ $('Get AI App ID').item.json.data.apps.outputs[0].transcript_id }}"
      },
      "credentials": {
        "firefliesApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "dd59718c-c8d8-44f1-92e5-49b783086c2e",
      "name": "Get outputs of an AI app 2",
      "type": "@firefliesai/n8n-nodes-fireflies.fireflies",
      "position": [
        2800,
        528
      ],
      "parameters": {
        "appId": "={{ $('Get AI App ID').item.json.data.apps.outputs[1].app_id }}",
        "resource": "aiApp",
        "transcriptId": "={{ $json.data.transcript_id }}"
      },
      "credentials": {
        "firefliesApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "645bdc52-86a5-4fa3-b937-20e3b74d5f4a",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        1712,
        576
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9ba4dbca-bce4-4d68-8135-0e36313f9f1b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1712,
        320
      ],
      "parameters": {
        "color": 4,
        "width": 640,
        "height": 224,
        "content": "## Post-Meeting Trigger\n"
      },
      "typeVersion": 1
    },
    {
      "id": "0e017259-a589-4a35-b732-d2acf815855f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2352,
        144
      ],
      "parameters": {
        "color": 6,
        "width": 672,
        "height": 544,
        "content": "## Meeting Intelligence \n**Transcripts** \n**Meeting Summaries**\n**Objection Lists**\n**AI Apps**"
      },
      "typeVersion": 1
    },
    {
      "id": "240653bb-583d-4ed3-90f2-59d06db649a5",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3024,
        144
      ],
      "parameters": {
        "color": 3,
        "width": 672,
        "height": 544,
        "content": "## Sales Call Analyst\n**Analyzes Objection Handling, Call Effectiveness and constructs rep feedback**"
      },
      "typeVersion": 1
    },
    {
      "id": "32d114d2-5925-4850-8be8-ff6f96518552",
      "name": "OpenAI Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        3232,
        576
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "23c4cbf6-cb61-4019-b866-9756af472f0d",
      "name": "Call Analysis Output Structure",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        3440,
        560
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"metadata\": {\n    \"rep_name\": \"Sarah Johnson\",\n    \"call_type\": \"Discovery\",\n    \"call_date\": \"2025-11-09\"\n  },\n  \"objections\": [\n    {\n      \"category\": \"Price/Budget\",\n      \"customer_quote\": \"This seems expensive for our current budget\",\n      \"rep_response\": \"Let me show you the ROI breakdown\",\n      \"severity\": \"Critical\",\n      \"resolved\": \"Partially\"\n    }\n  ],\n  \"summary\": {\n    \"top_objection_categories\": [\"Price/Budget\", \"Timeline/Urgency\"],\n    \"unresolved_objections\": [\"Budget approval needed\"],\n    \"what_went_well\": [\"Good rapport building\"],\n    \"improvement_opportunities\": [\"Address pricing earlier\"],\n    \"next_steps_for_rep\": [\"Send ROI calculator\"]\n  },\n  \"slack_summary\": \"Sarah handled 1 objection \u2014 mostly around pricing. One remains partially resolved. Focus next time on addressing budget concerns earlier in discovery.\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "1b812394-6790-4e0c-9650-31e670972fe6",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3696,
        144
      ],
      "parameters": {
        "width": 576,
        "height": 544,
        "content": "## Send Feedback\n**Publishes to Google Docs Folder and instantly sends feedback to reps**"
      },
      "typeVersion": 1
    },
    {
      "id": "5cd1a7dd-e231-423f-9528-76130e48c05a",
      "name": "Create file from text",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        3792,
        512
      ],
      "parameters": {
        "name": "={{ $('Format Analysis Results').item.json.output.metadata.rep_name }} : {{ $('Format Analysis Results').item.json.output.metadata.call_type }} Analysis {{ $('Format Analysis Results').item.json.output.metadata.call_date }}",
        "content": "=\ud83c\udfaf Call Analysis for {{ $('Format Analysis Results').first().json.repName }}\n\n\ud83d\udcdd Call Summary:\n{{ $('AI Call Analyzer').item.json.output.slack_summary }}\n\n\ud83d\udcde Call Details:\n\u2022 Type: {{ $('Format Analysis Results').first().json.callType }}\n\u2022 Date: {{ $('Format Analysis Results').first().json.callDate }}\n\n\ud83d\udca1 Sales Insights:\n\u2022 Objections Unresolved: {{ $('Format Analysis Results').item.json.output.summary.unresolved_objections }}\n\n\u2705 What Went Well:\n{{ $('Format Analysis Results').first().json.whatWentWell }}\n\n\ud83d\udd27 Areas for Improvement:\n{{ $('Format Analysis Results').item.json.output.summary.improvement_opportunities }}\n\n\u27a1\ufe0f Next Steps:\n{{ $('Format Analysis Results').first().json.nextSteps }}\n",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "13mBSy9gFR7OFq_LvnxEVCS0jbJ_UtEko",
          "cachedResultUrl": "https://drive.google.com/drive/folders/13mBSy9gFR7OFq_LvnxEVCS0jbJ_UtEko",
          "cachedResultName": "Sales Call Rep Feedback - Records"
        },
        "operation": "createFromText"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "a9ba2328-312c-4c4f-8893-64036bf440c3",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        1920,
        400
      ],
      "parameters": {
        "unit": "minutes",
        "amount": 8
      },
      "typeVersion": 1.1
    },
    {
      "id": "a01131ea-4fbe-41bd-8502-59c821724dff",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1712,
        160
      ],
      "parameters": {
        "color": 2,
        "width": 608,
        "height": 128,
        "content": "# AI Sales Call Analyst\n**Analyzes Sales Calls, Objection Handling and Provides Rep Feedback**"
      },
      "typeVersion": 1
    },
    {
      "id": "9d227d90-2909-454a-a8c7-e05399e28706",
      "name": "AI Call Analyzer",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        3312,
        352
      ],
      "parameters": {
        "text": "=AI Sales Agent \u2013 Objection Analyst (with Slack Summary)\n\nRole:\nYou analyze sales calls for objections, using:\n\t\u2022\tFireflies Key Objections List\n\t\u2022\tFireflies Objection Handler report\n\t\u2022\tCall transcript + metadata\n\nYour output must be clean JSON + a 1\u20132 sentence Slack summary.\n\n\u2e3b\n\nInput Variables\n\nRep Name: {{ $('Prepare Call Data').item.json.repName }}\nTranscript: {{ $('Prepare Call Data').item.json.transcript }}\nFireflies_Key_Objections_List: {{ $('Prepare Call Data').item.json.keyObjections }}\nFireflies_Objection_Handler: {{ $('Prepare Call Data').item.json.objectionHandler }}\n\nOutput Format (JSON Only)\n\n{\n  \"metadata\": {\n    \"rep_name\": \"\",\n    \"call_type\": \"\",\n    \"call_date\": \"\"\n  },\n  \"objections\": [\n    {\n      \"category\": \"\",\n      \"customer_quote\": \"\",\n      \"rep_response\": \"\",\n      \"severity\": \"Critical / Moderate / Minor\",\n      \"resolved\": \"Yes / Partially / No\"\n    }\n  ],\n  \"summary\": {\n    \"top_objection_categories\": [],\n    \"unresolved_objections\": [],\n    \"what_went_well\": [],\n    \"improvement_opportunities\": [],\n    \"next_steps_for_rep\": []\n  },\n  \"slack_summary\": \"\"\n}\n\n\n\u2e3b\n\nSlack Summary Rule\n\nGenerate a 1\u20132 sentence summary like this:\n\n\u201c{rep_name} handled {number} objections today \u2014 top concerns were {top categories}. {unresolved count} need follow-up. Main improvement area: {key improvement}.\u201d\n\nExample:\n\u201cSarah handled 4 objections \u2014 mostly around pricing and implementation. Two remain unresolved. Focus next time on clarifying ROI earlier in the call.\u201d\n\n\u2e3b\n\nRules\n\t\u2022\tUse only these objection categories:\nPrice/Budget, Timeline/Urgency, Authority/Decision, Need/Fit, Trust/Risk, Competition, Technical/Implementation, Contract/Legal\n\t\u2022\tMerge data from Fireflies outputs \u2014 remove duplicates\n\t\u2022\tKeep quotes short, verbatim\n\t\u2022\tDo not hallucinate or add fictional data\n\t\u2022\tNo extra commentary outside the JSON",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "bf8d86bd-1242-43eb-b275-1d3a2112d6c6",
      "name": "Get a list of transcripts",
      "type": "@firefliesai/n8n-nodes-fireflies.fireflies",
      "position": [
        2416,
        336
      ],
      "parameters": {
        "filters": {},
        "operation": "getTranscriptsList"
      },
      "credentials": {
        "firefliesApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e78413ec-10d5-4324-ad6e-f8fd38f482cc",
      "name": "Get a summary of a transcript",
      "type": "@firefliesai/n8n-nodes-fireflies.fireflies",
      "position": [
        2416,
        528
      ],
      "parameters": {
        "operation": "getTranscriptSummary",
        "transcriptId": "={{ $('Gets Latest Meeting').item.json.transcript_id }}"
      },
      "credentials": {
        "firefliesApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "79587f4f-fb1c-47ad-b41b-e642ede446ae",
      "name": "Prepare Call Data",
      "type": "n8n-nodes-base.set",
      "position": [
        3104,
        352
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "transcript",
              "type": "string",
              "value": "={{ $('Get a summary of a transcript').item.json.data.summary.short_summary }}"
            },
            {
              "id": "id-2",
              "name": "callType",
              "type": "string",
              "value": "=Sales Call / Consultation"
            },
            {
              "id": "id-3",
              "name": "repName",
              "type": "string",
              "value": "=Avi"
            },
            {
              "id": "c092fcfd-4efb-4f22-a7b3-f316d25a5e62",
              "name": "keyObjections",
              "type": "string",
              "value": "={{ $('Get outputs of an AI app 1').item.json.data.response }}"
            },
            {
              "id": "3b6abbfa-c799-4009-86b3-21525aef02a5",
              "name": "objectionHandler",
              "type": "string",
              "value": "={{ $('Get outputs of an AI app 2').item.json.data.response }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "24f73f38-e5f4-465e-a96d-f455c801493c",
      "name": "Format Analysis Results",
      "type": "n8n-nodes-base.set",
      "position": [
        3792,
        304
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "repName",
              "type": "string",
              "value": "={{ $('Prepare Call Data').first().json.repName }}"
            },
            {
              "id": "id-2",
              "name": "callType",
              "type": "string",
              "value": "={{ $('Prepare Call Data').first().json.callType }}"
            },
            {
              "id": "id-3",
              "name": "callDate",
              "type": "string",
              "value": "={{ $json.output.metadata.call_date }}"
            },
            {
              "id": "id-5",
              "name": "objections",
              "type": "string",
              "value": "={{ $json.output.objections.map(o => `\u2022 Category: ${o.category}\\n  Customer Quote: \"${o.customer_quote}\"\\n  Severity: ${o.severity}\\n  Resolved: ${o.resolved}\\n`).join('\\n') }}"
            },
            {
              "id": "id-10",
              "name": "whatWentWell",
              "type": "array",
              "value": "={{ $json.output.summary.what_went_well }}"
            },
            {
              "id": "id-11",
              "name": "improvements_opportunities",
              "type": "array",
              "value": "={{ $json.output.summary.improvement_opportunities }}"
            },
            {
              "id": "id-15",
              "name": "nextSteps",
              "type": "array",
              "value": "={{ $json.output.summary.next_steps_for_rep }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "112f7f7e-0d31-452a-a070-7f0609d9cd7d",
      "name": "Send Rep Feedback to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        4032,
        304
      ],
      "parameters": {
        "text": "=\ud83c\udfaf *Call Analysis for {{ $('Format Analysis Results').first().json.repName }}*\n\n\ud83d\udcdd*Call Summary:*\n{{ $('AI Call Analyzer').item.json.output.slack_summary }}\n\n\ud83d\udcde *Call Details:*\n\u2022 Type: {{ $('Format Analysis Results').first().json.callType }}\n\u2022 Date: {{ $('Format Analysis Results').first().json.callDate }}\n\n\ud83d\udca1 *Sales Insights:*\n\u2022 Objections Unresolved: {{ $json.output.summary.unresolved_objections }}\n\n\u2705 *What Went Well:*\n{{ $('Format Analysis Results').first().json.whatWentWell }}\n\n\ud83d\udd27 *Areas for Improvement:*\n{{ $json.output.summary.improvement_opportunities }}\n\n\u27a1\ufe0f *Next Steps:*\n{{ $('Format Analysis Results').first().json.nextSteps }}\n\n\n",
        "user": {
          "__rl": true,
          "mode": "list",
          "value": "U091WTHG96J",
          "cachedResultName": "avinashraju05"
        },
        "select": "user",
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "9bcc0d0d-0060-4412-9c95-bb8c8bf3c7c2",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        976,
        80
      ],
      "parameters": {
        "width": 656,
        "height": 672,
        "content": "# AI Sales Call Analyst\n**Analyzes Sales Calls, Objection Handling and Provides Rep Feedback**\n\n## How it works\n1. **Post-Meeting Trigger**: Fireflies webhook triggers workflow after call ends\n2. **Meeting Intelligence**: Retrieves transcript, meeting summary, and objection lists from Fireflies\n3. **Sales Call Analyst**: AI analyzes objection handling, call effectiveness, and constructs rep feedback using OpenAI\n4. **Send Feedback**: Publishes analysis to Google Docs folder and sends feedback to rep via Slack\n\n## How to set up\n- **Connect Fireflies**: Set up webhook trigger for post-meeting events\n- **Add OpenAI key**: Configure your OpenAI API credentials\n- **Connect Slack**: Authorize Slack integration for sending feedback\n- **Connect Google Drive**: Set up folder for storing analysis documents\n\n## (Optional) Customization\n- **Analysis criteria**: Modify the AI prompts to focus on specific sales metrics or objection types\n- **Feedback format**: Customize the output structure and level of detail in rep feedback\n- **Distribution**: Add additional channels (email, CRM updates) for sharing insights"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "7650b969-94a5-4592-9d92-7333c289b107",
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Get a list of transcripts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Call Analyzer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get AI App ID": {
      "main": [
        [
          {
            "node": "Get a summary of a transcript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Call Analyzer": {
      "main": [
        [
          {
            "node": "Format Analysis Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Call Data": {
      "main": [
        [
          {
            "node": "AI Call Analyzer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gets Latest Meeting": {
      "main": [
        [
          {
            "node": "Get AI App ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Analysis Results": {
      "main": [
        [
          {
            "node": "Send Rep Feedback to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fireflies Webhook Trigger": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a list of transcripts": {
      "main": [
        [
          {
            "node": "Gets Latest Meeting",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get outputs of an AI app 1": {
      "main": [
        [
          {
            "node": "Get outputs of an AI app 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get outputs of an AI app 2": {
      "main": [
        [
          {
            "node": "Prepare Call Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Rep Feedback to Slack": {
      "main": [
        [
          {
            "node": "Create file from text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a summary of a transcript": {
      "main": [
        [
          {
            "node": "Get outputs of an AI app 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call Analysis Output Structure": {
      "ai_outputParser": [
        [
          {
            "node": "AI Call Analyzer",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Get a list of transcripts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}