You are helping me build the following AI agent workflow. ## Goal Lead-to-Client Pipeline with CRM: Monitors your Google Sheet for lead status changes to send booking or proposal emails, append new clients, and calculate delivery duration. ## Specification - What it does: You get automatic booking or proposal emails sent via Gmail the moment your Google Sheet shows a lead is qualified or awaiting a proposal. New clients are instantly added to your tracking sheet when deals close, and delivery duration metrics update automatically once projects are marked as delivered. - Trigger: Triggered by an event (Event ยท on Google Sheets edit) - Autonomy: Fully hands-off - Expected setup effort: about an afternoon - Tools/services involved: - Google Sheets: CRM data storage and trigger source - n8n: Workflow orchestration and branching logic - Gmail: Sending automated emails for lead stages - Code: Processing timestamps and calculating delivery duration ## Known pitfalls, handle each one explicitly in your implementation 1. Timestamp format mismatches often break calculations, so ensure all date strings are parsed using a consistent library like dayjs before computing differences. 2. Webhook security is critical for n8n endpoints, so enforce authentication headers or IP whitelisting to prevent unauthorized trigger requests. ## Reference implementation https://n8n.io/workflows/7514 (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/automated-lead-to-client-pipeline-with-crm/ via usecasesforagents.com