Nodes:
name: OpenAI Chat Model1
type: @n8n/n8n-nodes-langchain.lmChatOpenAi
parameters: options: temperature: 0
name: Get Meeting ConferenceRecords
type: n8n-nodes-base.httpRequest
parameters: url: https://meet.googleapis.com/v2/conferenceRecords
sendQuery: yes
authentication: predefinedCredentialType
queryParameters: parameters: name: filter
value: =space.meeting_code={{ $json.conferenceData.conferenceId }}
nodeCredentialType: googleOAuth2Api
name: Get Meeting Transcript Location
type: n8n-nodes-base.httpRequest
parameters: url: =https://meet.googleapis.com/v2/{{ $json.conferenceRecords[0].name }}/transcripts
authentication: predefinedCredentialType
nodeCredentialType: googleOAuth2Api
name: Get Transcript File
type: n8n-nodes-base.googleDrive
parameters: fileId: __rl: yes
mode: url
value: ={{ $json.docsDestination.document }}
options: googleFileConversion: conversion: docsToFormat: application/pdf
operation: download
name: When clicking "Test workflow"
type: n8n-nodes-base.manualTrigger
name: PDF Loader
type: n8n-nodes-base.extractFromFile
parameters: operation: pdf
name: Get Calendar Event
type: n8n-nodes-base.googleCalendar
parameters: eventId: abc123
calendar: __rl: yes
mode: list
value: c_5792bdf04bc395cbcbc6f7b754268245a33779d36640cc80a357711aa2f09a0a@group.calendar.google.com
cachedResultName: n8n-events
operation: get
name: Structured Output Parser
type: @n8n/n8n-nodes-langchain.outputParserStructured
parameters: jsonSchema: {
  "type": "object",
  "properties": {
    "summary": { "type": "string" },
    "highlights": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "attendee": { "type": "string" },
          "message": { "type": "string" }
        }
      }
    },
   "next_steps": {
      "type": "array",
      "items:": {
        "type": "string"
      }
   },
   "meetings_created": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "event_title": { "type": "string" },
           "event_invite_url": { "type" : "string" }
        }
      }
   }
  }
}
name: Execute Workflow Trigger
type: n8n-nodes-base.executeWorkflowTrigger
name: Response
type: n8n-nodes-base.set
parameters: assignments: assignments: name: response
type: string
value: ={{ JSON.stringify($('Create Calendar Event1').item.json) }}
name: Edit Fields
type: n8n-nodes-base.set
parameters: assignments: assignments: name: =route
type: string
value: ={{ $json.route }}
name: query
type: object
value: ={{ $json.query.parseJson() }}
name: Fallback Response
type: n8n-nodes-base.set
parameters: mode: raw
jsonOutput: {
  "response": {
    "ok": false,
    "error": "The requested tool was not found or the service may be unavailable. Do not retry."
  }
}

name: Actions Router
type: n8n-nodes-base.switch
parameters: rules: values: outputKey: meetings.create
conditions: options: caseSensitive: yes
typeValidation: strict
combinator: and
conditions: operator: type: string
operation: equals
leftValue: ={{ $json.route }}
rightValue: meetings.create
renameOutput: yes
options: fallbackOutput: extra
name: Get Attendees
type: n8n-nodes-base.set
parameters: assignments: assignments: name: attendees
type: array
value: ={{ $('Actions Router').item.json.query.attendees }}
name: Attendees List
type: n8n-nodes-base.splitOut
parameters: fieldToSplitOut: attendees
name: Add Attendee to Invite
type: n8n-nodes-base.googleCalendar
parameters: eventId: ={{ $('Create Calendar Event1').item.json.id }}
calendar: __rl: yes
mode: list
value: c_5792bdf04bc395cbcbc6f7b754268245a33779d36640cc80a357711aa2f09a0a@group.calendar.google.com
cachedResultName: n8n-events
operation: update
updateFields: attendees: ={{ $json.name }} <{{ $json.email }}>
name: Sticky Note
type: n8n-nodes-base.stickyNote
parameters: color: 7
width: 756.2929032891963
height: 445.79624302689535
content: ## 4. This Tool Creates Calendar Events
This tool, given event details and a list of attendees, will create a new Google calendar event and add the attendees to it.
name: Sticky Note2
type: n8n-nodes-base.stickyNote
parameters: color: 7
width: 586.8663941671947
height: 405.6964113279832
content: ## 1. Retrieve Meeting Transcript
[Read more about working with HTTP node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest)

There's no built-in support for Google Meets transcript API however, we can solve this problem with the HTTP node. Note you may also need to setup a separate Google OAuth API Credential to obtain the required scopes.
name: Sticky Note3
type: n8n-nodes-base.stickyNote
parameters: color: 7
width: 681.4281346810014
height: 588.2833041602365
content: ## 2. Let AI Agent Carry Out Follow-Up Actions
[Read more about working with AI Agents](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent)

The big difference between Basic LLM chains and AI Agents is that AI agents are given the automony to perform actions. Provided the right tool exists, AI Agents can send emails, book flights and even order pizza! Here we're leaving it up to our agent to book any follow-up meetings after the call and invite all interested parties.
name: Sticky Note4
type: n8n-nodes-base.stickyNote
parameters: color: 7
width: 591.4907024073684
height: 579.2725119898125
content: ## 3: Using the Custom Workflow Tool
[Read more about Workflow Triggers](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflowtrigger)

One common implementation of tool use is to set them up as workflows which are intended triggered via other workflows. With this, we can either build a tool per workflow or for efficiency, take an API approach where multiple tools can exist behind a router (in this case our "switch" node).

Our AI agent will therefore only passing through the parameters of the request and won't have to learn/know how to intereact directly with the tools and services.
name: Create Calendar Event1
type: n8n-nodes-base.googleCalendar
parameters: end: ={{ $json.query.end_date }} {{ $json.query.end_time }}
start: ={{ $json.query.start_date }} {{ $json.query.start_time }}
calendar: __rl: yes
mode: list
value: c_5792bdf04bc395cbcbc6f7b754268245a33779d36640cc80a357711aa2f09a0a@group.calendar.google.com
cachedResultName: n8n-events
additionalFields: summary: ={{ $json.query.title }}
description: ={{ $json.query.description }}
name: Sticky Note6
type: n8n-nodes-base.stickyNote
parameters: width: 359.6648027457353
height: 385.336571355038
content: ## Try It Out!
### This workflow does the following:
* Retrieves a meeting transcript
* Sends transcript to an AI Agent to parse and carry out follow up actions if necessary.
* If transcript mentions a follow up meeting is required, the AI Agent will call a tool to create the meeting.
* Additionally if able, the AI Agent will also assign attendees it thinks should attend the meeting. 

### Need Help?
Join the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!

Happy Hacking!
name: Schedule Meeting
type: @n8n/n8n-nodes-langchain.toolWorkflow
parameters: name: create_calendar_event
fields: values: name: route
stringValue: meetings.create
workflowId: ={{ $workflow.id }}
description: Call this tool to create an calendar event. This tool requires the following object request body.
```
{
  "type": "object",
  "properties": {
    "title": { "type": "string" },
    "description": { "type": "string" },
    "start_date": { "type": "string" },
    "start_time": { "type": "string" },
    "end_date": { "type": "string" },
    "end_time": { "type": "string" },
    "attendees": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "email": { "type": "string" }
        }
      }
    }
  }
}
```
Note that dates are in the format yyyy-MM-dd and times are in the format HH:mm:ss.
name: AI Agent
type: @n8n/n8n-nodes-langchain.agent
parameters: text: =system: your role is to help people get the most out of their meetings. You achieve this by helpfully summarising the meeting transcript to pull out useful information and key points of interest and delivery this in note form. You also help carry out any follow-up actions on behalf of the meeting attendees.
1. Summarise the meeting and highlight any key goals of the meeting.
2. Identify and list important points mentioned by each attendee. If non-applicable for an attendee, skip and proceed to the next attendee.
3. Identify and list all next steps agreed by the attendees. If there are none, make a maximum of 3 suggestions based on the transcript instead. Please list the steps even if they've already been actioned.
4. identify and perform follow-up actions based on a transcript of a meeting. These actions which are allowed are: creating follow-up calendar events if suggested by the attendees.

The meeting details were as follows:
* The creator of the meeting was {{ $('Get Calendar Event').item.json["creator"]["displayName"] }} <{{ $('Get Calendar Event').item.json["creator"]["email"]}}>
* The attendees were {{ $('Get Calendar Event').item.json["attendees"].map(attendee => `${attendee.display_name} <${attendee.email}>`).join(', ') }}
* The meeting was scheduled for {{ $('Get Calendar Event').item.json["start"]["dateTime"] }}

The meeting transcript as follows:
```
{{ $json["text"] }}
```
agent: openAiFunctionsAgent
promptType: define
hasOutputParser: yes
name: Sticky Note5
type: n8n-nodes-base.stickyNote
parameters: color: 7
width: 464.50696860436165
height: 446.9122178333584
content: ## 1. Get Calendar Event
[Read more about working with Google Calendar](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.googlecalendar)

In this demo, we've decided to go with google meet as transcripts are stored in the user google drive. First, we'll need to get the calendar event of which the google meet was attached.
If the meet was not arranged through Google calendar, you may need to skip this step and just reference the transcripts in google drive directly.
name: Sticky Note1
type: n8n-nodes-base.stickyNote
parameters: width: 184.0677386144551
height: 299.3566512487305
content: 















🚨**Required**
* Set your calendar event ID here.
name: Sticky Note7
type: n8n-nodes-base.stickyNote
parameters: color: 5
width: 349.91944442094535
height: 80
content: ### 💡 Can't find your transcript?
Only meetings which own and were recorded and had transcription enabled will be available.

name: Sticky Note8
type: n8n-nodes-base.stickyNote
parameters: width: 184.0677386144551
height: 299.3566512487305
content: 















🚨**Required**
* Set your calendar ID here.

Connections:
PDF Loader: main: node: AI Agent
type: main
Edit Fields: main: node: Actions Router
type: main
Get Attendees: main: node: Attendees List
type: main
Actions Router: main: node: Create Calendar Event1
type: main
node: Fallback Response
type: main
Attendees List: main: node: Add Attendee to Invite
type: main
Schedule Meeting: ai_tool: node: AI Agent
type: ai_tool
Get Calendar Event: main: node: Get Meeting ConferenceRecords
type: main
OpenAI Chat Model1: ai_languageModel: node: AI Agent
type: ai_languageModel
Get Transcript File: main: node: PDF Loader
type: main
Add Attendee to Invite: main: node: Response
type: main
Create Calendar Event1: main: node: Get Attendees
type: main
Execute Workflow Trigger: main: node: Edit Fields
type: main
Structured Output Parser: ai_outputParser: node: AI Agent
type: ai_outputParser
Get Meeting ConferenceRecords: main: node: Get Meeting Transcript Location
type: main
When clicking "Test workflow": main: node: Get Calendar Event
type: main
Get Meeting Transcript Location: main: node: Get Transcript File
type: main