From recipe-skills
Gmail integration recipes for Workato. Enables AI agents to generate valid recipe JSON for Gmail operations including sending emails, listing/searching messages, managing labels, and message details.
How this skill is triggered — by the user, by Claude, or both
Slash command
/recipe-skills:gmail-recipesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **DEPENDENCY: Load the `workato-recipes` base skill first if not already loaded.**
DEPENDENCY: Load the
workato-recipesbase skill first if not already loaded. This skill requires the base Workato knowledge for triggers, control flow, datapills, and recipe structure.
You are now equipped with Gmail-specific knowledge for writing Workato recipes using the native Gmail connector.
.recipe.json files to understand local patternstemplates/ directory for validated exampleslist-emails-001, get-details-002["body", ...] wrapperWARNING: Gmail adhoc HTTP responses wrap data in
body. Always use paths like["body", "messages"]for list/search results.
With this skill loaded, you can:
This skill covers the native Gmail connector (gmail) which provides:
Important: The native Gmail connector is built on the Gmail REST API v1 with a hardcoded base URL (
https://www.googleapis.com/gmail/v1/users/). This means:
- 3 native actions + 1 trigger — covers send, get email/draft by ID, and download attachment
- Adhoc HTTP required for most operations: list/search emails, labels, user info, message modification, deletion, threads, drafts
- API version locked - Cannot access newer Gmail API features not in v1
If a user needs functionality not supported by the v1 API, recommend they:
- Check the Workato Community Library for updated Gmail connectors
- Consider building a custom SDK connector with the needed endpoints
- Use the HTTP connector with custom OAuth for full API flexibility
Note: Developers can build custom SDK connectors for Gmail with additional actions. See
workato-recipes/patterns/custom-connector-actions.mdfor custom connector patterns. Custom connectors are not included with Workato by default.
Use gmail for the native Gmail connector:
"provider": "gmail"
{
"keyword": "application",
"provider": "gmail",
"skip_validation": false,
"account_id": {
"zip_name": "my_gmail_account.connection.json",
"name": "My Gmail account",
"folder": ""
}
}
For adhoc HTTP actions, Gmail uses:
https://www.googleapis.com/gmail/v1/users/
Common paths:
me/messages - List messagesme/messages/{id} - Get message detailsme/labels - List labelsme/labels/{id} - Get/modify labelNative actions (like send_mail) return data without body wrapper:
"path": ["id"]
"path": ["threadId"]
"path": ["labelIds"]
Adhoc HTTP actions wrap responses in body:
"path": ["body", "messages"]
"path": ["body", "id"]
"path": ["body", "labelIds"]
The q parameter supports Gmail search operators:
from:[email protected] - From specific senderto:[email protected] - To specific recipientsubject:keyword - Subject contains keywordis:unread - Unread messagesis:starred - Starred messageshas:attachment - Has attachmentsafter:2024/01/01 - After datebefore:2024/12/31 - Before datelabel:INBOX - Has specific labelCombine with spaces: from:[email protected] is:unread has:attachment
For optional query parameters, use .presence || skip:
"input": {
"data": {
"maxResults": "=_dp('{...}').presence || skip",
"pageToken": "=_dp('{...}').presence || skip",
"q": "=_dp('{...}').presence || skip",
"labelIds": "=_dp('{...}').presence || skip"
}
}
The Gmail connector provides 3 native actions and 1 trigger. See lint-rules.json for the authoritative list of valid action and trigger names.
new_email — Fires when a new email arrives in the connected account.Native actions (use these when possible):
send_mail — Send an email (text or HTML) with optional attachments. See detail below.get_email_or_draft_by_id — Get full details of a single email or draft by message ID. Returns headers, body, labels, snippet.download_attachment — Download an attachment by message ID and attachment ID.Adhoc HTTP required for everything else:
__adhoc_http_action with GET me/messages and Gmail query syntax via the q parameter. See adhoc patterns below.me/labels endpoints.me/profile.me/messages/{id}/modify, me/messages/{id}/trash.me/threads, me/drafts.See patterns/gmail-api-reference.md for the full endpoint catalog.
Send an email with optional attachments:
{
"provider": "gmail",
"name": "send_mail",
"keyword": "action",
"input": {
"email_type": "html",
"to": "[email protected]",
"subject": "Email Subject",
"body": "<p>HTML content here</p>",
"from": "[email protected]",
"cc": "[email protected]",
"bcc": "[email protected]",
"reply_to": "[email protected]",
"attachments": {
"____source": "#{_dp('{...path to attachments array}')}",
"file_binary_content": "#{_dp('{...path to file content}')}",
"file_name": "#{_dp('{...path to file name}')}"
}
}
}
Email types:
"text" - Plain text email"html" - HTML formatted emailOutput fields:
id - Message IDthreadId - Thread IDlabelIds - Array of label IDs{
"provider": "gmail",
"name": "__adhoc_http_action",
"keyword": "action",
"input": {
"mnemonic": "List Emails",
"verb": "get",
"response_type": "json",
"path": "me/messages",
"input": {
"schema": "[...]",
"data": {
"maxResults": "=_dp('{...}').presence || skip",
"q": "=_dp('{...}').presence || skip"
}
},
"output": "[{\"name\":\"messages\",\"type\":\"array\",\"of\":\"object\",\"properties\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"threadId\",\"type\":\"string\"}]}]"
}
}
{
"provider": "gmail",
"name": "__adhoc_http_action",
"keyword": "action",
"input": {
"mnemonic": "Get Message Details",
"verb": "get",
"response_type": "json",
"path": "me/messages/#{_dp('{...message_id}')}",
"output": "[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"threadId\",\"type\":\"string\"},{\"name\":\"labelIds\",\"type\":\"array\",\"of\":\"string\"},{\"name\":\"snippet\",\"type\":\"string\"},{\"name\":\"payload\",\"type\":\"object\",\"properties\":[...]}]"
}
}
Gmail's list endpoint returns minimal data (just IDs). To get full details, use a foreach loop:
See templates/list-emails.json for a complete example.
Wrap Gmail operations in try/catch for robust error handling:
{
"keyword": "try",
"block": [
// Gmail operations
]
},
{
"keyword": "catch",
"block": [
// Return error response
]
}
See validation-checklist.md for Gmail-specific validation, which references the base checklist in workato-recipes/validation-checklist.md.
skills/workato-recipes/SKILL.md - Base platform knowledgeskills/gmail-recipes/patterns/native-gmail-actions.md - Native action detailsskills/gmail-recipes/patterns/gmail-api-reference.md - API endpoint referenceskills/gmail-recipes/templates/ - Validated recipe templatesAsk the user for these details:
Gmail connection name - What is their Gmail connection called?
Operation type - Send, list, search, or manage labels?
Trigger type - API endpoint, scheduler, or event-driven?
npx claudepluginhub workato-devs/recipe-skills --plugin recipe-skillsCreates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.