See llms.txt for all machine-readable content.

Back to Templates

Answer Japanese contact forms with OpenAI, Microsoft Teams and Gmail

Quick overview

This workflow collects inquiries from an n8n form, matches them to FAQ entries stored in an n8n Data Table, drafts and keigo-checks a Japanese business email using OpenAI, posts it to Microsoft Teams for approval, and sends the approved reply via Gmail while logging the outcome.

How it works

  1. Receives a new inquiry via an n8n form submission.
  2. Loads all FAQ rows from the keigo_faq n8n Data Table, combines them, and adds your company name, signature, and the submitted contact details.
  3. Uses OpenAI to classify the inquiry into a category and applies category-specific reply guidance, skipping messages classified as sales pitch or spam.
  4. Selects up to three relevant FAQ entries by matching keyword hits in the message and compiles them into a single FAQ text block.
  5. Uses OpenAI to generate a structured Japanese keigo email draft (subject, body, urgency, and staff check points) using only the matched FAQ content, then runs a second OpenAI pass to correct keigo issues and list the fixes.
  6. Posts the checked draft, fixes, and FAQ topics to Microsoft Teams via an incoming webhook with a link to an approval form.
  7. Waits for a reviewer to edit and approve the subject/body in the form, then sends the reply through Gmail if approved or skips sending if rejected.
  8. Logs the decision (sent or skipped) with email, company, category, subject, and timestamp to the keigo_reply_log n8n Data Table.

Setup

  1. Create two n8n Data Tables named keigo_faq (columns: topic, keywords, answer) and keigo_reply_log (columns: email, company, category, subject, status, logged_at).
  2. Add an OpenAI credential for the Chat Model node (configured for gpt-5-mini).
  3. Add a Gmail OAuth2 credential with permission to send mail from the account you want to reply from.
  4. Create a Microsoft Teams Workflows (or compatible) incoming webhook and paste its URL into the Teams webhook HTTP request node.
  5. Replace the default company_name and signature values with your own, and populate keigo_faq with your real FAQ topics, keywords, and answers (optionally run the sample FAQ loader once to seed example rows).