You are helping me build the following AI agent workflow. ## Goal Auto-Send PDF Invoices From Stripe: When a Stripe payment succeeds, the agent generates a professional PDF invoice and emails it to the customer automatically. ## Specification - What it does: You get paid faster because your agent instantly creates a professional PDF invoice and emails it to customers whenever a Stripe payment succeeds. This automatic process handles extracting details and sending the attachment via Gmail without needing any manual work from you after setup. - Trigger: Triggered by an event (Event ยท on new payment) - Autonomy: Fully hands-off - Expected setup effort: about an afternoon - Tools/services involved: - Stripe: Payment webhook trigger - Code: Data normalization and HTML generation - Gmail: Sending invoice emails ## Known pitfalls, handle each one explicitly in your implementation 1. Stripe sends amounts in cents so you must divide by 100 and format as currency before displaying them in the HTML template. 2. Gmail API requires valid OAuth scopes for send_mail which can cause authentication failures if not pre-configured correctly. 3. Large PDF attachments might exceed Gmail size limits so ensure the generated file is compressed or under the 25MB threshold. ## Reference implementation https://n8n.io/workflows/8030 (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/auto-send-pdf-invoices-from-stripe/ via usecasesforagents.com