Skip to Content
IntegrationsGoogle Integration

Google Integration

Google (Gmail, Calendar, and Drive) is Town’s core integration. It’s required for your assistant to function.

What’s included

Gmail access

Your assistant can:

  • Read emails — Access email content and metadata
  • Search emails — Use Gmail search syntax
  • Manage labels — Create, add, remove labels
  • Archive/trash — Organize emails
  • Send emails — Send and reply to emails
  • Create drafts — Prepare emails for review
  • Access attachments — Download and process attachments

Google Calendar

Your assistant can:

  • List events — See upcoming calendar events
  • Get event details — Access specific event information
  • Create events — Schedule meetings with attendees and Google Meet
  • Edit events — Modify events or RSVP to invitations
  • Delete events — Cancel or remove events

Google Drive

Your assistant can:

  • Read files — Access documents and spreadsheets
  • Write files — Create and update content
  • Search Drive — Find files across your Drive

Connecting Gmail

First-time setup

  1. Sign up for Town
  2. Click Connect Gmail Account
  3. Select your Google account
  4. Review and approve permissions
  5. You’re connected!

Adding additional accounts

  1. Go to Settings → Accounts
  2. Click Add Account
  3. Complete the OAuth flow
  4. New account is now available

Required permissions

Town requests these Google scopes:

PermissionPurpose
Read emailYour assistant reads and analyzes emails
Send emailYour assistant sends emails (with approval in HITL)
Manage labelsOrganize and filter emails
Calendar accessView and manage calendar events
Drive accessRead and write documents and files

Town uses OAuth — your password is never stored. You can revoke access anytime from your Google Account settings.

Gmail tools

ToolDescription
read_emailRead full email content
search_emailsSearch using Gmail syntax
search_emails_analyzedAI-filtered search results

Organize

ToolDescription
add_labelAdd label to email
remove_labelRemove label from email
archive_emailArchive (remove from inbox)
trash_emailMove to trash
move_emailMove to specific label
list_labelsList available labels

Send

ToolDescription
send_email_to_userSend to account owner only
create_draftCreate draft for review

Attachments

ToolDescription
list_attachmentsList email attachments
get_attachment_to_sandboxDownload for processing

Calendar tools

ToolDescription
list_calendar_eventsGet events in time range
get_calendar_eventGet specific event details
create_calendar_eventCreate events with attendees and Google Meet
edit_calendar_eventEdit events or RSVP to invitations
delete_calendar_eventDelete/cancel calendar events

Delete with caution. If you are the organizer, delete_calendar_event will cancel the event for ALL attendees. If you’re just an attendee, it only removes the event from your calendar.

Drive tools

ToolDescription
read_fileRead file contents
write_fileCreate or update files
read_spreadsheetRead Google Sheets data
update_sheet_dataUpdate spreadsheet cells
read_docRead Google Docs content
update_docUpdate document content

Gmail search syntax

The search_emails tool uses Gmail’s search syntax:

QueryMeaning
from:john@example.comFrom specific sender
to:meSent directly to you
subject:meetingSubject contains word
has:attachmentHas attachments
is:unreadUnread emails
is:starredStarred emails
in:inboxIn inbox (not archived)
newer_than:7dFrom last 7 days
older_than:1mOlder than 1 month
label:importantHas specific label

Combine with AND (space) or OR:

from:john@example.com subject:report newer_than:30d

Multiple accounts

When you have multiple Gmail accounts:

Per-account triggers

Configure triggers to fire for specific accounts or all accounts.

Account context

When a workflow runs, it has access to the triggering account’s:

  • Email address
  • Labels
  • Calendar
  • Drive
  • Sent mail history

Managing accounts

In Settings → Accounts:

  • View connected accounts — See all Gmail accounts
  • Set primary — Default account for new workflows
  • Remove account — Disconnect an account
  • Re-authorize — Fix permission issues

Troubleshooting

Permission errors

If workflows fail with permission errors:

  1. Go to Settings → Accounts
  2. Click Re-authorize on the account
  3. Complete the OAuth flow again

Rate limits

Gmail has API rate limits. If you see rate limit errors:

  • Reduce trigger frequency
  • Space out scheduled workflows
  • Use queue-based processing

Missing emails

If workflows aren’t seeing emails:

  • Check the account scope in triggers
  • Verify search queries are correct
  • Check if emails are in trash/spam
Last updated on