@addai/flows-mcp 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/skill/recipes.md CHANGED
@@ -1,294 +1,294 @@
1
- # Flow recipes
2
-
3
- Patterns to compose. Each recipe is a flow shape that solves a class of problem. Read the recipe header to find the right one; then follow the exact tool-call sequence inside.
4
-
5
- When in doubt, build with these recipes as templates and adapt — don't invent from scratch.
6
-
7
- ## Recipe 1 — Form-driven flow
8
-
9
- **Use when:** Public form collects input → process → confirmation page.
10
-
11
- **Shape (form-as-goal — NO trailing goal node):**
12
- ```
13
- [page (isStartForm)] → [code: validate] → [httpRequest: save] → [page (isGoal)]
14
- ```
15
-
16
- A `page` node with `data.isGoal: true` and a `goalName` IS the goal — do not add a separate `goal` node. The confirmation page terminates the flow and registers the goal in stats.
17
-
18
- **EVERY form input element MUST have a `label`. EVERY form MUST start with a `textBlock` heading.** A page with empty labels renders as three unmarked grey rectangles and is unusable. See AP14 in `anti-patterns.md`.
19
-
20
- Pick the right element type per field:
21
- - short single-line text (name, subject) → `shortText`
22
- - multi-line text (feedback, message) → `longText`
23
- - email-validated input → `email`
24
- - URL-validated input → `url`
25
- - number with optional min/max → `number`
26
- - list selector → `dropdown` or `multipleChoice`
27
-
28
- **Tool sequence:**
29
- ```
30
- 1. create_flow({name: "feedback", description: "Customer feedback form"})
31
- 2. describe_node_type("page") # see isStartForm / isGoal / isExit
32
- 3. describe_page_element("shortText") # see required fields
33
- 4. add_nodes({
34
- flow_id,
35
- // NO position fields — add_nodes auto-places horizontally
36
- nodes: [
37
- {id: "form", type: "page", data: {
38
- isStartForm: true,
39
- formSlug: "feedback",
40
- elements: [
41
- {
42
- id: "heading",
43
- type: "textBlock",
44
- content: "# We'd love your feedback\n\nTake 30 seconds to tell us how we're doing.",
45
- variant: "h2",
46
- },
47
- {
48
- id: "name",
49
- type: "shortText",
50
- label: "Your name",
51
- placeholder: "Jane Doe",
52
- required: true,
53
- width: "half",
54
- },
55
- {
56
- id: "email",
57
- type: "email",
58
- label: "Email address",
59
- placeholder: "jane@example.com",
60
- required: true,
61
- width: "half",
62
- },
63
- {
64
- id: "rating",
65
- type: "dropdown",
66
- label: "Overall experience",
67
- required: true,
68
- options: [
69
- {value: "5", label: "Excellent"},
70
- {value: "4", label: "Good"},
71
- {value: "3", label: "Okay"},
72
- {value: "2", label: "Poor"},
73
- {value: "1", label: "Terrible"},
74
- ],
75
- },
76
- {
77
- id: "message",
78
- type: "longText",
79
- label: "What can we do better?",
80
- placeholder: "Anything specific that stood out...",
81
- helpText: "Optional — but the more detail you give the more we can act on.",
82
- rows: 5,
83
- },
84
- {
85
- id: "submit",
86
- type: "button",
87
- buttonText: "Send feedback",
88
- buttonAction: "submit",
89
- buttonAlign: "left",
90
- },
91
- ],
92
- }},
93
- {id: "save", type: "httpRequest", data: {
94
- url: "https://api.example.com/feedback",
95
- method: "POST",
96
- bodyType: "json",
97
- body: '{"name":"{{form.submissionData.Your name}}","email":"{{form.submissionData.Email address}}","rating":"{{form.submissionData.Overall experience}}","message":"{{form.submissionData.What can we do better?}}"}',
98
- }},
99
- {id: "thanks", type: "page", data: {
100
- isGoal: true,
101
- goalName: "feedback_submitted",
102
- elements: [
103
- {
104
- id: "thanks_heading",
105
- type: "textBlock",
106
- content: "# Thank you!\n\nYour feedback has been received. We read every response.",
107
- variant: "h2",
108
- },
109
- ],
110
- }},
111
- ],
112
- edges: [
113
- {source: "form", target: "save", sourceHandle: "right"},
114
- {source: "save", target: "thanks"},
115
- ],
116
- })
117
- 5. validate_flow({flow_id})
118
- 6. test_flow({flow_id, input_data: {}})
119
- ```
120
-
121
- **Form-quality checklist (do before publishing):**
122
- - [ ] First element is a `textBlock` heading that explains what the form is for
123
- - [ ] Every input has a non-empty `label`
124
- - [ ] Every input has a `placeholder` (or sensible `defaultValue`)
125
- - [ ] Required fields have `required: true`
126
- - [ ] Short fields (name, email) use `width: "half"` so they sit side-by-side
127
- - [ ] **Every non-terminal page has at least one `button` element with `buttonAction: "submit"`** — otherwise the user has no way to advance the flow. The button's field is `buttonText`, NOT `label`. Action values: `submit` / `link` / `stop` / `restart`.
128
- - [ ] Submit button has a meaningful `buttonText` ("Send feedback", not "Continue")
129
- - [ ] Thank-you page (`isGoal: true`) has a `textBlock` confirming success
130
-
131
- If you need a server response back to the form caller (not a confirmation page), use `respondToWebhook` followed by a separate `goal` node — but for typical web forms, the thank-you page IS the natural goal.
132
-
133
- ## Recipe 2 — HTTP fan-out with retries
134
-
135
- **Use when:** Loop over a list, call an HTTP API per item, collect results, continue.
136
-
137
- **Shape:**
138
- ```
139
- [trigger] → [loop] -loop-> [httpRequest] → [code: accumulate] → (back to loop)
140
- \-done-> [code: summarize] → [respondToWebhook]
141
- ```
142
-
143
- **Key points:**
144
- - The `httpRequest` `onError` config controls retry. Use `retries: 3` and `onError: "continue"` for tolerant fan-out.
145
- - After the loop's `done` handle, gather the iteration results via `$("loop1").items` in a code node.
146
-
147
- ## Recipe 3 — Branching with fallback exit
148
-
149
- **Use when:** Decide between two paths; one path may fail; provide an explicit alternative termination.
150
-
151
- **Shape:**
152
- ```
153
- [trigger] → [if] -true-> [httpRequest: primary] → [goal: success]
154
- \-false-> [httpRequest: fallback] → [exit: fallback_used]
155
- ```
156
-
157
- The two terminators (`goal` vs `exit`) let you measure the rate of fallback usage via `get_outcome_breakdown`.
158
-
159
- ## Recipe 4 — A/B test setup
160
-
161
- **Use when:** Compare two flow variants on production traffic.
162
-
163
- **Tool sequence:**
164
- ```
165
- 1. create_version({flow_id, name: "v1-baseline"}) # snapshot current state
166
- 2. (edit flow into variant B)
167
- 3. publish_flow({flow_id, version_name: "v2-experiment"})
168
- 4. create_split_test({flow_id, name: "homepage_copy", variants: [
169
- {version_id: "<v1_id>", label: "control", percentage: 50},
170
- {version_id: "<v2_id>", label: "variant", percentage: 50},
171
- ]})
172
- 5. start_split_test({split_test_id})
173
- # Wait for results...
174
- 6. get_split_test_analytics({split_test_id})
175
- 7. declare_split_test_winner({split_test_id, winner_version_id: "<winner>"})
176
- ```
177
-
178
- ## Recipe 5 — Child-flow composition
179
-
180
- **Use when:** A reusable subroutine called by multiple parent flows.
181
-
182
- **Shape:** Parent uses a `flow` node that invokes a child flow.
183
-
184
- ```
185
- [parent trigger] → [code: prep input] → [flow: invoke_child(flowId)] → [code: handle output] → [goal]
186
- ```
187
-
188
- The child receives `body` as its trigger input; output of the `flow` node has `runId`, `status`, `outputs`.
189
-
190
- ## Recipe 6 — Paginated HTTP fetch
191
-
192
- **Use when:** External API returns paginated results; need to walk pages until empty.
193
-
194
- **Shape:**
195
- ```
196
- [trigger] → [variable: init cursor=null] → [httpRequest: fetch page] →
197
- [if: hasMore] -true-> [variable: update cursor] → (back to httpRequest)
198
- \-false-> [code: aggregate] → [goal]
199
- ```
200
-
201
- Variables hold the cursor; `goTo` to the `httpRequest` re-runs with updated state.
202
-
203
- ## Recipe 7 — Retry-on-failure with exponential backoff (code-node version)
204
-
205
- **Use when:** A flaky external dependency needs retry logic beyond what `httpRequest` provides.
206
-
207
- Inside a code node:
208
-
209
- ```javascript
210
- async function tryFetch(url, attempt = 1, maxAttempts = 5) {
211
- const r = await fetch(url);
212
- if (r.ok) return await r.json();
213
- if (attempt >= maxAttempts) throw new Error(`Failed after ${attempt} attempts`);
214
- await new Promise(res => setTimeout(res, 200 * Math.pow(2, attempt - 1)));
215
- return tryFetch(url, attempt + 1, maxAttempts);
216
- }
217
- return { data: await tryFetch($("trigger").body.url) };
218
- ```
219
-
220
- When this pattern recurs, **promote it to a custom node** so other flows can reuse it (see Recipe 8).
221
-
222
- ## Recipe 8 — Promote a code node to a custom node
223
-
224
- **Use when:** The same code pattern appears in 3+ flows.
225
-
226
- ```
227
- 1. test_custom_node_code({code, input_schema, output_schema, inputs: {...}})
228
- 2. create_custom_node({name, code, input_schema, output_schema, secret_requirements})
229
- 3. publish_custom_node({custom_node_id, version: "1.0.0"})
230
- 4. Inside each consumer flow, replace the inline code with a customNode reference:
231
- {type: "customNode", data: {customNodeId, customVersionId}}
232
- ```
233
-
234
- **Always pin `customVersionId`** — see flow-semantics.md.
235
-
236
- ## Recipe 9 — Webhook trigger with HMAC verification
237
-
238
- **Use when:** External service signs requests; verify before processing.
239
-
240
- ```
241
- [trigger (webhook)] → [code: verifyHmac] →
242
- [if: valid] -true-> [process...] -> [respondToWebhook(200)] -> [goal]
243
- \-false-> [respondToWebhook(401)] -> [exit: invalid_signature]
244
- ```
245
-
246
- Inside the verify code node:
247
- ```javascript
248
- import crypto from 'crypto';
249
- const sig = $("trigger").headers['x-signature'];
250
- const payload = JSON.stringify($("trigger").body);
251
- const expected = crypto.createHmac('sha256', secrets.WEBHOOK_SECRET).update(payload).digest('hex');
252
- return { valid: sig === expected };
253
- ```
254
-
255
- ## Recipe 10 — Schedule trigger with TZ-aware cron
256
-
257
- **Use when:** Run a flow on a recurring schedule in a specific timezone.
258
-
259
- ```
260
- [scheduleTrigger: cron="0 9 * * MON" tz="America/New_York"] → [...] → [goal]
261
- ```
262
-
263
- Before adding: `preview_schedule({cron_expression: "0 9 * * MON", timezone: "America/New_York", count: 10})` (Phase 2 tool — for Phase 1, manually verify the cron in [crontab.guru](https://crontab.guru) with the TZ in mind).
264
-
265
- Anti-pattern: don't use UTC cron when the business meaning is local time. DST will silently shift fires.
266
-
267
- ## Recipe 11 — Tables-driven flow
268
-
269
- **Use when:** Trigger on row insert/update in a +Ai Tables table.
270
-
271
- ```
272
- [tableTrigger(insert)] → [code: enrich] → [httpRequest: notify] → [goal]
273
- ```
274
-
275
- Trigger output shape:
276
- ```
277
- { event: "INSERT", row: {...}, oldRow: null, rowId: "...", databaseId: "...", tableId: "..." }
278
- ```
279
-
280
- Validate referenced columns exist before publish: `list_table_triggers(table_id)` then check via Tables API (Phase 2: `validate_table_columns`).
281
-
282
- ## Recipe 12 — Approval-gated publish
283
-
284
- **Use when:** A flow change requires human approval before going live.
285
-
286
- ```
287
- [trigger] → [...changes...] →
288
- [review (approver_email)] -approved-> [respondToWebhook(200)] -> [goal]
289
- \-rejected-> [exit: review_rejected]
290
- ```
291
-
292
- The `review` node pauses execution until a human responds. Use `respond_to_review` (tool) to act as approver during dev — or wire to your actual approval channel.
293
-
294
- Pre-publish always: `pre_publish_check` (Phase 2) gates publishing on approval status.
1
+ # Flow recipes
2
+
3
+ Patterns to compose. Each recipe is a flow shape that solves a class of problem. Read the recipe header to find the right one; then follow the exact tool-call sequence inside.
4
+
5
+ When in doubt, build with these recipes as templates and adapt — don't invent from scratch.
6
+
7
+ ## Recipe 1 — Form-driven flow
8
+
9
+ **Use when:** Public form collects input → process → confirmation page.
10
+
11
+ **Shape (form-as-goal — NO trailing goal node):**
12
+ ```
13
+ [page (isStartForm)] → [code: validate] → [httpRequest: save] → [page (isGoal)]
14
+ ```
15
+
16
+ A `page` node with `data.isGoal: true` and a `goalName` IS the goal — do not add a separate `goal` node. The confirmation page terminates the flow and registers the goal in stats.
17
+
18
+ **EVERY form input element MUST have a `label`. EVERY form MUST start with a `textBlock` heading.** A page with empty labels renders as three unmarked grey rectangles and is unusable. See AP14 in `anti-patterns.md`.
19
+
20
+ Pick the right element type per field:
21
+ - short single-line text (name, subject) → `shortText`
22
+ - multi-line text (feedback, message) → `longText`
23
+ - email-validated input → `email`
24
+ - URL-validated input → `url`
25
+ - number with optional min/max → `number`
26
+ - list selector → `dropdown` or `multipleChoice`
27
+
28
+ **Tool sequence:**
29
+ ```
30
+ 1. create_flow({name: "feedback", description: "Customer feedback form"})
31
+ 2. describe_node_type("page") # see isStartForm / isGoal / isExit
32
+ 3. describe_page_element("shortText") # see required fields
33
+ 4. add_nodes({
34
+ flow_id,
35
+ // NO position fields — add_nodes auto-places horizontally
36
+ nodes: [
37
+ {id: "form", type: "page", data: {
38
+ isStartForm: true,
39
+ formSlug: "feedback",
40
+ elements: [
41
+ {
42
+ id: "heading",
43
+ type: "textBlock",
44
+ content: "# We'd love your feedback\n\nTake 30 seconds to tell us how we're doing.",
45
+ variant: "h2",
46
+ },
47
+ {
48
+ id: "name",
49
+ type: "shortText",
50
+ label: "Your name",
51
+ placeholder: "Jane Doe",
52
+ required: true,
53
+ width: "half",
54
+ },
55
+ {
56
+ id: "email",
57
+ type: "email",
58
+ label: "Email address",
59
+ placeholder: "jane@example.com",
60
+ required: true,
61
+ width: "half",
62
+ },
63
+ {
64
+ id: "rating",
65
+ type: "dropdown",
66
+ label: "Overall experience",
67
+ required: true,
68
+ options: [
69
+ {value: "5", label: "Excellent"},
70
+ {value: "4", label: "Good"},
71
+ {value: "3", label: "Okay"},
72
+ {value: "2", label: "Poor"},
73
+ {value: "1", label: "Terrible"},
74
+ ],
75
+ },
76
+ {
77
+ id: "message",
78
+ type: "longText",
79
+ label: "What can we do better?",
80
+ placeholder: "Anything specific that stood out...",
81
+ helpText: "Optional — but the more detail you give the more we can act on.",
82
+ rows: 5,
83
+ },
84
+ {
85
+ id: "submit",
86
+ type: "button",
87
+ buttonText: "Send feedback",
88
+ buttonAction: "submit",
89
+ buttonAlign: "left",
90
+ },
91
+ ],
92
+ }},
93
+ {id: "save", type: "httpRequest", data: {
94
+ url: "https://api.example.com/feedback",
95
+ method: "POST",
96
+ bodyType: "json",
97
+ body: '{"name":"{{form.submissionData.Your name}}","email":"{{form.submissionData.Email address}}","rating":"{{form.submissionData.Overall experience}}","message":"{{form.submissionData.What can we do better?}}"}',
98
+ }},
99
+ {id: "thanks", type: "page", data: {
100
+ isGoal: true,
101
+ goalName: "feedback_submitted",
102
+ elements: [
103
+ {
104
+ id: "thanks_heading",
105
+ type: "textBlock",
106
+ content: "# Thank you!\n\nYour feedback has been received. We read every response.",
107
+ variant: "h2",
108
+ },
109
+ ],
110
+ }},
111
+ ],
112
+ edges: [
113
+ {source: "form", target: "save", sourceHandle: "right"},
114
+ {source: "save", target: "thanks"},
115
+ ],
116
+ })
117
+ 5. validate_flow({flow_id})
118
+ 6. test_flow({flow_id, input_data: {}})
119
+ ```
120
+
121
+ **Form-quality checklist (do before publishing):**
122
+ - [ ] First element is a `textBlock` heading that explains what the form is for
123
+ - [ ] Every input has a non-empty `label`
124
+ - [ ] Every input has a `placeholder` (or sensible `defaultValue`)
125
+ - [ ] Required fields have `required: true`
126
+ - [ ] Short fields (name, email) use `width: "half"` so they sit side-by-side
127
+ - [ ] **Every non-terminal page has at least one `button` element with `buttonAction: "submit"`** — otherwise the user has no way to advance the flow. The button's field is `buttonText`, NOT `label`. Action values: `submit` / `link` / `stop` / `restart`.
128
+ - [ ] Submit button has a meaningful `buttonText` ("Send feedback", not "Continue")
129
+ - [ ] Thank-you page (`isGoal: true`) has a `textBlock` confirming success
130
+
131
+ If you need a server response back to the form caller (not a confirmation page), use `respondToWebhook` followed by a separate `goal` node — but for typical web forms, the thank-you page IS the natural goal.
132
+
133
+ ## Recipe 2 — HTTP fan-out with retries
134
+
135
+ **Use when:** Loop over a list, call an HTTP API per item, collect results, continue.
136
+
137
+ **Shape:**
138
+ ```
139
+ [trigger] → [loop] -loop-> [httpRequest] → [code: accumulate] → (back to loop)
140
+ \-done-> [code: summarize] → [respondToWebhook]
141
+ ```
142
+
143
+ **Key points:**
144
+ - The `httpRequest` `onError` config controls retry. Use `retries: 3` and `onError: "continue"` for tolerant fan-out.
145
+ - After the loop's `done` handle, gather the iteration results via `$("loop1").items` in a code node.
146
+
147
+ ## Recipe 3 — Branching with fallback exit
148
+
149
+ **Use when:** Decide between two paths; one path may fail; provide an explicit alternative termination.
150
+
151
+ **Shape:**
152
+ ```
153
+ [trigger] → [if] -true-> [httpRequest: primary] → [goal: success]
154
+ \-false-> [httpRequest: fallback] → [exit: fallback_used]
155
+ ```
156
+
157
+ The two terminators (`goal` vs `exit`) let you measure the rate of fallback usage via `get_outcome_breakdown`.
158
+
159
+ ## Recipe 4 — A/B test setup
160
+
161
+ **Use when:** Compare two flow variants on production traffic.
162
+
163
+ **Tool sequence:**
164
+ ```
165
+ 1. create_version({flow_id, name: "v1-baseline"}) # snapshot current state
166
+ 2. (edit flow into variant B)
167
+ 3. publish_flow({flow_id, version_name: "v2-experiment"})
168
+ 4. create_split_test({flow_id, name: "homepage_copy", variants: [
169
+ {version_id: "<v1_id>", label: "control", percentage: 50},
170
+ {version_id: "<v2_id>", label: "variant", percentage: 50},
171
+ ]})
172
+ 5. start_split_test({split_test_id})
173
+ # Wait for results...
174
+ 6. get_split_test_analytics({split_test_id})
175
+ 7. declare_split_test_winner({split_test_id, winner_version_id: "<winner>"})
176
+ ```
177
+
178
+ ## Recipe 5 — Child-flow composition
179
+
180
+ **Use when:** A reusable subroutine called by multiple parent flows.
181
+
182
+ **Shape:** Parent uses a `flow` node that invokes a child flow.
183
+
184
+ ```
185
+ [parent trigger] → [code: prep input] → [flow: invoke_child(flowId)] → [code: handle output] → [goal]
186
+ ```
187
+
188
+ The child receives `body` as its trigger input; output of the `flow` node has `runId`, `status`, `outputs`.
189
+
190
+ ## Recipe 6 — Paginated HTTP fetch
191
+
192
+ **Use when:** External API returns paginated results; need to walk pages until empty.
193
+
194
+ **Shape:**
195
+ ```
196
+ [trigger] → [variable: init cursor=null] → [httpRequest: fetch page] →
197
+ [if: hasMore] -true-> [variable: update cursor] → (back to httpRequest)
198
+ \-false-> [code: aggregate] → [goal]
199
+ ```
200
+
201
+ Variables hold the cursor; `goTo` to the `httpRequest` re-runs with updated state.
202
+
203
+ ## Recipe 7 — Retry-on-failure with exponential backoff (code-node version)
204
+
205
+ **Use when:** A flaky external dependency needs retry logic beyond what `httpRequest` provides.
206
+
207
+ Inside a code node:
208
+
209
+ ```javascript
210
+ async function tryFetch(url, attempt = 1, maxAttempts = 5) {
211
+ const r = await fetch(url);
212
+ if (r.ok) return await r.json();
213
+ if (attempt >= maxAttempts) throw new Error(`Failed after ${attempt} attempts`);
214
+ await new Promise(res => setTimeout(res, 200 * Math.pow(2, attempt - 1)));
215
+ return tryFetch(url, attempt + 1, maxAttempts);
216
+ }
217
+ return { data: await tryFetch($("trigger").body.url) };
218
+ ```
219
+
220
+ When this pattern recurs, **promote it to a custom node** so other flows can reuse it (see Recipe 8).
221
+
222
+ ## Recipe 8 — Promote a code node to a custom node
223
+
224
+ **Use when:** The same code pattern appears in 3+ flows.
225
+
226
+ ```
227
+ 1. test_custom_node_code({code, input_schema, output_schema, inputs: {...}})
228
+ 2. create_custom_node({name, code, input_schema, output_schema, secret_requirements})
229
+ 3. publish_custom_node({custom_node_id, version: "1.0.0"})
230
+ 4. Inside each consumer flow, replace the inline code with a customNode reference:
231
+ {type: "customNode", data: {customNodeId, customVersionId}}
232
+ ```
233
+
234
+ **Always pin `customVersionId`** — see flow-semantics.md.
235
+
236
+ ## Recipe 9 — Webhook trigger with HMAC verification
237
+
238
+ **Use when:** External service signs requests; verify before processing.
239
+
240
+ ```
241
+ [trigger (webhook)] → [code: verifyHmac] →
242
+ [if: valid] -true-> [process...] -> [respondToWebhook(200)] -> [goal]
243
+ \-false-> [respondToWebhook(401)] -> [exit: invalid_signature]
244
+ ```
245
+
246
+ Inside the verify code node:
247
+ ```javascript
248
+ import crypto from 'crypto';
249
+ const sig = $("trigger").headers['x-signature'];
250
+ const payload = JSON.stringify($("trigger").body);
251
+ const expected = crypto.createHmac('sha256', secrets.WEBHOOK_SECRET).update(payload).digest('hex');
252
+ return { valid: sig === expected };
253
+ ```
254
+
255
+ ## Recipe 10 — Schedule trigger with TZ-aware cron
256
+
257
+ **Use when:** Run a flow on a recurring schedule in a specific timezone.
258
+
259
+ ```
260
+ [scheduleTrigger: cron="0 9 * * MON" tz="America/New_York"] → [...] → [goal]
261
+ ```
262
+
263
+ Before adding: `preview_schedule({cron_expression: "0 9 * * MON", timezone: "America/New_York", count: 10})` (Phase 2 tool — for Phase 1, manually verify the cron in [crontab.guru](https://crontab.guru) with the TZ in mind).
264
+
265
+ Anti-pattern: don't use UTC cron when the business meaning is local time. DST will silently shift fires.
266
+
267
+ ## Recipe 11 — Tables-driven flow
268
+
269
+ **Use when:** Trigger on row insert/update in a +Ai Tables table.
270
+
271
+ ```
272
+ [tableTrigger(insert)] → [code: enrich] → [httpRequest: notify] → [goal]
273
+ ```
274
+
275
+ Trigger output shape:
276
+ ```
277
+ { event: "INSERT", row: {...}, oldRow: null, rowId: "...", databaseId: "...", tableId: "..." }
278
+ ```
279
+
280
+ Validate referenced columns exist before publish: `list_table_triggers(table_id)` then check via Tables API (Phase 2: `validate_table_columns`).
281
+
282
+ ## Recipe 12 — Approval-gated publish
283
+
284
+ **Use when:** A flow change requires human approval before going live.
285
+
286
+ ```
287
+ [trigger] → [...changes...] →
288
+ [review (approver_email)] -approved-> [respondToWebhook(200)] -> [goal]
289
+ \-rejected-> [exit: review_rejected]
290
+ ```
291
+
292
+ The `review` node pauses execution until a human responds. Use `respond_to_review` (tool) to act as approver during dev — or wire to your actual approval channel.
293
+
294
+ Pre-publish always: `pre_publish_check` (Phase 2) gates publishing on approval status.