Start building

Files, storage and batch

1,051-row CSV → paged subprocess → summary file

End-to-end native file processing with saved, revision-pinned subprocesses. No AI calls or external services required in gallery simulation. Local qualification additionally exercises approved real temporary files.

  • CSV → CSV
  • via Files
  • Advanced
  • 12 min

Last verified 2026-10-31 at f4ce7d0 — simulation fixtures

Try this template in Studio

Studio activation is a one-time payment of USD 20.

Flow

Drawn at build time from the node positions in the template's process definitions. Numbered markers are the walkthrough stages.

Main processLarge CSV → paged subprocess → summary CSV10 activities

Scroll sideways to see the whole flow.

Flow diagram of Large CSV → paged subprocess → summary CSV10 activities and 10 transitions: Start, Open approved CSV into a private spool, Read next 50 records, Fp Aggregate Page, Advance cursor and rolling totals, Another page?, Render a small summary, not all source rows, Prepare summary stream, Atomically create summary file, Return verified result.StartstartOpen approved CSV intoa private spoolstream.open_file1Read next 50 recordsstream.read_recordsFp Aggregate Pagecall_process2Advance cursor androlling totalsassignAnother page?choiceRender a smallsummary, not all…csv.renderPrepare summary streamstream.from_binaryAtomically createsummary filestream.to_file3Return verified resultend
List the 10 activities and 10 transitions

Activities

  1. Start start
  2. Open approved CSV into a private spool stream.open_file
  3. Read next 50 records stream.read_records
  4. Fp Aggregate Page call_process
  5. Advance cursor and rolling totals assign
  6. Another page? choice
  7. Render a small summary, not all source rows csv.render
  8. Prepare summary stream stream.from_binary
  9. Atomically create summary file stream.to_file
  10. Return verified result end

Transitions

  • Start → Open approved CSV into a private spool (on success)
  • Open approved CSV into a private spool → Read next 50 records (on success)
  • Read next 50 records → Fp Aggregate Page (on success)
  • Fp Aggregate Page → Advance cursor and rolling totals (on success)
  • Advance cursor and rolling totals → Another page? (on success)
  • Render a small summary, not all source rows → Prepare summary stream (on success)
  • Prepare summary stream → Atomically create summary file (on success)
  • Atomically create summary file → Return verified result (on success)
  • Another page? → Read next 50 records (condition)
  • Another page? → Render a small summary, not all source rows (otherwise)
SubprocessAggregate at most 50 CSV rows · subprocess3 activities

Scroll sideways to see the whole flow.

Flow diagram of Aggregate at most 50 CSV rows · subprocess3 activities and 2 transitions: Start, Fold decimal amounts within the current page, Return verified result.StartstartFold decimal amountswithin the current…data.mapperReturn verified resultend
List the 3 activities and 2 transitions

Activities

  1. Start start
  2. Fold decimal amounts within the current page data.mapper
  3. Return verified result end

Transitions

  • Start → Fold decimal amounts within the current page (on success)
  • Fold decimal amounts within the current page → Return verified result (on success)

Walkthrough

  1. Open private streamThe stream owns a quota-limited private spool and a SHA-256 hash. It is not a public URL.
  2. Process one pageAt most 50 rows enter each aggregate subprocess. No full-file JSON array is built.
  3. Advance and publishUpdate the session-owned cursor, repeat until done, then publish a small summary create-only.

What you will practise

  • Use native stream cursors to process beyond the small inline CSV activity limit.
  • Pin once per run and call once per page instead of once per record.
  • Keep counters and totals only; release all private spool files at run end.
  • Quotas, maximum record size, process steps and deadlines still apply.

Sample cases

2 cases with 8 assertions, run with python -m server.integration examples --all in simulation.

1,051 records in 22 pages with an exact decimal total

Passed

1,051 records in 22 pages with an exact decimal total — deterministic native engine; external file operations use fixtures in the gallery.

Expected result 1,051 records in 22 pages with an exact decimal total. Each expected outcome is asserted.

5/5 assertions

  • status
  • /records
  • /pages
  • /total
  • step_count

This sample run only; not a production certification.

An empty CSV body after the header completes safely

Passed

An empty CSV body after the header completes safely — deterministic native engine; external file operations use fixtures in the gallery.

Expected result An empty CSV body after the header completes safely. Each expected outcome is asserted.

3/3 assertions

  • status
  • /records
  • /total

This sample run only; not a production certification.

Prerequisites

Runtime
Cohuno runtime 1.27.0, the version recorded when these cases last passed.
Starter
Manual start; no listener.
Optional dependencies
None beyond the base runtime.
Simulation fixtures
  • pipeline_files file · stream.open_file, stream.to_file
Every sample run replaces these connections with the fixtures defined in its case. A live run needs an operator to configure an authorized connection for each.
Verification details

Provenance

What was verified, and when. The content part changes whenever the pack, a process in its closure, the runtime version or a case result changes; the gallery check then fails until the gallery is regenerated and the changed templates are verified again.

Verified content

Pack SHA-256
f866f817b073b8fa90ec82a7fbd3e763cccc608a4dfcd8d51598f1ffc83485e9
Closure SHA-256
429f85299300179c34e113f1af8c3da8bb5823d64c49b869c0816b4aa00cea4a
Runtime
1.27.0
Results
2/2 cases, 8/8 assertions, mode simulate, external calls: none.
Files in the closure
  • server/integration/example_packs/stream_csv_subprocess_lab.json
  • server/integration/templates/fp_aggregate_page.json
  • server/integration/templates/fp_stream_csv.json

Verification event

Commit
f4ce7d08eedc90267b405ed1974344153a8b3a34
Verified at (UTC)
2026-10-31T21:19:21Z

How the Cohuno team reproduces this check

PYTHONPATH=. python -m server.integration examples --example stream_csv_subprocess_lab
PYTHONPATH=. python scripts/export_public_gallery.py --check