Manage Google Calendar events with n8n AI Agent (Get, Create, Delete)
Pass natural-language commands from a parent workflow to a sub-agent, letting an LLM choose the right Google Calendar tool to list, create, or delete events
- Who
- Automation users who want to build a calendar assistant in n8n and delegate Google Calendar operations to an AI Agent
- You get
- After the parent workflow sends a natural-language instruction, the sub-agent automatically selects Get/Create/Delete tools for the target calendar and returns the result
- You need
- n8n · openai · google-calendar · memory
Constraints
Prerequisites: n8n instance (CE is fine), OpenAI API key, Google Calendar OAuth2 credentials, target calendar ID. This template is a sub-workflow invoked by a parent workflow via an Execute Workflow node. Inputs are `text` (user instruction) and `sessionid` (session identifier for short-term memory). Cost: n8n CE is free; OpenAI and Google Calendar are pay-per-use.
What they did
Author ca7ai published a sub-workflow template in the n8n template library to serve as a calendar tools layer for a parent agent. The sub-workflow receives `text` and `sessionid` via an Execute Workflow Trigger, then uses an AI Agent (gpt-4.1-mini) with a systemMessage to choose among Get, Create, and Delete tools for Google Calendar, while Simple Memory maintains short-term memory keyed by sessionid.
How it went
The template description provides test examples: sending "Schedule 'Team Sync' tomorrow 10:00--11:00" should trigger Create; "List events next week" should trigger Get with a time range; "Delete event 'Team Sync'" should trigger Delete after matching eventId. (Source: author report; not tested by this site.)
Worth knowing
1. This is a sub-workflow and cannot run standalone; it must be called by a parent workflow. 2. The systemMessage contains "If you need to create events in the calendar use the 'Get' tool" which appears to be a typo; interpret by actual node function during setup. 3. The calendar placeholder in workflow.json is [email protected] and must be replaced with a real calendar ID before running. 4. Create requires start, end, and summary; Delete requires eventId; Get supports timeMin/timeMax range queries. 5. Memory is isolated by sessionid; different sessionids are treated as separate sessions.
n8n workflow template
Structure checked · Not run-testedUse “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.
Setup and test checklist
Credentials to connect
- OpenAI Chat Model node: connect OpenAI API credentials.
- Create node: connect Google Calendar OAuth2 credentials.
- Get node: connect Google Calendar OAuth2 credentials.
- Delete node: connect Google Calendar OAuth2 credentials.
Configuration to replace
- Source template is n8n public workflow #7787 (~9 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
- Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.
Test input and expected output
- Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
- Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.
Template changes
- Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
- No business-logic edits; verify keys, quotas and privacy compliance before use.
Template retrieved: 2026-10-24
Steps
Import template and declare inputs
Import this sub-workflow template into n8n. Open the "When Executed by Another Workflow" trigger node and confirm it exposes two inputs: `text` (string, natural-language user instruction) and `sessionid` (string, for session isolation).
Configure Google Calendar credentials and calendar
Open each of the three Google Calendar tool nodes (Get, Create, Delete). In every node, select your Google Calendar OAuth2 credential and replace the calendar placeholder (e.g., `[email protected]`) with the actual calendar ID. Set Get node operation to getAll; Create node requires start, end, and summary to be filled by the AI; set Delete node operation to delete, which requires eventId.
Configure AI Agent and connect parent workflow
Open the AI Agent node and confirm promptType is define and the text expression is `={{ $json.text }}`. Connect the OpenAI Chat Model (gpt-4.1-mini) and Simple Memory (sessionKey `={{ $json.sessionid }}`) to the AI Agent's corresponding interfaces. Connect the parent workflow's toolWorkflow node to this sub-workflow.
Execution prompt · Source text。AI Agent node options.systemMessage field
=You are a calendar assistant who can easily manage events in a google calendar. You must provide the start and end date. If you need to create events in the calendar use the "Get" tool. To delete events in the calendar use "Delete", and to create events use the "Create" tool. the current date and time is {{ $now}} Additionally, you must provide the summary and other details for the calendar which your tool might need.
Prompt you can copy
Setup guidance · Editorial suggestion。Hand to setup assistant; confirm inputs and permissions before proceeding step by step
This block is the prompt. Ads are never placed here.
You are building an n8n sub-workflow that lets an AI Agent act on Google Calendar. First confirm you have: 1) OpenAI API key; 2) Google Calendar OAuth2 credentials; 3) target calendar ID. Then import the template, configure credentials and calendar in the three tool nodes, set the AI Agent systemMessage, and test Get/Create/Delete from the parent workflow.
The systemMessage says "If you need to create events in the calendar use the 'Get' tool" which appears to be a typo in the original; interpret according to actual tool purpose during setup
Source
Manage Google Calendar events with OpenAI Assistant (Get, create, delete) · ca7ai · n8n.io · 2025-08-24
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.