{
  "id": "plZ7SEgRE5J3rK0O",
  "name": "AI Follow-Up Messages from Fireflies Transcripts (Google Calendar)",
  "tags": [],
  "nodes": [
    {
      "id": "e80cc5e8-58c3-4820-879a-020f507d984b",
      "name": "GraphQL",
      "type": "n8n-nodes-base.graphql",
      "position": [
        512,
        544
      ],
      "parameters": {
        "query": "query GetTranscriptsByGuest($guestEmail: String!) {\n  transcripts(participant_email: $guestEmail) {\n    id\n    title\n    date\n    organizer_email\n    participants\n    duration\n    sentences {\n      text\n      speaker_name\n      start_time\n      end_time\n    }\n    summary {\n      overview\n      action_items\n      keywords\n    }\n  }\n}",
        "endpoint": "https://api.fireflies.ai/graphql",
        "variables": "={\n  \"guestEmail\": \"{{ $json.guest }}\"\n}",
        "authentication": "headerAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "3e5a4755-e3cf-4d79-a41a-86171ac8eba7",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        176,
        544
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f15e7a75-aa69-4009-90fb-00a3e2701e8e",
              "name": "startTimeOfAppointment",
              "type": "string",
              "value": "={{ $json.start.dateTime }}"
            },
            {
              "id": "50bdfc5e-cada-41eb-869f-bd2af5a5615b",
              "name": "endTimeOfAppointment",
              "type": "string",
              "value": "={{ $json.end.dateTime }}"
            },
            {
              "id": "177b19e7-8194-4c16-9d4b-22079c067061",
              "name": "createdBy",
              "type": "string",
              "value": "={{ $json.creator.email }}"
            },
            {
              "id": "223c85e9-2322-4298-9728-040e739b1bf4",
              "name": "guest",
              "type": "string",
              "value": "={{ $json.attendees[0].email }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "fc1fc27a-445f-4ba9-bcad-94bd697f0c10",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1184,
        544
      ],
      "parameters": {
        "text": "=Your Objective:\n\nBased strictly on the provided transcript, write a sequence of 12 persuasive follow-up messages to be sent to {{ $('Edit Fields').item.json.guest }} via email. The goal is to re-engage the client, address their specific concerns mentioned in the call, and gently guide them towards making a purchase.\n\n\nInstructions:\n\nDeep Personalization: Do not write generic messages.\n\nYour messages must reference specific topics, pain points, or interests that \nmentioned during the call. Use the exact context from the transcript.\n\nTRANSCRIPT: {{ $('GraphQL').item.json.data.transcripts[0].toJsonString() }}\n\nCore Task: Generate exactly 12 distinct follow-up messages.\nFinal Output Format:\nNumber each message clearly (Message 1, Message 2, etc.).\nDo not add any extra explanations, introductions, or comments.\nProvide only the raw text of the 12 messages as the final output. ",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "43cb1cc9-26c6-43fa-9159-dabec88a1456",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1120,
        816
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.5-flash-lite"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "49b8d130-379b-4d5e-9b43-902a7e24c25e",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1536,
        544
      ],
      "parameters": {
        "name": "={{ $('Edit Fields').item.json.guest }}",
        "content": "={{ $json.output }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive",
          "cachedResultUrl": "https://drive.google.com/drive/my-drive",
          "cachedResultName": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1sfBcplQZn2T5dGc50zXH8ng-8zqSKeWB",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1sfBcplQZn2T5dGc50zXH8ng-8zqSKeWB",
          "cachedResultName": "Followup Messages"
        },
        "operation": "createFromText"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "6498ee53-cc4e-4282-9a03-319a594b26b6",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        240
      ],
      "parameters": {
        "width": 448,
        "height": 464,
        "content": "## 1. Get Appointment Data\n\nTriggers when a appointment is created in Google Calendar"
      },
      "typeVersion": 1
    },
    {
      "id": "bf96d4c8-72da-486e-9814-6a3676940a30",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        240
      ],
      "parameters": {
        "width": 288,
        "height": 464,
        "content": "## 2. Fetch Meeting Transcript\n\nQueries the Fireflies API using the guest's email to fetch the full meeting transcript and then formats it into a clean structure for the AI to process."
      },
      "typeVersion": 1
    },
    {
      "id": "4f5bd9ee-ff27-48fa-af4e-302e866a2e79",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1104,
        240
      ],
      "parameters": {
        "width": 608,
        "height": 464,
        "content": "## 4. Generate & Store AI Messages\n\nThe AI Agent uses the transcript to generate 12 personalized follow-up messages. Finally, these messages are saved to a specific Google Drive folder."
      },
      "typeVersion": 1
    },
    {
      "id": "802ab55e-9f94-4516-9747-b9128e3adfa4",
      "name": "Google Calendar Trigger",
      "type": "n8n-nodes-base.googleCalendarTrigger",
      "position": [
        -16,
        544
      ],
      "parameters": {
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "eventCreated",
        "calendarId": {
          "__rl": true,
          "mode": "list",
          "value": "user@example.com",
          "cachedResultName": "WebSensePro - Bilal"
        }
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "78f24abc-f4af-43ca-9da3-3fbf5cb60922",
      "name": "Filter",
      "type": "n8n-nodes-base.filter",
      "position": [
        880,
        544
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "01e2edad-4472-4549-bc68-d23aa8e32b5b",
              "operator": {
                "type": "array",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.data.transcripts }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "00bac098-939a-4776-9afc-aa878f116dbc",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        768,
        240
      ],
      "parameters": {
        "width": 288,
        "height": 464,
        "content": "## 3. Skip if Empty\n\nIf there is no meeting with the guest eariler it will not proceed"
      },
      "typeVersion": 1
    },
    {
      "id": "9bfb20d6-238c-4f99-b68b-80c3ede88c06",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        -80
      ],
      "parameters": {
        "color": 4,
        "width": 368,
        "height": 288,
        "content": "## Video Tutorial\n\n** Detailed Youtube Tutorial **. @[youtube](5t9xXCz4DzM)"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "552abe99-2511-4560-af34-3c1d7e6641d1",
  "connections": {
    "Filter": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GraphQL": {
      "main": [
        [
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "GraphQL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Calendar Trigger": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}