How to Approve and Send a Weekly Executive Metrics Email Before It Goes Out

Build a weekly Spojit workflow that pulls core business metrics from MySQL and Stripe, has an Agent-mode Connector node draft the commentary, then pauses on a Human approval node so a finance lead can sign off the figures before the Send Email node delivers the executive update.

What This Integration Does

Leadership teams want one short, reliable email every Monday that tells them how the business is tracking: revenue, new customers, active subscriptions, and a sentence or two of plain-English context. Pulling those numbers by hand is slow and error-prone, and sending raw figures straight to executives with no review invites mistakes. This Spojit workflow compiles the metrics automatically, lets an Agent-mode Connector node draft the narrative, and inserts a mandatory human checkpoint so a finance lead approves the exact figures and wording before anything reaches an inbox.

It runs on a Schedule trigger (for example every Monday at 8am in your timezone). On each run it queries your reporting database with the MySQL connector, fetches the latest revenue from Stripe, computes totals and growth percentages with the math connector, and asks an Agent-mode Connector node to write the commentary. The workflow then stops at a Human approval node and waits. If the finance lead approves, the Send Email node delivers the update and the run completes. If they reject or it times out, the run halts and no email is sent, so a bad number never goes out. Each weekly run is independent: there is no carry-over state between runs, and a halted run simply means that week's email was not sent.

Prerequisites

  • A MySQL connection to your reporting database (host, port, database, and read credentials). See the guide on setting up a connection if you have not added one yet.
  • A Stripe connection with an API key that can list charges, invoices, and subscriptions.
  • The math connector, which is built in and needs no connection.
  • The email addresses of your executive recipients added to the org allowlist under Settings -> General -> Email recipients.
  • The finance lead's Spojit user, role, or team identified so you can assign them as an approver.
  • Optional: AI credits available, since Agent mode drafting consumes credits.

Step 1: Add the Schedule trigger

Open the Workflow Designer, create a new workflow, and set the Trigger node type to Schedule. Add a 5-field cron expression and an IANA timezone so the report lands at a predictable local time. For Monday mornings at 8am Sydney time, use:

Cron:     0 8 * * 1
Timezone: Australia/Sydney

The trigger output is {{ scheduledAt }}, which you can use to label the report. A single Schedule trigger can hold multiple schedules if you also want a mid-week run.

Step 2: Pull revenue and subscription metrics from MySQL and Stripe

Add a Connector node in Direct mode on the MySQL connector and pick the execute-query tool. Direct mode keeps this deterministic with no AI cost. Query last week's order totals and customer counts from your reporting tables. For example:

SELECT
  COUNT(*)            AS order_count,
  SUM(total_amount)   AS gross_revenue,
  COUNT(DISTINCT customer_id) AS new_customers
FROM orders
WHERE created_at >= NOW() - INTERVAL 7 DAY;

Save the result to a variable such as db_metrics. Then add a second Connector node in Direct mode on the Stripe connector using list-charges to capture paid revenue for the period, and (optionally) a third using list-subscriptions to count active subscriptions. Map a date filter so each call only returns the last seven days, and store the outputs as stripe_charges and stripe_subs.

Step 3: Compute totals and growth with the math connector

Add a Connector node in Direct mode on the math connector. Use sum to total the Stripe charge amounts from {{ stripe_charges }}, and use percentage or calculate to derive week-over-week growth against last week's figure. Use currency to format gross revenue as a clean money string for the email. For example, a calculate expression for growth:

((this_week - last_week) / last_week) * 100

Save each computed value to its own variable, for example total_revenue, revenue_growth, and mrr. Because the math connector runs in process with no AI cost, this keeps your number-crunching fast and exact.

Step 4: Draft the commentary with an Agent mode node

Add a Connector node in Agent mode so the agent can turn the raw figures into a short, readable narrative. In the prompt, hand it the computed variables and ask for two or three sentences of plain-English context. Turn on the Response Schema so the output is reliable, structured JSON you can drop into the email. For example, prompt with:

Write a concise weekly executive summary.
Revenue: {{ total_revenue }}
Growth vs last week: {{ revenue_growth }}%
New customers: {{ db_metrics.new_customers }}
Active subscriptions: {{ stripe_subs.count }}
Return JSON: { "headline": string, "commentary": string }

Save the result to summary. You will reference {{ summary.headline }} and {{ summary.commentary }} in the email body. Agent mode consumes AI credits, so keep the prompt tight and let the math connector do the arithmetic rather than the model.

Step 5: Pause for finance sign-off with a Human approval node

Add a Human node so the workflow stops and waits for your finance lead. Set a clear Label (for example Approve weekly executive metrics) and a Message that shows the figures to review. Use templating in the Notification title and Notification body, for example:

Title: Weekly metrics ready for review
Body:  Revenue {{ total_revenue }}, growth {{ revenue_growth }}%, {{ db_metrics.new_customers }} new customers. Approve before sending.

Set Urgency to High and add a Timeout (minutes) if the email must go out by a deadline. The only required field is Approval slots: add one slot containing your finance lead as a User atom, or a Role or Team atom. Approval completes when every slot is satisfied. The approver acts in the Approvals inbox at /approvals. On approval the node outputs { approved: true, outcome: "APPROVED" } and the run continues. A reject or timeout halts the run, so nothing is emailed. Note that "on reject do X" branching is not supported: rejection simply stops the workflow.

Step 6: Send the executive email

Add a Send Email node, which uses Spojit's built-in mail service and needs no connection. Set Recipients to your executive list (comma-separated, all on the org allowlist), a templated Subject, and a Body that assembles the approved figures and commentary:

Subject: Weekly metrics - {{ summary.headline }}

Revenue: {{ total_revenue }} ({{ revenue_growth }}% vs last week)
New customers: {{ db_metrics.new_customers }}
Active subscriptions: {{ stripe_subs.count }}

{{ summary.commentary }}

Set If sending fails to Fail the workflow so a delivery problem is visible in your execution history rather than passing silently. Because this node sits after the Human node, only sign-off-approved content ever reaches the recipients. Note that only upstream variables resolve here, and each send counts toward your monthly email allowance. To send from your own domain instead, swap in the Resend or SMTP connector.

Tips

  • Keep all arithmetic in the math connector and reserve Agent mode for wording only. This keeps figures exact and AI cost low.
  • Email the approver by turning on Email approvers on the Human node so they get a heads-up without opening the app.
  • Set a sensible Timeout (minutes) on the Human node so a holiday or missed review does not leave the run waiting forever.
  • Store last week's totals in a small MySQL table (via an insert-rows Connector node at the end) so week-over-week growth has a reliable baseline.

Common Pitfalls

  • Timezone drift: a Schedule cron with the wrong IANA timezone can fire your report a day early or late. Confirm the timezone matches where your finance lead works.
  • Date windows that overlap: if your MySQL query and Stripe list-charges filter use different day boundaries, revenue figures will not reconcile. Align both to the same seven-day window.
  • Recipients not on the allowlist: the Send Email node will not deliver to external addresses that are not added under Settings -> General -> Email recipients.
  • Expecting a reject branch: the Human node halts on rejection and cannot route to an alternate path. If you need follow-up on rejects, handle it manually or have the approver edit and re-run.

Testing

Before scheduling it live, swap the Schedule trigger for a Manual trigger and use the Run button so you control exactly when it fires. Point the recipients at your own inbox first, assign yourself as the sole approver, and run it end to end: confirm the MySQL and Stripe figures match a manual check, approve in the Approvals inbox, and verify the email arrives with the right numbers and commentary. Then reject a test run to confirm no email is sent. Once you are confident, restore the Schedule trigger and the real recipient and approver lists.

Learn More

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.