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

Qualify bilingual leads with OpenAI, Google Sheets, and Gmail

When a form is submitted, it handles email with OpenAI / ChatGPT using Gmail, Google Sheets.

What it does

## Log, gate and route Parse Score and Prepare Rows prepares a Leads row for each submission, plus a Rejected or Review row when applicable. Write One Tab at a Time sends one row per loop iteration to Append Lead and Audit Rows. Its done output passes accumulated write results to Build Safe Delivery Tasks. The Sheets node uses explicit column mappings and RAW cell format. Build Safe Delivery Tasks checks returned errors, row count and submission IDs. A detected logging failure creates an owner-only failure task and blocks lead acknowledgments. Partial writes are possible; successful logging is not guaranteed during API failures. Route Score and Intent has five rules: hot, warm, cold, review and failure. Hot creates an owner alert containing the lead message, score and AI summary, plus a personalized lead acknowledgment. Warm creates a lead acknowledgment with a question. Cold creates a generic lead acknowledgment. Review/failure tasks go only to the owner. Rejected matches no rule and stops after logging attempts. Generated HTML escapes lead text; Arabic templates set lang=ar and dir=rtl and include UTF-8 metadata. Actual MIME encoding and client rendering need a live Gmail test. Detect Unconfirmed Email Sends checks Gmail errors or a missing message ID and attempts one owner alert. If Gmail itself is unavailable, that alert may fail and the final node leaves an execution error. No automatic resend of lead emails is configured. Check execution data and Gmail Sent before retrying. Sheet status is the routing decision, not delivery confirmation.

The steps

  1. Receive Lead Form
  2. Config
  3. Clean and Validate Lead
  4. Accept Valid Lead
  5. Score Lead with OpenAI
  6. Parse Score and Prepare Rows
  7. Append Lead and Audit Rows
  8. Build Safe Delivery Tasks
  9. Route Score and Intent
  10. Send Routed Emails
  11. Detect Unconfirmed Email Sends
  12. Alert Owner of Delivery Failure
  13. Write One Tab at a Time
  14. OpenAI Chat Model

Similar automations