Quick overview
This workflow monitors Gmail for labeled emails with image attachments, uses the Google Gemini API to translate text inside each image into multiple languages, uploads the translated images to a shared Google Drive folder, and replies to the original email thread with the folder link and any failures.
How it works
- Polls Gmail every minute for emails matching the search query (has attachments, labeled
image-translate, and not sent by you) and downloads the attachments.
- Loads the configured Google Drive parent folder ID, target language list, and Gemini model, then checks whether the email contains any image attachments.
- Creates a new Google Drive folder for the email (named from the subject and timestamp) and shares it as “anyone with the link” (read-only).
- Builds a translation request for each combination of image attachment and target language and sends each request to the Google Gemini API to generate an edited image with translated text.
- Extracts the returned image from each Gemini response, uploads successful translations to the shared Google Drive folder, and tracks any translation or upload failures.
- Replies in the same Gmail thread with the Google Drive folder link plus a summary of how many translations succeeded and a list of items that failed.
Setup
- Connect Gmail OAuth2 credentials (to read and reply to emails) and Google Drive OAuth2 credentials (to create, share, and upload files).
- Provide a Google Gemini (PaLM) API credential (or n8n AI Gateway-managed Gemini access) for the HTTP request to the Generative Language API.
- Create and apply a Gmail label named
image-translate (and ensure incoming requests you want processed receive this label).
- In the configuration step, set
parentFolderId to your destination Google Drive folder ID and adjust the languages list and model (for example gemini-2.5-flash-image) as needed.
Additional info
Get support to deploy, adapt, or extend this automation for you. I can tailor the workflow to your existing tools, business process, and technical requirements, helping you launch a reliable solution faster.