Interactive engineering lab

Workflow map step: fail fast, collect, bounded workers and resume

Run eight synthetic cases through a map step: workers, fail fast or collect, an input request, checkpoints and a crash. Watch starts, waste and resume.

By Sandeep Belgavi · Published 2026-11-13

Scenario: eight help-desk cases at the fictional Belgavi's Book Store, summarised by one child run each inside a workflow step. Synthetic inputs; every calculation stays in this page and nothing is sent anywhere.

Experiment workspace

Decision trace

    What this lab models

    A workflow step that runs one child per item of a list: eight synthetic help-desk cases, CASE-5101 to CASE-5108, at the fictional Belgavi's Book Store, each summarised by its own child run. Items start in input order, at most the number of workers at a time, and the step returns results in input order. Under fail fast, the first failure cancels the running items, starts nothing else and fails the step, which is how ADK Java's experimental ParallelWorkers documents its behaviour. Under collect, a failure becomes that item's result and the rest continue. An item that asks a person for input stops queued items from starting. A crash loses running work; on resume, checkpointed results are kept and only the rest run again. All arithmetic runs in this page.

    How to experiment

    Start with the defaults: three workers, fail fast, checkpoints on, no failure and no crash. The step completes at t=19 s after eight item starts. Make CASE-5104 fail and watch two running items get cancelled and six seconds of work discarded; switch to collect and the other seven finish. Put the crash at 12 s with checkpoints on, then off, and compare the item starts and the finish time. Make CASE-5103 ask for input and see five cases never start. Change the worker count from 1 to 8 to see the finish time move from the sum of the durations to the longest one.

    Expected outcomes to check

    Defaults: completed at 19 s, 8 starts. One worker: 44 s. Eight workers: 9 s. CASE-5104 fails, fail fast: failed at 12 s, CASE-5106 and CASE-5108 cancelled, 6 s discarded. Collect: completed with errors at 19 s, 7 ok. Crash at 12 s with checkpoints: completed at 20 s, 10 starts. Without checkpoints: completed at 31 s, 16 starts. CASE-5103 asks for input: paused at 7 s with 5 cases not run. A crash at 60 s changes nothing.

    Trace, reset and export

    The decision trace lists the setup, each start, finish, failure, cancellation, crash loss, skipped checkpoint and the outcome. Start trace hides every step, Next step reveals one, Show all restores the list and the slider selects how many are visible; none of these change the result. Reset inputs restores the defaults. Export JSON saves the inputs, every item run, the final rows and the trace.

    Limits

    Whole seconds, fixed durations, one attempt per item, no retries and no partial progress inside an item. A real engine adds scheduling delay, retries, rate limits and model latency that varies by input. Checkpointing here means a durable per-item result; whether a re-run repeats a side effect depends on the item, which is why the article pairs checkpoints with idempotency keys.

    Original lab by Sandeep Belgavi. Views are my own and do not represent any employer, past or present.