We're excited to announce two new actions that bring Google Workspace integration to Mechanic: the
Google Drive action
and the
Google Sheets action
!
Google Drive Action
Upload files in Google Drive directly from your Mechanic tasks. The Google Drive action supports:
Example usage:
{% action "google_drive" %}
{
"account": "user@example.com",
"uploads": {
"overwrite": true,
"simple.txt": "This is a simple text file",
"report.pdf": {
"pdf": {
"html": "<h1>Monthly Report</h1><p>This is a PDF generated from HTML</p>"
}
}
}
}
{% endaction %}
Google Sheets Action
Interact with the Google Sheets API!
1. Append Rows
Add new rows to existing spreadsheets:
{% action "google_sheets" %}
{
"account": "user@example.com",
"operation": "append_rows",
"spreadsheet_id": "your-spreadsheet-id",
"sheet_name": "Sheet1",
"rows": [
["Column1", "Column2", "Column3"],
["Value1", "Value2", "Value3"]
]
}
{% endaction %}
2. Create Spreadsheet
Create new spreadsheets with initial data:
{% action "google_sheets" %}
{
"account": "user@example.com",
"operation": "create_spreadsheet",
"title": "New Spreadsheet",
"rows": [
["Column1", "Column2", "Column3"]
]
}
{% endaction %}
3. Export Spreadsheet
Export spreadsheets in multiple formats:
{% action "google_sheets" %}
{
"account": "user@example.com",
"operation": "export_spreadsheet",
"spreadsheet_id": "your-spreadsheet-id",
"file_type": "xlsx" # Supports xlsx, csv, pdf, html, ods, tsv
}
{% endaction %}
Getting Started
To use these actions:
  1. Navigate to your Mechanic account settings
  2. Click on Authentication
  3. Connect your Google account
These actions follow Google's rate limits and best practices, ensuring reliable performance for your automation tasks.
For detailed documentation and more examples, visit our docs.
Check out the demonstration tasks in the task library: Google Drive and Google Sheets.