Automation Advanced 17 min

Chaining workflows — when one automation feeds another

The problem

Your chain pulls sales data, cleans it, analyses it, drafts the summary and sends it. It has worked for two months. This week the export contained one extra column.

The workflow
1Map the stages
2Define each stage's input contract
3Add validation
4Add logging
5Place the human gate
6Test each stage alone
7Test end to end
Add a heartbeat

What you need

Stages: (1) pull the marketplace settlement export from an email attachment; (2) clean it; (3) reconcile against the sales register; (4) analyse differences; (5) draft the summary; (6) email it to the finance manager. Trigger: weekly, when the settlement email arrives.

The tool

Apps Script with functions per stage

The prompt

Subscribers. The full prompt is part of the SMEMinds AI Playbook. See plans.

What comes back

1. STAGES — six is too many for one chain.

Verify before you use it

Human review required. Check every line below before this leaves your screen.
  • The split into two chains with a human gate on the differences table is the key change. Implement that before any validation work.
  • The match-rate check is the highest-value validation. A reconciliation matching on the wrong key produces plausible output and is otherwise undetectable.
  • Rows-in versus rows-out logging at every stage costs almost nothing and is the first thing you will look at when something is wrong.
  • Test each stage in isolation with deliberately broken input before testing end to end.