> ## Documentation Index
> Fetch the complete documentation index at: https://docs.altrina.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrations

Altrina integrates deeply with Google Workspace and can automate any web service through browser automation. This guide explains how to connect services and use them in your workflows.

## Getting Started

To connect Google Workspace:

1. Navigate to the **Integrations** page in your Altrina dashboard
2. Click **Connect** on the Google service you want to use
3. Complete the OAuth authentication flow
4. Grant the requested permissions
5. Once connected, the integration is available across all your workflows

All connected integrations appear in the Integrations page with their connection status.

## Google Workspace Integrations

Altrina provides native API integrations with Google Workspace services. Connect once via OAuth and access 50+ pre-built actions.

### Gmail (17+ Actions)

**Email Management:**

* `gmail_fetch_emails` - Search and retrieve emails with filters
* `gmail_fetch_message_by_id` - Get specific email details
* `gmail_fetch_message_by_thread_id` - Get entire email threads
* `gmail_create_email_draft` - Create email drafts
* `gmail_forward_message` - Forward emails programmatically

**Organization:**

* `gmail_add_label_to_email` - Add labels to organize emails
* `gmail_create_label` - Create new labels
* `gmail_list_labels` - Get all available labels
* `gmail_modify_thread_labels` - Bulk label operations
* `gmail_remove_label` - Remove labels from emails
* `gmail_move_to_trash` - Delete emails

**Advanced:**

* `gmail_get_attachment` - Download email attachments
* `gmail_get_contacts` - Access contact information
* `gmail_get_people` - Search people directory
* `gmail_get_profile` - Get user profile details

### Google Drive (16+ Actions)

**File Operations:**

* `googledrive_download_file` - Download any file
* `google_drive_copy_file` - Duplicate files
* `google_drive_create_file` - Upload new files
* `googledrive_create_file_from_text` - Create text files
* `google_drive_create_folder` - Organize with folders
* `googledrive_edit_file` - Modify existing files

**Search & Organization:**

* `googledrive_find_file` - Search for files by name or properties
* `googledrive_find_folder` - Locate folders
* `googledrive_files_modify_labels` - Tag and categorize files

**Sharing & Permissions:**

* `googledrive_add_file_sharing_preference` - Control access
* `googledrive_delete_permission` - Remove access
* `googledrive_create_shortcut_to_file` - Create shortcuts

**Collaboration:**

* `googledrive_create_comment` - Add comments to files
* `googledrive_create_reply` - Reply to comments
* `googledrive_delete_comment` - Remove comments

### Google Calendar (14+ Actions)

**Event Management:**

* `calendar_create_event` - Schedule new events
* `calendar_delete_event` - Remove events
* `calendar_list_events` - Get upcoming events
* `calendar_move_event` - Transfer events between calendars
* `calendar_find_event` - Search for specific events

**Calendar Operations:**

* `calendar_list_calendars` - Get all calendars
* `calendar_get_calendar` - Get calendar details
* `googlecalendar_clear_calendar` - Remove all events
* `googlecalendar_calendars_delete` - Delete calendars
* `googlecalendar_calendars_update` - Modify calendar settings

**Smart Scheduling:**

* `calendar_find_free_slots` - Find available meeting times
* `calendar_free_busy_query` - Check availability
* `calendar_get_current_datetime` - Get current time in timezone

## Browser-Based Automation

Beyond API integrations, Altrina can interact with **any web service** through intelligent browser automation:

### Universal Web Access

* Navigate to any website and interact as a human would
* Handle complex workflows across platforms without APIs
* Extract data from any webpage
* Fill forms and submit information
* Handle JavaScript-heavy applications

### Authentication

* Login to websites using credentials from your Knowledge Base
* Handle multi-factor authentication flows
* Manage session cookies across workflows
* Support for complex OAuth flows

### Use Cases

* Automate tasks on platforms without APIs
* Combine API actions with browser actions in the same workflow
* Extract data from protected or paywall content
* Interact with internal company tools
* Automate legacy web applications

## Using Integrations in Workflows

### In Directive Nodes

Reference integrations naturally in your directives:

```
"Check my Gmail for emails from john@example.com in the last week and create a summary"
```

```
"Upload the report.pdf from my knowledge base to Google Drive in the Reports folder"
```

```
"Find a free time slot next week on my calendar and create a meeting"
```

### In Action Nodes

Use specific action names with JSON parameters:

```json theme={null}
{
  "action": "gmail_fetch_emails",
  "params": {
    "query": "from:john@example.com after:2025/01/01",
    "max_results": 10
  }
}
```

### Combining with Browser Actions

Mix API integrations with browser automation in the same workflow:

1. Node 1: Use `gmail_fetch_emails` to get customer inquiries
2. Node 2: Browser directive to login to your CRM
3. Node 3: Use extracted data to fill CRM forms
4. Node 4: Use `googledrive_create_file` to save the report

## Authentication & Security

**OAuth Flow:**

* Altrina uses industry-standard OAuth 2.0
* Your credentials are never stored by Altrina
* Access tokens are encrypted and stored securely
* You can revoke access anytime from your Google account settings

**Permissions:**

* Altrina only requests minimum necessary permissions
* Gmail: Read, compose, modify, and organize emails
* Drive: Create, read, update files and folders
* Calendar: Manage events and calendars

**Token Management:**

* Tokens are automatically refreshed when expired
* Separate tokens per user for team accounts
* No cross-user access

## Troubleshooting

**Connection Failed:**

* Ensure you're using the correct Google account
* Check that popups aren't blocked in your browser
* Try disconnecting and reconnecting in Integrations page

**Permission Errors:**

* Re-authenticate to grant additional permissions
* Verify your Google Workspace admin hasn't restricted access
* Check if the specific action requires different permissions

**Actions Not Working:**

* Verify the integration shows "Connected" status
* Check action parameters match the expected format
* Review workflow run logs for specific error messages

## Support

For integration issues or questions:

* **Email**: [support@altrina.com](mailto:support@altrina.com)
* **Documentation**: Check action-specific docs in the Studio
* **Discord**: [Join our community](https://discord.gg/xVFu7Kp8T3)
