Gmail AI reply drafts in the sender's language, including Arabic RTL (Claude/OpenAI)

I built a workflow that writes reply drafts for new Gmail emails, right inside the same thread. Nothing is sent automatically; I review and hit Send.

How it works

  • Gmail Trigger → AI decides if the email needs a personal reply (newsletters and notifications are skipped)
  • Basic LLM Chain + Structured Output Parser with auto-fix, so the JSON format stays reliable
  • Draft is created in the original thread, in the sender’s language
  • Right-to-left languages (Arabic, Hebrew) display correctly: the reply is sent as HTML with dir=“auto” on each line
  • It never invents prices or dates; it leaves [CONFIRM …] placeholders instead
  • The email content is wrapped as untrusted data, so prompt-injection emails get no reply

Lessons learned

  • Plain-text drafts break RTL alignment in Gmail; HTML with dir=“auto” fixes it
  • Connecting the same model to the output parser (auto-fix) rescues the rare malformed response

Happy to answer questions about any part of the setup.

The full template with an English/Arabic setup guide: Gmail AI Reply Drafts — n8n Template (Claude or OpenAI)