Google Calendar
Let agents list, create, and delete Google Calendar events on a user's behalf
Overview
Connect your agents to Google Calendar so they can list, create, and delete events on a user's behalf.
This integration covers Calendar only. For email automation, use Outlook Calendar and Email.
This integration uses OAuth 2.0 for secure authentication. Users authorize access once, and MagOneAI handles token management and refresh automatically. All credentials are stored in HashiCorp Vault.
OAuth setup for Google Workspace
Before agents can access Google services, you need to configure OAuth and users need to authorize access.
Configure Google OAuth credentials
In the Admin Portal, navigate to Integrations → Google Workspace. Enter your Google OAuth client ID and client secret. These are created in the Google Cloud Console for your project. The platform stores them securely in HashiCorp Vault.
Users authorize access
When a user first uses a Google tool, they're redirected to Google's OAuth consent screen. They authorize MagOneAI to access their calendar on their behalf.
Platform manages token storage and refresh
After authorization, MagOneAI stores the access token and refresh token in Vault. The platform automatically refreshes tokens before they expire — users never see credential errors.
Agents can now access Google services
Once authorized, agents can call Google Calendar tools on behalf of the user. Credentials are injected at runtime when tools execute.
OAuth tokens are stored securely in HashiCorp Vault. The platform handles token refresh automatically — users authenticate once and agents have ongoing access.
Google Calendar tools
Give your agents access to calendar management capabilities. Agents can read availability, create meetings, and manage events.
List events
Retrieve calendar events for a specific date range.
Parameters:
calendar_id(optional) — defaults to user's primary calendarstart_time— ISO 8601 datetime for range startend_time— ISO 8601 datetime for range endmax_results(optional) — maximum number of events to return
Returns: List of events with title, start time, end time, attendees, and location.
Example use case: "Show me all meetings this week so I can prepare for them."
Create event
Create a new calendar event with title, time, attendees, and optional details.
Parameters:
calendar_id(optional) — defaults to user's primary calendarsummary— event titlestart_time— ISO 8601 datetime for event startend_time— ISO 8601 datetime for event endattendees(optional) — list of email addressesdescription(optional) — event descriptionlocation(optional) — meeting location or video conference link
Returns: Created event details including event ID.
Example use case: "Schedule a 30-minute meeting with john@example.com tomorrow at 2pm to discuss the quarterly report."
Delete event
Remove a calendar event.
Parameters:
calendar_id(optional) — defaults to user's primary calendarevent_id— ID of the event to delete
Returns: Confirmation of deletion.
Example use case: "Cancel my meeting with the client tomorrow."
Usage in workflows
Google tools can be used in both Agent nodes (for intelligent, flexible execution) and Tool nodes (for deterministic execution).
Agent node example
System prompt:
You are a scheduling assistant. When asked to schedule meetings:
1. List existing events for the requested window to see what is already booked
2. Find a time slot that is free
3. Create the calendar event with the attendees and an agenda
Be proactive about suggesting alternative times if conflicts exist.User message:
Schedule a 1-hour meeting with john@example.com and sarah@example.com
sometime next week to discuss Q1 planning.The agent will:
- Use
list_eventsto see what is already on the calendar next week - Select a free time slot
- Use
create_eventto schedule the meeting, with both attendees invited
Google sends the invitation email itself when the event is created, so no email tool is involved.
Tool node example
For deterministic event creation, use a Tool node:
Tool: Create event Parameters:
summary:"Weekly Report Review - {{date}}"start_time:{{slot_start}}end_time:{{slot_end}}attendees:["john@example.com"]
The tool executes with exactly these parameters every time, using variable values from the workflow context.
Security and permissions
OAuth scopes
The Google Workspace integration requests these OAuth scopes:
https://www.googleapis.com/auth/calendar— full calendar access
Users see this permission when they authorize access.
Credential storage
All OAuth tokens are stored in HashiCorp Vault with:
- Encryption at rest using AES-256
- User-scoped access controls
- Automatic key rotation
- Audit logging for all access
Token refresh
Access tokens expire after 1 hour. MagOneAI automatically:
- Detects when a token is about to expire
- Uses the refresh token to obtain a new access token
- Updates the stored token in Vault
- Retries the failed tool call with the new token
Users never see "token expired" errors.
Troubleshooting
Symptoms: OAuth redirect fails or user sees error during authorization.
Solutions:
- Verify OAuth client ID and secret are correct in Admin Portal
- Check that authorized redirect URIs are configured in Google Cloud Console
- Ensure the OAuth consent screen is published (not in testing mode) for production use
Symptoms: Agent says events were created but they don't appear in Google Calendar.
Solutions:
- Verify the agent is using the correct
calendar_id(defaults to primary) - Check that the user's OAuth token has calendar scope
- Confirm timezone handling — ensure times are in ISO 8601 format with timezone
Symptoms: Tools fail with "quota exceeded" or rate limit errors.
Solutions:
- Google Calendar has rate limits per user per day
- Reduce the frequency of tool calls if hitting limits
- Consider caching calendar data instead of repeated queries
- Request higher quotas from Google if needed for your use case