New to n8n? Start with our step-by-step setup guide, then come back to build this workflow.
TL;DR: A Shopify weekly sales PDF report n8n workflow pulls the last seven days of orders from your Shopify Admin API, totals revenue, order count, AOV, refunds, and your top products, renders a clean one-page PDF, and emails it to you (and your team) every Monday morning. Setup takes about thirty minutes, runs free on self-hosted n8n, and replaces the manual export-and-format routine most store owners do before their weekly review.
What this workflow does
Every Monday at the hour you choose, the workflow asks the Shopify Admin API for all orders created in the previous seven days. It rolls that raw data into the figures a store owner actually reviews at the start of the week: gross revenue, net revenue after refunds, order count, average order value, refund total, new versus returning customers, and the top five products by revenue. Those numbers are placed into an HTML template, converted to a PDF, and sent to your inbox as an attachment with a short summary in the email body.
The output is a single A4 page you can forward to a partner, drop into a shared Google Drive folder, or print for a Monday meeting. Because it lives in your own n8n instance, the report shows exactly the metrics you care about, on a schedule you control, and it costs nothing per send.
Why it beats the default Shopify report
Shopify Admin gives you analytics inside the dashboard and an optional email summary. Both are fine for a quick glance, but neither hands you a portable weekly document. The dashboard is a live view that you have to log in to read, and the native email is a plain text recap with no branding, no PDF, and a fixed set of metrics you cannot rearrange.
A weekly PDF solves three real problems. It is forwardable, so a bookkeeper or business partner who has no Shopify login still gets the numbers. It is archivable, so twelve PDFs in a Drive folder become a record of the year without exporting anything. And it is yours to shape: add a profit estimate, a refund-rate flag, or a per-collection breakdown by editing one node. Paid reporting apps such as Lifetimely or Better Reports charge anywhere from $30 to $150 a month for what is, underneath, a date-range query and a formatted document.
Running this on n8n for Shopify automation gives you that document on the channel you already check, at the hour you pick, for zero recurring cost. Adding a second store means duplicating two nodes, not paying for a second app seat.
What you need before you start
You need a running n8n instance, a Shopify store where you are the owner or have a staff account with read access to orders, products, and customers, and a Gmail account for sending. You also need a way to turn HTML into a PDF. The cleanest option is Gotenberg, a free open-source PDF engine you run as a Docker container next to n8n, so nothing leaves your server. If you prefer a hosted route, APITemplate.io has a free tier that works with the same HTTP Request node.
For the Shopify side you create a custom app inside Shopify Admin and grant it read_orders, read_products, and read_customers scopes. Shopify issues an Admin API access token that n8n uses as a header credential. For Gmail you connect the Gmail node with OAuth2, which takes a few minutes the first time. Budget about thirty minutes total if you are comfortable copying tokens between browser tabs.
Node-by-node list
The finished workflow has eight nodes. Here is what each one does and why it exists.
Schedule Trigger: fires once a week, Monday at 07:00 in your store timezone. You set the timezone in n8n settings, not in the node, so every scheduled workflow agrees on the time.
Set, Date Window: computes the ISO strings for “seven days ago 00:00” and “today 00:00” in your timezone. Keeping the date math in one node means a single edit when daylight saving shifts or when you move to a new server.
HTTP Request, Shopify Orders: calls GET /admin/api/2024-10/orders.json with status=any, created_at_min, created_at_max, and limit=250. Using HTTP Request rather than the Shopify node gives you control over pagination and the exact fields returned, which matters once a store passes a few hundred orders a week.
Code, Aggregate Metrics: JavaScript that reduces the orders array into report figures. It sums total_price, counts orders, divides for AOV, walks line_items to rank the top five products by revenue, separates refunded amounts from refunds[].transactions[].amount, and splits new versus returning buyers using the customer orders_count field.
Set, Build HTML: injects those values into an HTML template with inline CSS. Inline styles are important because most PDF engines ignore external stylesheets. This node holds the layout: header with store name and week range, a metrics row, and a small product table.
HTTP Request, Render PDF: posts the HTML to Gotenberg’s /forms/chromium/convert/html endpoint and receives the PDF binary back. If you use APITemplate.io instead, this node calls their render endpoint with the same HTML payload.
Gmail, Send Report: attaches the returned PDF binary and sends it to your list of recipients. The email body carries a two-line summary so readers see the headline numbers without opening the file.
Google Drive, Archive (optional): uploads the same PDF to a dated folder so you build a searchable archive without any extra effort.
Step-by-step build
1. In Shopify Admin, go to Settings, Apps and sales channels, Develop apps, Create an app. Name it “n8n Weekly Report”. Under Configuration grant read_orders, read_products, and read_customers. Install the app, then copy the Admin API access token that starts with shpat_.
2. In n8n, create a new credential of type “Header Auth”. Set the header name to X-Shopify-Access-Token and the value to the token from step 1. Save it.
3. Stand up the PDF engine. If you run n8n with Docker Compose, add a Gotenberg service (gotenberg/gotenberg:8) to the same compose file so n8n can reach it at http://gotenberg:3000. Skip this step if you are using APITemplate.io.
4. Create a new n8n workflow. Add a Schedule Trigger node set to a weekly cron, Monday at 07:00.
5. Add a Set node with two string fields: fromISO set to ={{ DateTime.now().setZone('Africa/Casablanca').minus({days: 7}).startOf('day').toISO() }} and toISO set to ={{ DateTime.now().setZone('Africa/Casablanca').startOf('day').toISO() }}. Replace the zone with your own.
6. Add an HTTP Request node. Method GET. URL https://YOUR-STORE.myshopify.com/admin/api/2024-10/orders.json. Authentication: Generic, Header Auth, the credential from step 2. Query parameters: status=any, created_at_min={{$json.fromISO}}, created_at_max={{$json.toISO}}, limit=250, fields=id,total_price,subtotal_price,currency,line_items,customer,refunds,created_at.
7. Add a Code node and paste the aggregation script (included in the downloadable JSON template). It returns one item with fields revenue, orders, aov, refunded, net, newCustomers, returningCustomers, and a topProducts array.
8. Add a Set node that builds the HTML. Use inline CSS only, reference the values with expressions like {{$json.revenue}}, and loop the topProducts array into table rows. The full template ships in the download.
9. Add an HTTP Request node pointed at Gotenberg. Method POST, URL http://gotenberg:3000/forms/chromium/convert/html, body type “n8n Binary File” with the HTML field named index.html. The response is the PDF binary; set “Response Format” to File.
10. Add a Gmail node. Operation Send. Fill the recipients, a subject like Weekly sales report, week of {{$json.weekStart}}, a short body, and attach the binary from the previous node.
11. Run the workflow once manually with “Execute Workflow”, confirm the PDF arrives, then activate it so the schedule takes over.
Common mistakes
The most frequent error is a blank or broken PDF caused by external CSS. PDF engines render the HTML in isolation, so any <link> to a stylesheet is dropped. Keep every style inline on the element or inside a single <style> block in the document head.
The second is missing orders on busy stores. The Admin API returns 250 orders per page, so a store doing more than 250 orders a week needs pagination through the Link response header. The download template includes a loop that follows the next-page cursor until the data runs out.
The third is a timezone mismatch. If n8n runs in UTC but your store reports in another zone, your week boundaries drift by a few hours and Monday’s report can clip Sunday evening sales. Set the timezone once in n8n settings and reference it in the date expressions, as shown in step 5.
Cost at realistic volume
On self-hosted n8n the workflow is free to run. One execution per week is nothing for even the smallest VPS, and Gotenberg adds a lightweight container that idles at near-zero CPU between runs. Gmail sends sit well inside the free sending limits at one report a week, even with several recipients.
If you choose APITemplate.io instead of self-hosting Gotenberg, the free tier covers dozens of renders a month, which is far more than a weekly report needs. On n8n Cloud the only cost is the one workflow execution against your monthly quota. For a store paying $30 to $150 a month for a reporting app, replacing it with this workflow recovers the full subscription while giving you a document you fully control.
Ready-to-import template
You can build this from the steps above, or skip straight to the finished version. The downloadable package includes the complete workflow JSON with the pagination loop, the aggregation script, and a styled HTML template ready for Gotenberg or APITemplate.io. Grab it from our downloads library, import it into n8n, plug in your three credentials, and you have a weekly PDF in under ten minutes.
Want it installed and tested on your store without touching a node? Our n8n setup service configures the workflow, connects your Shopify and Gmail credentials, and hands you a working report on your own server.
FAQ
Can I send the report to more than one person? Yes. The Gmail node accepts a comma-separated list of recipients, or you can add CC and BCC fields. A common setup sends the PDF to the owner, the bookkeeper, and a shared archive address, all from the single send node without duplicating anything.
Do I have to use Gotenberg for the PDF? No. Gotenberg is the free self-hosted choice, but the HTTP Request node works with any HTML-to-PDF service that accepts a POST. APITemplate.io has a free tier, and the workflow swaps between them by changing one node’s URL and credential.
Will this work on a high-volume store? Yes, with pagination enabled. The Admin API caps each page at 250 orders, so a busy store needs the loop that follows the next-page cursor. The download template already includes that loop, so it handles thousands of weekly orders without changes.
Can I change the metrics in the report? Absolutely. The figures are produced in the Code node, so adding a refund rate, a profit estimate, or a per-collection breakdown is a small edit to the JavaScript and one extra row in the HTML template. Nothing else in the workflow needs to change.
Does this work with WooCommerce too? Yes. Swap the Shopify HTTP Request for the WooCommerce node or a call to the WooCommerce REST API, keep the same aggregation, HTML, and PDF nodes, and the rest of the workflow runs identically for a WooCommerce store.
Related guides
Pair this with the Shopify daily sales report to Telegram for a quick morning glance, or browse every store automation in our Shopify guides. If you are still setting things up, the n8n setup guide covers installation on cloud and self-hosted.