Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Email Automation

Email Automation

Create freee draft invoices from order emails with Gmail and Claude Haiku

When a new email arrives, it handles email with Claude using Gmail.

What it does

## Turn order mails into freee invoice drafts, from the quotation A customer replies "we order as quoted (Q-0000000004), but 800 brochures instead of 1,000". The invoice is created in freee Invoice as unsent, from that quotation. Prices, tax rates and lines are copied from the quotation by code; the AI never sets a price. Claude only reads the mail: is it an order, for which quotation, which quantities change, quoting the words behind each. Code checks: the quotation exists and is open, it was not invoiced before (memo "From quotation ..."), the new quantities are written in the mail. Additions and anything unclear become "※要確認 / To check" lines without a price, or no invoice at all. ### Setup 1. A freee app with permissions for partners (read) and [請求書] all document types (read/write); freee Invoice in use. 2. n8n OAuth2 API credential for freee (auth URL https://accounts.secure.freee.co.jp/public_api/authorize, token URL .../public_api/token, authentication: Body). Also Gmail and Anthropic. 3. Fill Config and the Gmail search in New order mail. Try the form first.

The steps

  1. New order mail
  2. Read the mail
  3. Paste an order
  4. Read the form
  5. Config
  6. Read freee partners
  7. Find the customer
  8. Customer found?
  9. Read their quotations
  10. Pick the candidates
  11. Any quotation?
  12. Read each quotation
  13. Read their invoices
  14. Prepare the prompt

24 steps in total.

Similar automations