Safety and approval gates
- Build a pause-and-resume workflow that waits for a human button click
- Decide which actions require a gate (and which don't) on cost-of-mistake
- Log every approve/reject decision with who, when, and why
Action systems need controls. Automation without gates is how small bugs become medium incidents — and "the model seemed confident" is not a defence when the message has already been sent.
- If a workflow sends 100 emails and 3 are wrong, what should have happened at message 1?
- Which of these needs a gate: internal log write, Slack post to #general, email to a patient?
Approval gates are checkpoints where the system pauses for a human to review a decision or output before taking a consequential action. They are critical whenever the cost of a mistake is non-trivial — sending messages to patients, writing to a real database, modifying a dataset.
The design rule: gate on the *action*, not the generation. Drafting is cheap and private; sending is expensive and public. Every consequential side-effect gets a gate.
Your AI system is about to take these 5 actions. Which should auto-proceed, which need a human approval gate?
A participant communication draft (reschedule, reminder, eligibility decision) is generated automatically but must be reviewed by the coordinator before sending.
▸ Use the instructor's finished build before you build yours feel what "done" looks like — then recreate it
Not loading? https://dify.32dots.de/chat/huWWIK0tXBYAnBcO
- UNESCO guidance ↗ open
Build: Form Trigger (coordinator submits recipient + context) → Chat Model (drafts message) → Slack node (posts draft to #participant-comms channel with Approve/Reject buttons via interactive message) → Wait node (until button click webhook) → IF → Send email on approve, log on reject.
Form TriggerChat Model (draft)Slack (interactive message with buttons) or Email + Wait nodeWebhook (receives approval response)IF node on decisionSMTP / Gmail node (send)Postgres / Sheets (log every gate decision)
Approval gates are fundamentally about *pausing a workflow and resuming on external input* — that's a Wait + Webhook pattern n8n has built-in. Dify apps run to completion in one request; they don't pause for a Slack button click. Human-in-the-loop across days = n8n.
- **Auto-approve default** — if the workflow proceeds when no one clicks, your gate is decoration. Default must be reject or escalate.
- **Gate too late** — gating after sending is an audit trail, not a gate. Pause before the side-effect.
- **No reject path** — "reject" should do something (log, notify, store feedback), not just drop the run silently.
Why is a human-in-the-loop often a design strength rather than a weakness?
Build a reviewed message-drafting assistant with a real approval UI (Slack button or email reply).
Workflow with a working approval gate, run on ≥3 drafts, with a log of approve/reject decisions.
If your gate broke silently and nobody noticed for a week, what is the worst single action that would have auto-sent — and who would have received it?