Square to Gmail, month end sales CSV sent for you
Month-end reporting has a sneaky way of turning into a ritual. Log into Square, click through Reports, export a CSV, realize you picked the wrong date range, then repeat it for every location.
Square Gmail automation helps when this hits your operations lead first, but owners and finance managers feel it too. The outcome is simple: the right “Sales Summary” numbers show up in your inbox every month, already in a CSV, ready to forward or analyze.
This workflow pulls last month’s completed orders from Square, builds a summary that matches your Square Dashboard, turns it into a file, and emails it via Gmail. Below, you’ll see how it works, what you need, and where teams usually trip up.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: Square to Gmail, month end sales CSV sent for you
flowchart LR
subgraph sg0["Schedule Flow"]
direction LR
n0["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Get Square Locations"]
n1@{ icon: "mdi:swap-vertical", form: "rounded", label: "Turn Locations Into List", pos: "b", h: 48 }
n2@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Ignore Locations w/o Sales", pos: "b", h: 48 }
n3["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Get Sales from Square"]
n4["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Compile Sales Reports"]
n5@{ icon: "mdi:play-circle", form: "rounded", label: "Schedule Trigger", pos: "b", h: 48 }
n6@{ icon: "mdi:cog", form: "rounded", label: "Convert Sales Summary to CSV..", pos: "b", h: 48 }
n7@{ icon: "mdi:message-outline", form: "rounded", label: "Send Report", pos: "b", h: 48 }
n8["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Get Dates From Last Month"]
n5 --> n8
n0 --> n1
n4 --> n6
n3 --> n2
n1 --> n3
n8 --> n0
n2 --> n4
n6 --> n7
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n5 trigger
class n2 decision
class n0,n3 api
class n4,n8 code
classDef customIcon fill:none,stroke:none
class n0,n3,n4,n8 customIcon
The Problem: Month-End Sales Reporting Becomes Manual Debt
Monthly sales reporting sounds straightforward until you’re the one responsible for getting it right. You have to remember to run it on time, choose the previous calendar month (not “last 30 days”), and make sure every Square location is included. Then you export, rename files, and email them to whoever needs them. Miss one location or grab the wrong date window and you’ll spend the next day answering “why doesn’t this match the dashboard?” questions. It’s not hard work. It’s fragile work, and it always seems to land on a busy morning.
It adds up fast. Here’s where it breaks down in real businesses.
- Someone has to remember to run the report on the 1st, which is exactly when other month-end tasks pile up.
- Date filters get picked inconsistently, so the CSV doesn’t match Square Dashboard > Reports > Sales Summary.
- Multi-location accounts mean repeated exports and more chances to miss a site with “zero” sales that still matters.
- Manual emailing is easy to “do later,” which turns into late forecasting, late bookkeeping, and awkward follow-ups.
The Solution: Automatically Email a Square Sales Summary CSV Each Month
This n8n workflow runs automatically on the 1st of every month at 8:00 AM and builds your prior month sales report without you touching Square at all. It starts by calculating the correct start and end dates for the previous calendar month, then calls the Square API to pull every location tied to your account. For each location, it retrieves completed orders for that month and ignores locations with no sales, so your report stays clean. After that, the workflow aggregates the order data into a sales summary designed to match what you see in Square’s built-in Sales Summary view. Finally, it generates a CSV file and emails it via Gmail to whoever needs it (a manager, your finance team, or an external partner).
The flow is steady. Schedule trigger kicks it off, Square data is collected per location, the summary is built once the numbers are ready, and Gmail sends the finished CSV as an attachment. No exporting. No “did you run it yet?” messages.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you run 5 Square locations and you send a month-end sales CSV to your bookkeeper. Manually, it’s maybe 10 minutes per location to pull the report, check the date range, export, rename, and attach it, plus another 10 minutes to sanity-check totals, so you’re spending about 1 hour each month. With this automation, you spend about 15 minutes once to connect Square + Gmail and set the recipient. After that, the workflow runs on the 1st at 8:00 AM, builds the CSV in the background, and the email shows up without you remembering anything.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Square for pulling locations and completed orders
- Gmail to email the CSV attachment automatically
- Square access token (get it from your Square Developer Dashboard)
Skill level: Intermediate. You’ll paste an API token, connect Gmail, and confirm the date logic matches your reporting expectations.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
Monthly schedule trigger. The workflow runs on the 1st of every month at 8:00 AM, so you stop relying on reminders or calendar tasks that get ignored.
Prior-month date calculation. A small code step derives the correct previous calendar month window, which is the detail that usually causes mismatched totals when people export manually.
Square data collection across locations. n8n pulls your Square locations, loops through them, and requests completed orders for that month. Locations with no sales get skipped, which keeps the final CSV focused.
Summary + CSV + email delivery. The workflow aggregates the order data into a Sales Summary-style output, converts it into a CSV file, then uses Gmail to send it to the recipient you choose.
You can easily modify who receives the report and what the CSV includes based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Schedule Trigger
Set up the monthly trigger so the workflow runs automatically at the desired time each month.
- Add and open Monthly Schedule Start.
- Set the schedule Rule to trigger monthly with Field set to
monthsand Trigger At Hour set to8. - Verify the node is connected to Derive Prior Month Dates as shown in the execution flow.
Step 2: Connect Square and Fetch Locations
Retrieve your Square locations and expand them into a list for order queries.
- Open Fetch Square Sites and set URL to
https://connect.squareup.com/v2/locations. - Enable Send Headers and keep the Content-Type header set to
application/json. - Credential Required: Connect your httpHeaderAuth credentials in Fetch Square Sites.
- Open Expand Location List and set Field to Split Out to
locationsand Fields to Include toid.
Step 3: Set Up Order Retrieval and Sales Processing
Pull daily orders for each location and filter out empty sales before calculating metrics.
- Open Retrieve Square Orders and set URL to
https://connect.squareup.com/v2/orders/searchwith Method set toPOST. - Set JSON Body to the expression:
={ "location_ids": ["{{ $json.locations.id }}"], "query": { "filter": { "state_filter": { "states": ["COMPLETED"] }, "date_time_filter": { "created_at": { "start_at": "{{ $('Derive Prior Month Dates').item.json.date }}T00:00:00-05:00", "end_at": "{{ $('Derive Prior Month Dates').item.json.date }}T23:59:59-05:00" } } } }, "limit": 1000, "return_entries": false }. - Credential Required: Connect your httpHeaderAuth credentials in Retrieve Square Orders.
- Open Filter Empty Sales and ensure the condition checks
{{ $json.orders }}with the notEmpty operator. - Open Build Sales Summary and keep Mode set to
runOnceForEachItemwith the provided JavaScript for totals and tenders.
Step 4: Configure Report Output and Email Delivery
Convert the summarized data into a CSV file and send it via email.
- Open Generate CSV Report and set Binary Property Name to
sales_report. - Set File Name to
=sales_report_{{ $('Monthly Schedule Start').item.json.timestamp }}.csvso each report is timestamped. - Open Email Report Dispatch and set Send To to
[YOUR_EMAIL]. - Set Subject to
=Your Last Month's Square Sales Reportand Message to=<p>Hello User,</p><p>Please see the attached report containing last month's sales!</p><p>Best,<br> An Efficient Person</p>. - In Email Report Dispatch options, attach the binary property
sales_report. - Credential Required: Connect your gmailOAuth2 credentials in Email Report Dispatch.
[YOUR_EMAIL] with a real address before testing, or the email will not be delivered.Step 5: Test and Activate Your Workflow
Run a manual test to confirm data retrieval, report generation, and email delivery before activating the monthly schedule.
- Click Execute Workflow to run a manual test.
- Verify that Retrieve Square Orders returns orders and Filter Empty Sales passes only non-empty results.
- Confirm Generate CSV Report produces a file in the
sales_reportbinary property. - Check your inbox for the message from Email Report Dispatch with the CSV attached.
- When successful, toggle the workflow to Active to run monthly on schedule.
Common Gotchas
- Square credentials can expire or need specific permissions. If things break, check n8n’s Credentials for your Header Auth token first, then confirm the token still works in the Square Developer Dashboard.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.
Frequently Asked Questions
About 30 minutes if you already have your Square access token and Gmail ready.
No coding is required. You’ll mostly connect credentials and edit a few fields like recipient email and message text.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in Square API usage (typically minimal for monthly reporting).
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, but you’ll change the “Generate CSV Report” behavior so it runs inside the per-location loop, then adjust “Email Report Dispatch” to send one attachment per location. Common tweaks include adding the location name to the filename, CC’ing different managers, and including extra columns in the “Build Sales Summary” code step.
Most of the time it’s an expired or incorrect access token, or the Header Auth value isn’t formatted like Bearer YOUR_TOKEN. Double-check the credential used by both HTTP Request nodes, then confirm the token is still valid in Square. If you’re pulling a high-volume month across many locations, you can also hit rate limits, so retries or pagination may be needed. Finally, confirm the workflow date window is valid; a bad start/end date can make Square return empty results that look like a “broken” connection.
It can handle typical small-business volumes comfortably, but very busy locations may need pagination once you get beyond about 1,000 orders in a month.
Often, yes, because this kind of reporting needs looping through locations, conditional filtering, and custom aggregation logic to match Square’s dashboard numbers. n8n handles that without forcing you into a pile of separate “zaps” or expensive multi-step runs. Zapier or Make can still work if your needs are very basic, like sending a single export on a schedule, but matching a Sales Summary-style report is where teams usually outgrow simple builders. Talk to an automation expert if you want a quick recommendation for your setup.
Once this is running, month-end sales reporting becomes background noise. The workflow takes the repetitive parts so you can focus on the decisions that come after the numbers.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.