Google Flow
Comprehensive Google Workspace integration for Gmail, Sheets, Docs, and Drive operations.
How to Use
Input Requirements
To configure Google operations, you need:
- Authentication Token: Required for all Google services
- Operation Type: Specify which Google service and action to perform
- Service-Specific Parameters: Based on the operation you want to execute
Supported Google Services
Gmail Operations
Send Email{
"operation": "send",
"to": "recipient@example.com",
"subject": "Meeting Reminder",
"body": "Don't forget about our meeting tomorrow at 2 PM"
}
{
"operation": "list",
"from": "manager@company.com",
"status": "unread"
}
{
"operation": "search",
"query": "from:client@company.com subject:invoice",
"maxResults": 10
}
Google Sheets Operations
Create New Spreadsheet{
"operation": "create",
"title": "Q4 Sales Report"
}
{
"operation": "read",
"spreadsheetId": "1CXvP-ZBQKbQl4WYIxTeSJxxOFTchXUwBIM2kXXsLluw",
"range": "A1:C10"
}
{
"operation": "write",
"spreadsheetId": "1CXvP-ZBQKbQl4WYIxTeSJxxOFTchXUwBIM2kXXsLluw",
"range": "A1:C3",
"values": [
["Product", "Sales", "Revenue"],
["Laptop", "150", "$149,850"],
["Phone", "320", "$255,680"]
]
}
{
"operation": "append",
"spreadsheetId": "1CXvP-ZBQKbQl4WYIxTeSJxxOFTchXUwBIM2kXXsLluw",
"range": "A:C",
"values": [["Tablet", "89", "$26,700"]]
}
Google Docs Operations
Create New Document{
"operation": "create",
"title": "Project Proposal"
}
{
"operation": "read",
"documentId": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"
}
{
"operation": "write",
"documentId": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
"content": "Executive Summary\n\nThis proposal outlines our strategy for Q1 2024..."
}
{
"operation": "append",
"documentId": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
"content": "\n\nConclusion\n\nBased on market analysis, we recommend proceeding with this initiative."
}
Google Drive Operations
Upload File with Content{
"operation": "upload",
"name": "monthly-report.pdf",
"parentFolder": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74Og",
"content": "Base64 encoded file content or file path",
"mimeType": "application/pdf"
}
What You Get Back
Gmail Responses
- Send Email: Confirmation with message ID
- List/Search: Array of email objects with subject, sender, date, read status
- Read: Full email content including attachments info
Google Sheets Responses
- Create: New spreadsheet ID and URL
- Read: 2D array of cell values
- Write/Append: Confirmation with updated range info
Google Docs Responses
- Create: New document ID and URL
- Read: Full document text content
- Write/Append: Confirmation with character count
Google Drive Responses
- Upload: File ID, download URL, and metadata
Configuration Examples
Email Automation Workflow
Input: Customer support ticket received Configuration:
{
"operation": "send",
"to": "customer@example.com",
"subject": "Support Ticket #12345 - Received",
"body": "Thank you for contacting us. We've received your ticket and will respond within 24 hours."
}
Data Collection to Sheets
Input: Sales data from POS system Configuration:
{
"operation": "append",
"spreadsheetId": "1CXvP-ZBQKbQl4WYIxTeSJxxOFTchXUwBIM2kXXsLluw",
"range": "Sales!A:E",
"values": [["2024-01-15", "Product A", "150", "$4,500", "Store 1"]]
}
Report Generation
Input: Monthly analytics data Configuration:
{
"operation": "create",
"title": "January 2024 Analytics Report"
}
Use Cases
Business Operations
- Email notifications: Automated customer communications
- Data reporting: Generate spreadsheets from system data
- Documentation: Create and update business documents
- File management: Upload reports and documents
Workflow Automation
- Lead management: Track prospects in Google Sheets
- Customer support: Automated email responses
- Content creation: Generate documents from templates
- Data backup: Store important files in Google Drive
Team Collaboration
- Meeting notes: Create shared documents
- Project tracking: Update project sheets automatically
- File sharing: Upload and organize team files
- Communication: Send targeted email updates
Technical Details
Authentication Requirements
All Google operations require a valid OAuth 2.0 token with appropriate scopes:
- Gmail:
https://www.googleapis.com/auth/gmail.send
,https://www.googleapis.com/auth/gmail.readonly
- Sheets:
https://www.googleapis.com/auth/spreadsheets
- Docs:
https://www.googleapis.com/auth/documents
- Drive:
https://www.googleapis.com/auth/drive.file
API Endpoints
Gmail API
- Base URL:
https://gmail.googleapis.com/gmail/v1/
- Send:
POST /users/me/messages/send
- List:
GET /users/me/messages
- Search:
GET /users/me/messages?q={query}
Google Sheets API
- Base URL:
https://sheets.googleapis.com/v4/spreadsheets/
- Create:
POST https://sheets.googleapis.com/v4/spreadsheets
- Read:
GET /{spreadsheetId}/values/{range}
- Write:
PUT /{spreadsheetId}/values/{range}
- Append:
POST /{spreadsheetId}/values/{range}:append
Google Docs API
- Base URL:
https://docs.googleapis.com/v1/documents/
- Create:
POST https://docs.googleapis.com/v1/documents
- Read:
GET /{documentId}
- Write:
POST /{documentId}:batchUpdate
Google Drive API
- Base URL:
https://www.googleapis.com/drive/v3/
- Upload:
POST /files
- List:
GET /files
Error Handling
Common Errors
- 401 Unauthorized: Invalid or expired authentication token
- 403 Forbidden: Insufficient permissions for requested operation
- 404 Not Found: Spreadsheet, document, or file doesn't exist
- 429 Too Many Requests: Rate limit exceeded
Error Response Format
{
"error": {
"code": 403,
"message": "The caller does not have permission",
"status": "PERMISSION_DENIED"
}
}
Rate Limits
- Gmail: 1 billion quota units per day
- Sheets: 300 requests per minute per project
- Docs: 300 requests per minute per project
- Drive: 1,000 requests per 100 seconds per user
Response Formats
Gmail List Response
{
"messages": [
{
"id": "17a1b2c3d4e5f6g7",
"threadId": "17a1b2c3d4e5f6g7",
"snippet": "Email preview text..."
}
],
"nextPageToken": "token_for_next_page"
}
Sheets Read Response
{
"range": "Sheet1!A1:C3",
"majorDimension": "ROWS",
"values": [
["Header 1", "Header 2", "Header 3"],
["Value 1", "Value 2", "Value 3"],
["Value 4", "Value 5", "Value 6"]
]
}
Docs Create Response
{
"documentId": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
"title": "New Document",
"body": {
"content": [...]
}
}
Drive Upload Response
{
"id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
"name": "uploaded-file.pdf",
"mimeType": "application/pdf",
"size": "1048576",
"webViewLink": "https://drive.google.com/file/d/ID/view"
}
Integration Patterns
Automated Reporting
// 1. Read data from source
const sourceData = await fetchAnalyticsData();
// 2. Create new spreadsheet
const sheet = await googleFlow({
operation: "create",
title: `Report ${new Date().toISOString().split('T')[0]}`
});
// 3. Write data to sheet
await googleFlow({
operation: "write",
spreadsheetId: sheet.spreadsheetId,
range: "A1:Z100",
values: sourceData
});
Email-to-Document Workflow
// 1. Search for specific emails
const emails = await googleFlow({
operation: "search",
query: "subject:feedback",
maxResults: 50
});
// 2. Create document for compiled feedback
const doc = await googleFlow({
operation: "create",
title: "Customer Feedback Compilation"
});
// 3. Append each email to document
for (const email of emails) {
await googleFlow({
operation: "append",
documentId: doc.documentId,
content: `\n\n${email.subject}\n${email.body}`
});
}
Security Considerations
- Token Management: Store authentication tokens securely
- Scope Limitation: Request only necessary permissions
- Data Validation: Validate all input data before API calls
- Error Logging: Log errors without exposing sensitive data
- Rate Limiting: Implement client-side rate limiting to prevent quota exhaustion
Performance Optimization
- Batch Operations: Use batch requests for multiple operations
- Caching: Cache frequently accessed data
- Pagination: Handle large datasets with proper pagination
- Async Processing: Use asynchronous operations for better performance