Shopify to Google Sheets, complete order reports
Your Shopify order export looks fine until it doesn’t. A missing page here, a duplicated chunk there, and suddenly your “report” is a guessing game. Shopify’s API caps what you can pull at once, so manual pulls quietly drop orders when your store gets busy.
This Shopify Sheets automation hits e-commerce managers hardest during weekly reporting, but analysts cleaning data for dashboards feel it too. And if you’re new to n8n, you still deserve a setup that just works. The outcome is simple: every order, every page, appended into Google Sheets as clean line items you can trust.
Below you’ll see exactly how the workflow captures orders in batches, loops through every page, and writes a report-ready dataset into Sheets without the usual export drama.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: Shopify to Google Sheets, complete order reports
flowchart LR
subgraph sg0["Scheduled Time Starter Flow"]
direction LR
n0@{ icon: "mdi:swap-vertical", form: "rounded", label: "Define Date Window", pos: "b", h: 48 }
n1["<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/graphql.png' width='40' height='40' /></div><br/>Retrieve Order Pages"]
n2@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Check Next Page", 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/code.svg' width='40' height='40' /></div><br/>Summarize Items by Vendor"]
n4@{ icon: "mdi:database", form: "rounded", label: "Append to Sheets", pos: "b", h: 48 }
n5@{ icon: "mdi:play-circle", form: "rounded", label: "Scheduled Time Starter", pos: "b", h: 48 }
n0 --> n1
n1 --> n2
n5 --> n0
n3 --> n4
n2 --> n1
n2 --> n3
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 n4 database
class n3 code
classDef customIcon fill:none,stroke:none
class n1,n3 customIcon
The Problem: Shopify Order Pulls Miss Data at Scale
Shopify order data seems easy to grab until you try to pull “all orders” for a date window and the API only returns the first chunk. With GraphQL, you get a limited number of orders per request (up to 250), which means you must paginate using cursors. Miss one cursor update, stop one loop early, or run the job at the wrong time, and your spreadsheet becomes quietly incomplete. Then you spend your afternoon reconciling totals, re-exporting CSVs, and explaining why finance and marketing numbers don’t match. Honestly, it’s not the work that hurts most. It’s the uncertainty.
The friction compounds fast. Here’s where it breaks down in real life:
- You export CSVs multiple times because Shopify exports are easy to mess up when filters change.
- GraphQL pagination requires cursor logic, and one small mistake drops an entire page of orders.
- Your “order report” isn’t report-ready because line items live inside nested order objects.
- When reporting is manual, you delay decisions because you don’t trust the numbers yet.
The Solution: Pull Every Shopify Order Page Into Sheets
This n8n workflow turns Shopify’s “250 orders at a time” limitation into something you never have to think about again. It starts on a schedule (daily, hourly, or whenever you choose), sets a clear date window, then queries Shopify via GraphQL for the first page of orders. If Shopify says there’s another page, the workflow automatically grabs the next 250 using the provided cursor, repeating until there are no more pages left. Once all orders for the window are collected, a code step flattens the nested data into spreadsheet-friendly rows (line items instead of tangled JSON). Finally, Google Sheets gets a clean append, so your reporting sheet grows consistently over time.
The workflow begins with a Scheduled Time trigger, then “Define Date Window” establishes startDay and endDay. “Retrieve Order Pages” keeps fetching until “Check Next Page” says stop, and only then does “Summarize Items by Vendor” prepare line items for “Append to Sheets.” No babysitting. No missing pages.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you run a weekly order report and your store generates about 1,000 orders in that window. Manually, you’ll usually export, spot-check, re-export, then reshape line items in Sheets or Excel, which can easily eat about 2 hours. With this workflow, you spend maybe 10 minutes once to set the schedule and the Sheet columns, then each run pulls four pages (250 × 4), flattens the items, and appends them automatically. You still review the report. You just stop assembling it.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Shopify Admin API access for GraphQL order queries
- Google Sheets to store report-ready order line items
- Shopify access token (create in Shopify Admin under Apps)
Skill level: Beginner. You’ll connect Shopify and Google credentials, then confirm the Sheet columns match what the workflow outputs.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
A schedule kicks it off. The workflow runs on your chosen cadence using the Scheduled Time Starter, so reporting happens even when nobody on the team is thinking about it.
A clean date window gets defined. “Define Date Window” sets startDay and endDay based on the current time, which keeps pulls consistent and avoids the “did we include yesterday?” debate.
Shopify pages are fetched until there are no more. “Retrieve Order Pages” requests the first batch of orders via GraphQL, then “Check Next Page” looks at Shopify’s pageInfo.hasNextPage and cursor. If another page exists, the workflow loops back and fetches again. If not, it moves forward.
Line items are flattened and written to Google Sheets. The code step summarizes items (including vendor/SKU context) and “Append to Sheets” pushes the final rows into your spreadsheet so your report is ready for pivots, Looker Studio, or whatever you use next.
You can easily modify the date window logic to match your reporting cutoffs (like “yesterday only” or “last 7 days”) 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 the workflow to run on a daily schedule so it can fetch and summarize recent Shopify orders automatically.
- Add and open Scheduled Time Starter.
- Set the Rule to trigger at
08:43(as configured withtriggerAtHour: 8andtriggerAtMinute: 43). - Connect Scheduled Time Starter to Define Date Window.
Step 2: Connect Shopify and Set the Date Window
Define the date range for orders and connect to the Shopify GraphQL API to retrieve paginated results.
- Open Define Date Window and add two fields: startDay with
={{$now.plus({ days: -30 }).toFormat('yyyy-MM-dd')}}and endDay with={{$now.toFormat('yyyy-MM-dd')}}. - Open Retrieve Order Pages and set Endpoint to
https://lokal-eg.myshopify.com/admin/api/2025-01/graphql.json. - Set Authentication to
headerAuth. - Paste the GraphQL query exactly as configured, including the cursor and date expressions referencing
{{ $('Define Date Window').item.json.startDay }}and{{ $('Define Date Window').item.json.endDay }}. - Credential Required: Connect your httpHeaderAuth credentials in Retrieve Order Pages.
pageInfo.endCursor. Make sure the cursor expression remains intact or pagination will stop after the first page.Step 3: Configure Pagination and Processing
This step loops through Shopify order pages and summarizes line items by SKU and vendor before sending results downstream.
- Open Check Next Page and confirm the condition checks
={{ $json.data.orders.pageInfo.hasNextPage }}equalstrue. - Verify the routing: Check Next Page should route true back to Retrieve Order Pages and false to Summarize Items by Vendor.
- Open Summarize Items by Vendor and keep the JavaScript as-is to aggregate orders from all pages using
$items("Retrieve Order Pages", 0, counter). - Confirm the output fields: SKU, Title, Brand, total_quantity_sold, and total_sales.
Step 4: Configure the Output to Google Sheets
Append the summarized data into your target spreadsheet.
- Open Append to Sheets and set Operation to
append. - Set Document ID to your spreadsheet ID (currently
[YOUR_ID]). - Set Sheet Name to
Dump(configured asgid=0). - Ensure Columns are set to
autoMapInputDatawith the schema fields matching the summary output. - Credential Required: Connect your googleSheetsOAuth2Api credentials in Append to Sheets.
Step 5: Test and Activate Your Workflow
Run the workflow end-to-end to confirm data is retrieved, summarized, and appended successfully.
- Click Execute Workflow to run the flow from Scheduled Time Starter.
- Verify Retrieve Order Pages returns data and Check Next Page loops until
hasNextPageis false. - Confirm Summarize Items by Vendor outputs aggregated rows and Append to Sheets appends new rows to the
Dumpsheet. - Once validated, toggle the workflow to Active so it runs on schedule.
Common Gotchas
- Shopify Admin API credentials can expire or lack scopes for orders. If things break, check the app’s API scopes and token status in Shopify Admin first.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Google Sheets appends can look “wrong” when your columns don’t match the flattened output. Confirm headers and column order in the target Sheet before you trust the data.
Frequently Asked Questions
About 30 minutes if your Shopify and Google access are ready.
No. You will connect accounts and paste in your Shopify token. The “code” step is already included, so you’re mainly configuring fields and the Sheet.
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 Shopify API usage, which is typically covered by your store plan but can hit rate limits on large backfills.
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, and it’s mostly a date-window change. Adjust the “Define Date Window” logic to set startDay and endDay to your month boundaries, then keep the same pagination loop. Some teams also add a second Google Sheet tab for “Monthly Summary” and keep this workflow writing raw line items to the first tab.
Most of the time it’s an expired token or missing API scopes for orders. Regenerate the Shopify access token, then update the credentials used by the “Retrieve Order Pages” GraphQL request. If it only fails on big pulls, you’re likely hitting rate limits, so reduce the date window or schedule runs more frequently.
A lot. The workflow paginates in 250-order pages and keeps looping until Shopify reports there are no more pages, so “thousands of orders” is normal as long as your API limits and n8n runtime can keep up.
Often, yes, because pagination and data shaping are the whole game here. Zapier and Make can pull orders, but handling “keep requesting the next page until done” can get awkward, and you’ll feel it once you’re beyond a few hundred orders. n8n is comfortable with loops, conditional branching, and custom transforms, which means the output can be truly report-ready. The self-hosted option also matters when you don’t want to think about task limits. If you only need a tiny two-step sync for a low-volume store, Zapier or Make may still be simpler. Talk to an automation expert if you want a quick recommendation for your setup.
Once this is running, your Shopify order reporting stops being a recurring project. The workflow handles the repetitive parts, and your sheet stays complete.
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.