← All N8N workflows
AI & researchAgentChat TriggerGoogle Calendar ToolOpenAI Chat ModelMemory Buffer Window

AI Agent : Google calendar assistant using OpenAI

Configured with Agent, Chat Trigger, Google Calendar Tool, OpenAI Chat Model, and additional nodes. Review the connections and setup before adapting this template.

Workflow preview
TriggerWhen chat messagereceivedChat TriggerAI & modelsOpenAI Chat ModelOpenAI Chat ModelData storeWindow Buffer MemoryMemory Buffer WindowIntegrationGoogle Calendar - GetEventsGoogle Calendar ToolIntegrationGoogle Calendar -Create eventsGoogle Calendar ToolAI & modelsCalendar AI AgentAgent

Node categories in this workflow

  • Trigger
  • AI & models
  • Data store
  • Integration

Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.

Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.

How it works

The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.

Workflow node names, types, and operations
NodeCategoryTypeOperation
When chat message receivedTriggerChat TriggerSee node parameters
OpenAI Chat ModelAI & modelsOpenAI Chat ModelSee node parameters
Window Buffer MemoryData storeMemory Buffer WindowSee node parameters
Google Calendar - Get EventsIntegrationGoogle Calendar ToolgetAll
Google Calendar - Create eventsIntegrationGoogle Calendar ToolSee node parameters
Calendar AI AgentAI & modelsAgentSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.

Requirements

An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.

Credential types declared in the source

  • googleCalendarOAuth2Api
  • openAiApi

Workflow notes

Chat trigger - When a message is received

Chat trigger - When a message is received

This node is the entry point of the workflow. It triggers the workflow whenever a message is sent to the chat interface.

Options with n8n:

  • Embed the chat interface anywhere you want.
  • Use a webhook node instead of this node to connect with interfaces like Streamlit or OpenWebUI.
  • Use nodes for communication platforms (Slack, Teams, Discord, etc.) if you know how to configure them.
Tools Agent - Calendar AI Agent

Tools Agent - Calendar AI Agent

This node configures the AI agent for interaction with Google Calendar. It includes the following features:

  • A prompt source: This is the user message derived from the chat input of the preceding node (When chat message is received).
  • A system message: This defines the system prompt to guide the AI agent's behavior. It incorporates the variable {{ DateTime.local().toFormat('cccc d LLLL yyyy') }, allowing the AI agent to determine the current date and interact with Google Calendar accordingly. For example, the agent can understand a request like "Create an event called 'n8n workflow review' for next Tuesday."

n8n nodes come with built-in guardrails, ensuring that if the user requests tasks outside the AI agent's setup, it may not function as intended. (Feel free to test it!)

OpenAI chat model

OpenAI chat model

This node specifies the chat model used by the agent. In the template, the default LLM is gpt-4o for its high relevance.

Other options:

  • You can try gpt-4o-mini, which is more cost-effective.
  • You can also choose other LLM providers besides OpenAI, but make sure the LLM you select supports tool-calling.
Window buffer memory

Window buffer memory

This node manages the memory of the agent, specifically the context window length for chat history. The default is set to 5 messages.

Note: The memory is temporary. If you want to store conversations with the agent, you should use other nodes like Postgres chat memory. This can be easily set up with services like Supabase.

Google Calendar - Get Events

Google Calendar - Get Events

This sub-node is a tool used by the AI agent. Its purpose is to retrieve events based on the user input. For example: "Can you give me the events from last week about internal process ?"

The AI agent is designed to use this tool only when it has a date range. If the user hasn’t provided a date range, the AI agent will ask the user for it.

The variables {{ $fromAI('start_date') }} and {{ $fromAI('end_date') }} are dynamically filled by the AI.

Google Calendar - Create Events

Google Calendar - Create Events

This sub-node is a tool used by the AI agent. Its purpose is to create events based on the user input. For example: "Can you create an event 'Quarter revenue meeting' on [date] from [hour] to [hour] ?"

The AI agent is designed to use this tool only when it has a date range. If the user hasn’t provided a date range, the AI agent will ask the user for it. The variables {{ $fromAI('start_date') }} and {{ $fromAI('end_date') }} are dynamically filled by the AI.

Before creating the event, the AI agent will confirm with the user if the title and description of the event are correct. The variables used for this are:

  • {{ $fromAI('event_title') }}
  • {{ $fromAI('event_description') }}
Having fun with it ? Here’s how to level up this AI agent !

Having fun with it ? Here’s how to level up this AI agent !

This workflow demonstrates how easily you can set up an AI agent to call tools for you using n8n. The tasks here are useful but very basic.

If you want to enhance the tool-calling capabilities, consider the following:

  • Explore the "options" in the Google Calendar nodes to see additional features you can use. For example, let the AI agent add attendees to events it creates.

  • Implement the AI agent with your teammates and link it to each calendar. Use a {{ $fromAI('') }} variable for the calendar field and refine the prompts to suit your needs.

  • Add more actions for the AI agent to perform with the Google Calendar API, expanding its functionality.

AI Agent : Google calendar assistant using OpenAI

AI Agent : Google calendar assistant using OpenAI

Purpose and structure

This folder contains the AI Agent : Google calendar assistant using OpenAI workflow. Its executable nodes use agent, chatTrigger, googleCalendarTool, lmChatOpenAi, memoryBufferWindow. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.

Setup

Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.

Entry points

When chat message received

Verification

Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.

Attribution

https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Googlecalendartool/1247_Googlecalendartool_Stickynote_Automation_Triggered.json MIT; preserve source notices.

More in AI & research