🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 21, 2026

Square to Gmail, daily sales CSV sent automatically

Lisa Granqvist Partner Workflow Automation Expert

Pulling yesterday’s Square sales sounds simple until you’re doing it every morning. Log in, click around, export, rename, attach, send. Then someone replies asking for “the same report but for the other location.”

This is the kind of mess that eats time for store managers, but finance leads and ops folks feel it too. With this Square Gmail automation, you get a consistent daily sales CSV in your inbox automatically, so reporting doesn’t depend on someone remembering.

Below, you’ll see exactly what the workflow does, what it replaces, and what you’ll need to run it reliably.

How This Automation Works

The full n8n workflow, from trigger to final output:

n8n Workflow Template: Square to Gmail, daily sales CSV sent automatically

The Problem: Daily Square Sales Reporting Is Still Manual

Daily sales numbers are the heartbeat of a retail or service business. But if you’re using Square, the “quick” way is still a bunch of little steps that pile up: open the dashboard, find the right report, switch dates to “yesterday,” export, and email it out. It’s easy to do slightly differently each time, which means mismatched totals, missing locations, or a CSV that breaks someone’s spreadsheet. And when you’re busy, reporting is the first thing that gets delayed.

It adds up fast. Here’s where it breaks down.

  • Someone has to remember to pull the report every day, including weekends and holidays.
  • Multi-location businesses waste extra time repeating the same export steps for each location.
  • Manual exports lead to version confusion, so finance ends up reconciling “which CSV is the real one.”
  • When reports arrive late, planning and staffing decisions get made on stale numbers.

The Solution: Automatically Email Yesterday’s Square Sales as a CSV

This n8n workflow connects directly to the Square API, pulls the previous day’s completed orders, and generates a sales summary that matches what you see in Square Dashboard > Reports > Sales Summary. It runs on a schedule (daily at 4:00 AM), fetches all locations tied to your Square account, and processes each one. If a location has no sales, it gets skipped, so you’re not sending empty noise. Finally, the workflow turns the cleaned sales summary into a CSV file and emails it through Gmail to whoever needs it (management, finance, a bookkeeper, or even a third party like a commission-based partner).

The workflow starts with a scheduled trigger, then makes two Square API calls: one to get your locations and one to pull yesterday’s completed orders per location. After that, a code step assembles the same kind of roll-up totals you’d normally export manually. Gmail sends the finished CSV and your message, automatically.

What You Get: Automation vs. Results

Example: What This Looks Like

Say you run 3 Square locations and you email a daily summary to two people. Manually, it’s easy to spend about 10 minutes per location (find the report, set the date, export, rename), plus a few minutes to attach and send, so roughly 35 minutes each day. With this workflow, you spend maybe 10 minutes one time to set it up, and the daily run is hands-off. By the end of a week, that’s a couple of hours you didn’t burn on reporting.

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 to recipients
  • Square access token (get it from the Square Developer dashboard)

Skill level: Intermediate. You’ll paste API credentials, set recipients, and do light troubleshooting if Square permissions change.

Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).

How It Works

A daily scheduled run kicks everything off. The workflow is set to run at 4:00 AM so yesterday’s data is complete and in inboxes before most teams start the day.

Square locations are pulled automatically. An HTTP request calls the Square API to fetch every location on the account, then n8n expands that list so each location can be processed in turn.

Orders are fetched and summarized. For each location, the workflow requests completed orders for the report date, filters out locations with no sales, and then a code step aggregates the totals into a Sales Summary-style output (the same numbers you expect to see in the Square dashboard).

A CSV is generated and sent via Gmail. The summary becomes a CSV file, then Gmail emails it to the recipients you specify, with a message body you can customize for your team.

You can easily modify the schedule to send weekly or month-end reports based on your needs. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Scheduled Trigger

Set the workflow’s schedule so it runs automatically and provides the timestamp used in later expressions.

  1. Add the Scheduled Run Trigger node and open its settings.
  2. Set the schedule interval in the Rule section to match when you want the daily report to run.
  3. Confirm the node outputs a timestamp used later in expressions like {{ $('Scheduled Run Trigger').item.json.timestamp.toDateTime().minus(1, 'days').format('yyyy-MM-dd') }}.

Step 2: Connect Square and Pull Location Data

Fetch all Square locations so each location can be processed individually.

  1. Add the Fetch Square Locations node and set URL to https://connect.squareup.com/v2/locations.
  2. Enable Send Headers and set the header Content-Type to application/json.
  3. Credential Required: Connect your httpHeaderAuth credentials in Fetch Square Locations.
  4. Add Expand Location List and set Field to Split Out to locations and Fields to Include to id.

Step 3: Retrieve Sales and Filter Empty Results

Query Square Orders for each location and exclude any locations with no sales.

  1. Add Retrieve Square Sales and set URL to https://connect.squareup.com/v2/orders/search and Method to POST.
  2. Set JSON Body to the exact expression block:
    ={
    "location_ids": ["{{ $json.locations.id }}"],
    "query": {
    "filter": {
    "state_filter": {
    "states": ["COMPLETED"]
    },
    "date_time_filter": {
    "created_at": {
    "start_at": "{{ $('Scheduled Run Trigger').item.json.timestamp.toDateTime().minus(1, 'days').format('yyyy-MM-dd') }}T00:00:00-05:00",
    "end_at": "{{ $('Scheduled Run Trigger').item.json.timestamp.toDateTime().minus(1, 'days').format('yyyy-MM-dd') }}T23:59:59-05:00"
    }
    }
    }
    },
    "limit": 1000,
    "return_entries": false
    }
  3. Credential Required: Connect your httpHeaderAuth credentials in Retrieve Square Sales.
  4. Add Filter Empty Sales and set the condition to check {{ $json.orders }} is notEmpty.

Step 4: Build the Sales Summary and CSV

Aggregate totals per location, then generate a CSV file for email delivery.

  1. Add Assemble Sales Summary and set Mode to runOnceForEachItem.
  2. Paste the provided JavaScript into jsCode to compute totals and metadata per location.
  3. Add Generate CSV Report and set Binary Property Name to sales_report.
  4. In Generate CSV Report set the file name option to =sales_report_{{ $('Scheduled Run Trigger').item.json.timestamp }}.csv.

Tip: The CSV output is attached downstream by referencing the sales_report binary property.

Step 5: Configure Email Delivery

Send the CSV report to your inbox with a dynamic subject line.

  1. Add Dispatch Email Report and set Send To to [YOUR_EMAIL].
  2. Set Subject to =Your Square Sales Report for {{ $('Scheduled Run Trigger').item.json['Readable date'].split(',')[0] }}.
  3. Keep the HTML body in Message as provided, or customize it to your needs.
  4. In Options, attach the binary file by mapping sales_report in Attachments.
  5. Credential Required: Connect your gmailOAuth2 credentials in Dispatch Email Report.

⚠️ Common Pitfall: If the attachment does not appear, verify the attachment property name exactly matches sales_report from Generate CSV Report.

Step 6: Test and Activate Your Workflow

Run a manual test to confirm that locations are fetched, sales are aggregated, and the email arrives with the CSV attachment.

  1. Click Execute Workflow to run a manual test from Scheduled Run Trigger.
  2. Verify that Fetch Square Locations returns location data and Retrieve Square Sales returns orders.
  3. Confirm Generate CSV Report outputs a binary file named like sales_report_{{ $('Scheduled Run Trigger').item.json.timestamp }}.csv.
  4. Check your inbox to ensure Dispatch Email Report delivers an email with the CSV attachment.
  5. Switch the workflow to Active to enable scheduled production runs.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Common Gotchas

  • Square credentials can expire or have missing permissions. If things break, check your Square access token in n8n Credentials first and confirm it still has access to Orders and Locations.
  • If you add pagination later (for very high order volumes), processing times can vary. Bump up any wait or retry behavior if downstream steps fail because responses are delayed.
  • Default email copy is usually too generic. Edit the Gmail message body early so your recipients know what the CSV is, which date it covers, and who to contact when something looks off.

Frequently Asked Questions

How long does it take to set up this Square Gmail automation automation?

About 30 minutes if you already have your Square token and Gmail connected.

Do I need coding skills to automate Square Gmail automation?

No. You will connect credentials and edit a few fields like date handling and recipients.

Is n8n free to use for this Square Gmail automation workflow?

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 access (typically no per-request fee for standard use).

Where can I host n8n to run this automation?

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.

Can I customize this Square Gmail automation workflow for weekly or month-end reporting?

Yes, but you’ll change two things. Update the Scheduled Run Trigger to run weekly or on the last day of the month, then adjust the report_date logic in the “Retrieve Square Sales” request so it pulls the right date range. Many teams also tweak the “Generate CSV Report” output columns to match what their bookkeeper expects. If you want the email subject to include the date range, update the Gmail node too.

Why is my Square connection failing in this workflow?

Usually it’s an expired or replaced Square access token in your Header Auth credential. Update the token in n8n, then re-run the workflow manually once to confirm Locations and Orders calls succeed. If it still fails, check that the token has permissions for the endpoints you’re calling and that you’re not hitting rate limits by pulling unusually large days.

How many orders can this Square Gmail automation automation handle?

For most small businesses, it’s fine out of the box, but very high-volume days may require pagination to pull more than 1,000 orders per location.

Is this Square Gmail automation automation better than using Zapier or Make?

Often, yes, because Square reporting usually needs looping over locations, filtering out empty data, and formatting a clean CSV. n8n handles that kind of logic without turning into a fragile chain of paid steps. It also gives you a self-hosting path if you want unlimited runs. Zapier or Make can be quicker for a very basic “send me something” flow, but matching Square’s Sales Summary numbers tends to take more control than those tools make comfortable. If you want a second opinion, Talk to an automation expert.

Once this is running, daily sales reporting becomes background noise. The workflow handles the repetitive part so you can make decisions with the numbers, not chase them.

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.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal