How to Generate AI Weekly Sales Summaries from Shopify Data on a Schedule
Build a Spojit workflow that runs every Monday, pulls the past week of Shopify orders, writes a narrative performance summary with key metrics using an Agent-mode Connector node, posts it to a Slack channel, and emails it to leadership.
What This Integration Does
Every week someone on your team exports orders, tallies revenue, compares it to the prior period, and writes a few sentences explaining what happened. This workflow does all of that on autopilot. A Schedule trigger fires on a fixed day and time, the workflow fetches the past seven days of Shopify orders, an Agent-mode Connector node reads the order data and produces a short written performance summary plus a clean set of metrics, and the result lands in front of the people who care: a Slack channel for the wider team and an email for leadership.
The run model is fully unattended. The Schedule trigger emits {{ scheduledAt }} when it fires, and every downstream node draws from upstream variables only. Nothing is stored in Shopify or Slack beyond the message you post, so re-runs are safe and idempotent: running it twice simply produces two summaries for the same window. Because the report covers a rolling seven-day window calculated at run time, you never have to edit date ranges by hand. If a run fails partway through, no partial state is left behind in your store, so you can re-run it from the execution history without cleanup.
Prerequisites
- A Shopify connection in Spojit with read access to orders. Add it under Connections - Add connection - Shopify. See Adding a New Connection for the general flow.
- A Slack connection authorized to post to your target channel, and the channel ID or name (for example
#sales) where the summary should appear. - The leadership email recipients you want to copy. External recipients must be on your org allowlist under Settings - General - Email recipients (see Configuring the Email Allowlist).
- The IANA timezone for your business (for example
Australia/Sydney) so the schedule and the report window line up with your trading week.
Step 1: Start with a Schedule trigger
Add a Trigger node and set its type to Schedule. The Schedule trigger uses a 5-field Unix cron expression plus an IANA timezone. To run at 7am every Monday, use:
0 7 * * 1
Set the timezone field to your business timezone, such as Australia/Sydney. A single trigger can hold multiple schedules if you want both a Monday morning and a mid-week run, but one entry is enough here. When the trigger fires it outputs {{ scheduledAt }}, an ISO timestamp you can reference downstream. For a deeper walkthrough of cron fields, see Setting Up a Schedule Trigger.
Step 2: Compute the seven-day window
Add a Connector node in Direct mode using the date utility connector. Pick the subtract tool to shift back seven days from the trigger time, mapping the input date to {{ scheduledAt }} and subtracting 7 days. Store the result so you can reference it as {{ window_start }}. You will use this value to build the Shopify query string in the next step. Because this is Direct mode, it is deterministic and costs no AI credits. If you prefer, you can instead build the boundary date inline in the Shopify query, but a dedicated date node keeps the window explicit and easy to read in the execution log.
Step 3: Pull the past week of Shopify orders
Add a Connector node in Direct mode, choose your Shopify connection, and select the list-orders tool. This tool accepts a query using Shopify search syntax, a first page size (max 250, default 20), and an after cursor for pagination. Filter to paid orders created since your window start by setting query to a value built from {{ window_start }}, for example:
financial_status:paid created_at:>2026-06-13
Set first to 250 to fetch a full page. Save the output as {{ orders }}. If your store does more than 250 paid orders a week, loop on the returned cursor: add a Loop node that re-calls list-orders with after set to the previous page cursor until no further cursor is returned, collecting each page into a single list. For most stores one page is enough. See Using Connector Nodes in Direct Mode for mapping inputs.
Step 4: Write the narrative summary in Agent mode
Add a Connector node and switch it to Agent mode. This is where Miraxa, the intelligent layer across your automation, reads the raw orders and produces a written performance summary. In the prompt, pass the orders and ask for a concise narrative plus the metrics you want. A good prompt is specific and names the data it is reasoning over:
You are writing a weekly sales summary for leadership.
Here are this week's paid Shopify orders: {{ orders }}
Write a 3 to 4 sentence narrative covering total revenue,
order count, average order value, the best-selling items,
and any notable change in trend. Then return the key
metrics as numbers.
To get reliable, machine-readable numbers (not just prose), turn on the Agent-mode Response Schema to force structured JSON output. Define fields such as narrative, totalRevenue, orderCount, averageOrderValue, and topProducts. Save the node output as {{ summary }}. You can then reference {{ summary.narrative }} and {{ summary.totalRevenue }} independently downstream. For when to reach for Agent mode versus Direct mode, see How to Choose Between Agent Mode and Direct Mode and How to Use Structured Output for Reliable AI Data Extraction.
Step 5: Post the summary to Slack
Add a Connector node in Direct mode, choose your Slack connection, and select the send-message tool. Set the channel field to your target channel (for example #sales) and build the message text from the structured output so the channel gets a tidy, readable post:
:bar_chart: Weekly sales summary
{{ summary.narrative }}
Revenue: {{ summary.totalRevenue }}
Orders: {{ summary.orderCount }}
Avg order value: {{ summary.averageOrderValue }}
Map each field carefully so the numbers come straight from {{ summary }} rather than being re-derived. See the Slack connector reference for channel and formatting options.
Step 6: Email the summary to leadership
Add a Send Email node, which sends from Spojit's built-in mail service with no extra connection. Set Recipients to your leadership distribution (comma-separated, templated), set Subject to something like Weekly sales summary, and set the Body to the narrative plus metrics, reusing the same {{ summary }} fields. Choose how the node behaves under If sending fails: pick Continue anyway if you would rather the Slack post still count as a success even when email delivery has a hiccup. Remember that external recipients must be on the org allowlist, and these emails count toward your monthly email allowance. To send from your own domain instead, swap this for a Connector node using the resend or smtp connector and its send-email tool. See Using Send Email Nodes.
Tips
- Run the Slack post and the email concurrently with a Parallel node so neither delivery blocks the other. Branch after the Agent-mode node, with one branch posting to Slack and the other sending the email.
- Keep the Agent-mode prompt focused on summarizing only. Do the arithmetic-heavy filtering (the date window, the paid status) in Direct-mode Shopify and date nodes so the AI step is cheaper and more predictable.
- Shopify's
created_at:>...filter is evaluated in your store's timezone. Confirm it matches the Schedule trigger timezone so a "week" means the same thing in both places. - Use the structured Response Schema so the same numbers feed both Slack and email. If you let the AI free-write twice, the two channels can disagree.
Common Pitfalls
- Page-size truncation:
list-ordersreturns at most 250 per page. High-volume stores must paginate with the returnedaftercursor, or the summary silently understates revenue. - Timezone drift: a cron of
0 7 * * 1without the right IANA timezone can fire on Sunday night or include the wrong day's orders. Always set the timezone explicitly on the Schedule trigger. - Email allowlist blocks: if a leadership recipient is external and not on the allowlist, the Send Email node fails. Add them under Settings - General - Email recipients first.
- Counting all orders: without
financial_status:paidin the query, draft, pending, and cancelled orders inflate the totals. Filter to paid orders for a true sales figure.
Testing
Before relying on the schedule, validate on a small scope. Temporarily set the list-orders query to a narrow window you can verify by hand (for example a single recent day), then use the Run button to execute the workflow on demand rather than waiting for the cron to fire. Open the execution log, confirm {{ orders }} contains the expected records, that {{ summary }} has populated every schema field, and that the Slack message and email arrive with matching numbers. Once the output looks right, restore the seven-day query, set the Schedule trigger to its real cron, and enable the workflow.