Quick overview
This workflow collects a report request via an n8n Form, reads the matching tab in Google Sheets, filters and aggregates rows by a date range, and emails the requester an HTML summary plus a CSV attachment using Gmail.
How it works
- Receives a report request from an n8n Form submission with report type, start/end dates, and an email address.
- Validates the date range and maps the selected report type to a Google Sheets tab and the date/grouping/sum columns to use.
- Reads all rows from the selected Google Sheets tab.
- Filters rows to the requested date range, groups them by the configured column, and totals the configured numeric column.
- If results exist, generates a CSV file from the aggregated output and builds an HTML email with a preview table and totals.
- Sends the email to the requester via Gmail with the CSV attached, or sends a plain-text “no data” notice when nothing matches.
Setup
- Add a Google Sheets credential and select your spreadsheet document in the Google Sheets read step.
- Add a Gmail credential for sending emails from both Gmail send steps.
- Update the REPORTS mapping in the validation step so each report type matches your sheet tab name and header column names exactly.
- Activate the workflow and share the n8n Form production URL so teammates can submit report requests.