You are helping me build the following AI agent workflow. ## Goal Email Management: Auto-Delete Marketing & AI Replies: Automatically deletes marketing emails while logging them to Google Sheets and drafts AI replies for genuine messages. ## Specification - What it does: You instantly clear your inbox of marketing spam by having the agent delete those emails while logging them in Google Sheets for your records. For genuine messages that need a response, you get polite AI-drafted replies ready to send without lifting a finger. - Trigger: Triggered by an event (Event ยท on new email via IMAP) - Autonomy: Fully hands-off - Expected setup effort: about an afternoon - Tools/services involved: - n8n: Workflow orchestration and automation logic - Gmail: Reading, deleting, and replying to emails - Google Gemini: Classifying email type and generating replies - Google Sheets: Logging deleted and replied emails for auditing ## Known pitfalls, handle each one explicitly in your implementation 1. AI classification errors can delete important emails so always verify confidence scores or add a manual review step for low-confidence results. 2. Sensitive data exposure risks arise if PII is sent to external AI models so mask personal identifiers in the prompt payload before sending. ## Reference implementation https://n8n.io/workflows/7551 (workflow template) Fetch and inspect this before building. If it matches my stack, adapt it; if not, rebuild the pattern with my tools. ## Process requirements 1. Before building: ask me which of the listed tools I actually use and what my platform is (n8n / Make / code / other). Do not assume. 2. Adapt the pattern to my answers; do not force the reference stack. 3. Address every pitfall above; tell me how you handled each. 4. Provide a test plan I can run before letting this touch real data. 5. Ask before any step that sends messages, modifies data, or spends money. Source: https://usecasesforagents.com/use-case/email-management-auto-delete-marketing-ai-replies/ via usecasesforagents.com