Session 6 / 15๐Ÿ”Žืขื‘

What we learn today โ€” a short video

โšก By the end of the session you will know

  • An Iterator breaks an array into bundles; aggregators combine them back.
  • A Repeater for loops and pagination; Sleep up to 300 seconds.
  • Five error handlers: Ignore, Resume, Break, Rollback, Commit.
  • Break + incomplete executions = runs that don't get lost.
  • We built a resilient payment-reminder system.

A silent video of about half a minute: the session topic, the learning goals (also listed in the next section) and the scenario we build today.

The story of Etz va'Or (Wood & Light) โ€” Chapter 6: Who hasn't paid yet?

60 open orders, and 12 customers still haven't finished paying. Maya hates chasing money. We'll build a reminder system that goes through everyone, sends politely, doesn't crash when an API goes down โ€” and reports to her only what matters.

๐Ÿงต One story across the whole course: every session solves a real problem for the business. At the end โ€” a complete system.

Session goals

  1. Break an array into bundles with an Iterator and understand its effect on Credits.
  2. Combine bundles with Array, Text, Numeric and Table aggregators.
  3. Create a loop with a Repeater and pause with Sleep.
  4. Know the five error handlers and when to use each one.
  5. Turn on incomplete executions and complete runs that failed.
  6. Build retries and an error-alert scenario.
  7. Build a payment-reminder system that is resilient to errors.

Session agenda (3 hours)

  1. 00:00โ€“00:15 Review: the CRM
  2. 00:15โ€“00:45 Iterator and aggregators
  3. 00:45โ€“01:05 Repeater, Sleep and rate limits
  4. 01:05โ€“01:20 โ˜• Break
  5. 01:20โ€“02:00 Error handlers and incomplete executions
  6. 02:00โ€“02:15 Error alerts
  7. 02:15โ€“02:50 Building together: payment reminders
  8. 02:50โ€“03:00 Summary and practice

What to prepare for this session

An invoices sheet

From the session 5 task: client, email, amount, due, paid.

The Telegram bot

For error alerts and a daily summary.

httpstat.us

https://httpstat.us (opens in a new window)
Returns any status code you ask for โ€” for practicing errors (for example /503).

Iterator โ€” array โ†’ bundles

In session 2 we saw that an array inside a bundle is still one bundle. An Iterator (Flow Control โ†’ Iterator) breaks it up: a bundle per item. All the modules after it run once per item.

๐Ÿ’ฐ An Iterator multiplies Credits1 email ร— 3 files: Gmail (1) + Iterator (1) + Drive (3) = 5 Credits. With 50 files โ€” 52. Before an Iterator always ask: can this be done in one action (Bulk / API)?

Aggregators โ€” bundles โ†’ one

An aggregator does the opposite: it collects several bundles and outputs one. In every aggregator you choose a Source module โ€” where it starts collecting from (usually the Iterator or the search).

AggregatorOutputsUse
Array aggregatorAn array of collectionsBulk Add, Create JSON, passing to an AI agent
Text aggregatorOne joined textA list in a Telegram message/email
Numeric aggregatorA number (SUM, AVG, COUNT, MIN, MAX)A total of debts
Table aggregatorA table (CSV/HTML)Reports
Group by (in the settings)A bundle per groupA summary per client/agent
๐Ÿ’ก Search already outputs bundlesSearch Rows outputs a bundle per row โ€” you don't need an Iterator after it! An Iterator only when there is an array inside a bundle.

Repeater, Sleep and rate limits

ToolWhat it doesExample
RepeaterOutputs N bundles with i = 1..NPagination: pages 1โ€“10 of an API
Sleep (Tools)A pause of up to 300 secondsBetween WhatsApp messages
Break + RetryA retry after X minutesA busy API
Scenario settings โ†’ Max cyclesThe trigger runs several times in a rowDraining a big queue
โš ๏ธ A run time limitA scenario run has a maximum time (depending on the plan, usually 40 minutes). A 5-minute Sleep ร— 20 clients = 100 minutes โ€” it will fail. Instead of a long Sleep: a scheduled scenario that processes a small batch each time.

Pagination โ€” when the API returns pages

Repeater (Repeats: 10)
  โ†’ HTTP GET /orders?page={{1.i}}&per_page=100
  โ†’ Filter: length(2.data) > 0          โ† stops when there is no more
  โ†’ Iterator (2.data) โ†’ ...

Error handlers โ€” what happens when something fails

When a module fails, the default: the scenario stops, the run is marked Error, and after several failures in a row โ€” the scenario is turned off. An error handler is attached to a module (right-click โ†’ Add error handler) and decides what to do instead.

HandlerWhat happensWhen
โญ๏ธ IgnoreIgnores it, continues to the next bundle. The run is SuccessAn unimportant error (a log, an emoji)
๐Ÿ” ResumeContinues with a substitute value you defineA default when an enrichment API failed
โธ๏ธ BreakSaves the run in incomplete executions, optionally with automatic retriesAn API is temporarily unavailable (429, 503)
โ†ฉ๏ธ RollbackStops and undoes actions in modules that support transactions (ACID)When it must be all-or-nothing
โœ… CommitStops but confirms what was already done. The run is Success"We did what we could"
โ„น๏ธ Incomplete executionsFor Break to work, turn on Allow storing of incomplete executions in the scenario settings. The saved runs appear in the Incomplete executions tab โ€” you can fix the scenario and run it again from the point where it failed (Retry), or cancel.

Error types and how to recognize them

Error typeExampleRecommended handler
ConnectionError / 5xxThe server isn't availableBreak with Retry
RateLimitError / 429Too many requestsBreak with a long delay
DataErrorA required field is empty, a wrong formatResume / Ignore + an alert
InvalidAccessTokenError / 401The connection expiredAn alert to a person (Retry won't help)
RuntimeErrorA general errorAn alert + Break

Inside the error handler's route you can add modules before the directive โ€” for example a Telegram message with the error details: {{error.message}}, {{error.type}}. And you can put a Router inside the error route by type.

๐Ÿ’ก An error handler for every external moduleRule of thumb: every module that talks to the outside world (HTTP, email, CRM, AI) gets an error handler. Internal modules (Set variable, Router) โ€” almost never fail.

Building together: payment reminders

  1. A daily 09:00 schedule, days of the week Sunโ€“Thu.
  2. Search Rows: paid = no.
  3. Set variable daysLate = {{{{round((now - parseDate(due; "DD/MM/YYYY")) / 86400000)}}}} (or dateDifference).
  4. Filter: daysLate โ‰ฅ 1 AND lastReminder โ‰  today.
  5. Router: 1โ€“7 gentle ยท 8โ€“14 second ยท 15+ Telegram to the manager.
  6. Sleep 2 seconds (don't flood Gmail).
  7. Update a Row: lastReminder = today.
  8. Error handlers: Gmail โ†’ Break (3 ร— 15 min); Update โ†’ Resume.
  9. At the end: Text aggregator โ†’ a daily summary on Telegram.

Lab: simulations and examples

Three ways to see today's material in action: the scenario canvas runs the session's scenario like Make does (with a Credits count), the race compares manual work with automation, and the function playground shows real mapping examples.

๐Ÿ’ก Why in this order?

Update the row only after the email is sent โ€” so a failed send is retried tomorrow.

A real-world case study

"Planet Digital" โ€” a marketing agency with 40 retainer clients. Collections were manual and forgotten in busy months; the average delay was 23 days. A graduated reminder scenario (gentle โ†’ second โ†’ a call from the manager) with Break on sending the email and incomplete executions. When the email provider went down for a day, not a single reminder was lost โ€” everything was sent automatically when it came back. Result: the average delay dropped to 8 days, and a cash flow of about ILS 180,000 came in earlier every month.

Frequently asked questions

Isn't Ignore dangerous?

It's dangerous if you ignore important things. Use it only for negligible errors, and always with an alert if possible.

What's the difference between Break and Commit?

Break saves the run as incomplete for completion; Commit finishes it as a "success" and doesn't return to it.

Does Rollback really undo a sent email?

No. Rollback works only in modules that support transactions (like a data store). An email that was sent โ€” was sent.

Why don't I have an Incomplete executions tab?

You didn't turn on Allow storing of incomplete executions in the scenario settings.

Quick understanding check

What now?

You finished the lecture! Go to the practice page โ€” multiple-choice questions and tasks that build A payment-reminder system with batches, delays and error handling. Stuck? The help guide breaks every task into steps. Only after you have tried, peek at the full solution.