Automated Weekly Square Sales Reporting via Email - n8n Workflow

Automate weekly sales reports from Square. This n8n workflow uses the Square API to calculate aggregated sales summaries and email them as CSV attachments using the Gmail n8n node.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Business owners relying on Square POS.
Finance teams needing consistent weekly sales data.
n8n automation specialists looking for advanced n8n templates for financial reporting.
Users who need reliable, scheduled data extraction using an n8n trigger.

Overview

This advanced n8n workflow solves the tedious task of manually pulling weekly sales summaries from Square's dashboard. By leveraging the Square API and custom JavaScript aggregation, this n8n workflow accurately mirrors the complex calculations found in the native Square Sales Summary Report, handling tenders, discounts, taxes, and returns. The result is a fully automated, scheduled process where the data is transformed into a clean CSV file and delivered directly to stakeholders via a Gmail n8n node. This particular n8n template is essential for ensuring timely, accurate financial oversight without manual intervention, saving countless hours for finance and management teams. Using this powerful n8n workflow ensures you never miss a reporting deadline.

How it Works


  1. The process begins with an n8n trigger, specifically the Schedule Trigger, set to execute every Monday at 8:00 AM.

  2. A Code n8n node named "Get Dates From Last Week" calculates the exact date range covering the previous seven days, which is necessary for the subsequent API calls.

  3. The workflow uses an HTTP Request n8n node to retrieve all available Square locations linked to the account.

  4. A Split Out n8n node processes each location individually, ensuring sales data is fetched location by location.

  5. Another HTTP Request n8n node queries the Square API for all completed orders within the calculated weekly date range for the current location.

  6. An If n8n node ("Ignore Locations w/o Sales") filters out locations that reported zero sales during the week, preventing empty reports from proceeding.

  7. The crucial step involves a Code n8n node named "Compile Sales Reports," which runs complex arithmetic (handling returns, rounding, tenders, and fees) to generate the final, highly accurate sales summary JSON object, matching the Square Dashboard.

  8. The data is converted from JSON to a readable CSV format using the Convert To File n8n node, creating the binary attachment.

  9. Finally, the Gmail n8n node sends the comprehensive weekly sales report CSV as an attachment to the designated finance recipient. This complete n8n workflow ensures data delivery is seamless and automated.

Installation Guide


  1. Import the n8n workflow: Copy and paste the JSON code into your n8n instance.

  2. Set up Square Credentials: You must configure a Square API credential using the Header Auth type.

Set the Header Name to Authorization.
Set the Header Value to your Square Access Token, formatted as Bearer .
* Ensure both the "Get Square Locations" and "Get Sales from Square" HTTP Request n8n node utilize this credential.

  1. Set up Gmail Credentials: Configure a Gmail or Email n8n node credential (OAuth2 is recommended) and assign it to the "Send Report" node.

  2. Configure Recipient: Update the Send Report Gmail n8n node's Send To field with the desired recipient's email address.

  3. Activate: Set the n8n workflow to Active so the Schedule n8n trigger runs automatically every week.

Node Details

Schedule Trigger (n8n trigger): The primary n8n trigger, set to run weekly (Mondays at 8:00 AM), initiating the entire n8n workflow.
Get Dates From Last Week (Code n8n node): Dynamically calculates the YYYY-MM-DD strings for the previous seven days based on the n8n trigger execution time.
Get Square Locations (HTTP Request n8n node): Fetches location IDs necessary for the sales queries, configured with Header Auth for the Square API.
Turn Locations Into List (Split Out n8n node): Splits the location array so the n8n workflow iterates over each location.
Get Sales from Square (HTTP Request n8n node): A critical POST request that uses the location ID and the calculated date range to retrieve completed orders. This demonstrates complex API interaction within an n8n node.
Compile Sales Reports (Code n8n node): The core computational n8n node. It executes custom JavaScript logic to aggregate all financial metrics (Gross Sales, Net Sales, Taxes, Tips, Tenders) and accurately match Square's official sales summary figures.
Convert Sales Summary to CSV File (Convert To File n8n node): Transforms the compiled JSON report data into a binary CSV file, ready for email attachment.
Send Report (Gmail n8n node): Handles the final delivery, attaching the dynamically generated CSV report and sending it using the configured Gmail credential.

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by
Rosh Ragel
Rosh Ragel

Featured*