n8n workflow template · 6 nodes · OpenAI
AI Agent : Google calendar assistant using OpenAI is a free n8n workflow template that starts when a chat message is received and works with OpenAI and Google Calendar. It has 6 nodes, 4 of them AI nodes (Chat Trigger, OpenAI Chat Model, Window Buffer Memory and AI Agent). The notes inside the workflow say: “This node specifies the chat model used by the agent. In the template, the default LLM is gpt-4o for its high relevance.” To run it, you add your own credentials for Google Calendar OAuth2 and OpenAI API.
The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.
This node specifies the chat model used by the agent. In the template, the default LLM is gpt-4o for its high relevance.
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 and are dynamically filled by the AI.
The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.
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
This node configures the AI agent for interaction with Google Calendar. It includes the following features
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!)
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.
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
For example, let the AI agent add attendees to events it creates.
Use a variable for the calendar field and refine the prompts to suit your needs.
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 and 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
The 6 nodes in file order (sticky notes excluded). Branches and connections determine execution order in n8n:
Configure your own credentials after importing. Create each credential in n8n, then select it in the node.
Do you need somewhere to run it? Read our guide to self-hosted n8n.
We can adapt this workflow to your apps, data and process, then deploy and support it.
Contact Us