Multilingual Gmail support drafts with Slack triage

By General Input

When a non-English support email lands in Gmail, an agent translates it, drafts a reply in the customer's language, and pings Slack with the gist.

Integrations

  • Gmail
  • AI Generation
  • Slack Bot

Type

Agentic Task

Categories

  • Customer Support
  • Operations

I want an agent that helps my English-speaking support team handle customers who email us in other languages. It should watch a designated Gmail support inbox or label, and whenever a new non-English email lands, translate it, draft a reply in the customer's language, and let a human sanity-check and send.

Trigger: poll Gmail for new messages in the support inbox. Expose the Gmail label or search query as a workflow parameter, so I can point it at something like a Support label or a search such as in:inbox is:unread newer_than:1h. Default to the 20 newest unread messages per run so a backlog can't blow things up.

On each new message the agent should:

1. Use Gmail Get a Message to pull the full body, subject, sender, and thread ID. Decode the body to plain text before sending it to the model.

2. Send the email to AI Generation (chat-completion) with one structured prompt that returns JSON containing: (a) detected_language as the ISO code and human name of the customer's language; (b) is_english as a boolean; (c) english_translation of the full email body; (d) english_summary as a single sentence describing what the customer wants; (e) urgency tagged as urgent, normal, or low based on cues like outage language, billing failures, deadlines, or escalation threats; (f) english_reply, a clear and on-brand draft response in English. The voice and policy note (tone, signature, never-promise list, reply length cap) should be a workflow parameter the user fills in, and the system prompt should tell the model to preserve product names and proper nouns verbatim.

3. If is_english is true, skip the rest of the workflow for this message. Do not create a draft, do not post to Slack, do not change labels. The whole point is to only act when translation is actually needed.

4. Otherwise, make a second AI Generation call that translates english_reply back into the customer's detected_language. Tell the model to match the customer's tone and formality, keep product names and proper nouns untouched, and not add any explanation, only the translated reply body.

5. Use Gmail Create a Draft to attach the translated reply as a draft on the original thread. Set the In-Reply-To and References headers and the threadId so it threads correctly, and address the draft to the original sender. A human will open Gmail and hit send. Never auto-send.

6. Use Gmail Modify Message Labels to add a review label to the original message, defaulting to Translated / Needs review. Make the label name a workflow parameter and have the agent create the label on first run if it does not exist, so the same thread is not processed twice on the next poll.

7. Use Slack Bot Send a Message to post a heads-up in our support triage channel. The message should include the customer's name and email, the detected language (human name), the urgency tag, the one-sentence english_summary of what they are asking, and a direct link back to the Gmail thread so the on-call teammate can jump in, read the translated draft, and send. The triage channel ID is a workflow parameter.

Configurable inputs to expose at the top of the workflow:

- Gmail label or search query that defines the support inbox - Voice and policy note (tone, signature, never-promise list, reply length cap) - Max messages processed per run (default 20) - Slack triage channel ID - Review label name (default Translated / Needs review)

Guardrails: never auto-send, only ever leave a draft for a human to send; never modify or delete the customer's original message beyond adding the review label; if the model is uncertain about the detected language or the translation, still leave the draft but say so in the Slack message so the reviewer knows to look closely; and always do the customer-facing reply in their original language, never reply in English to a non-English email.

Related prompts

Explore more prompts
Win back LiveChat visitors whose chats went unansweredA brand asset library your marketing team actually searchesTurn Mailjet email clicks into ranked HubSpot follow-upsClean out the Looker dashboards and Looks nobody opensLiveKit live operations console for room moderationWake up dormant Keap leads with a researched reasonLiveChat coverage board for planning next week's shiftsPhone routing control panel for LiveKit voice agentsLinkedIn Ads budget pacing dashboard for every client accountGive your team Looker numbers without buying more seats