assemblyline.sh

One job per station

A station does one job on each workpiece. If the job has stages, such as reading a PDF, pulling out its fields and tidying them, they run one after another inside that one job. A stage becomes a station of its own only when it has to be run, retried or watched apart from the rest.

Same station or a new one

AskIf yes
Would you rerun this stage alone, on just the workpieces where it went wrong?Its own station
Does it hit a different limit: a model, a rate-limited API, a slow local tool?Its own station, with its own batch size and schedule
Is what it produces worth reading before the next stage starts?Its own station: its output/ is a folder you can open
Do the stages share a lot of loaded data that would be costly to load twice?One station
Should the stages succeed or fail together?One station

IN1 reads each invoice's text and pulls out its fields: one job, because nobody reruns just the text reading. Transcribing audio and summarising the transcript are two stations: the transcriber is slow and runs on local hardware, the summary calls a model, and when the summary prompt changes you rerun only the summary.

What a station of its own gives you

  • Its own bins. Listing them shows exactly where work stopped.
  • Its own runs. Each run has its own record and report, so you can see which stage is slow or failing.
  • Its own schedule, batch size and retries.
  • A route you can change in config. Inserting or moving a station is an edit to the stations around it, not a rewrite.

It costs one more copy of each workpiece, one more conveyor and one more station to watch. Pay that when one of the reasons in the table holds.

Where a station delivers

Every station delivers to the same two places: the finished workpiece goes into its own output/, where the next station pulls it, and the run's report goes to the run's record. Nothing is sent to the next station.

A write to an outside system gets its own station

When the result has to land in a system people rely on, such as a ledger, a spreadsheet, a task list or someone's inbox, make that write the job of its own station, usually the last on the line. IN1 checks the invoice; IN2 posts it.

  • The checks finish before anything leaves. Nothing reaches the ledger until the station before has looked at it.
  • The write is retried alone. A posting that failed because the ledger was down goes back to IN2, without checking again.
  • It can run dry. A posting station with a dry-run setting shows what it would send, so you can compare before anything is written.
  • It can be held back on its own: at most 20 issues filed a day, or one email per sender per run.

Inside that station, log an event just before the write, so a crash shows how far each workpiece got: see Workpieces.