Start building

Files, storage and batch

CSV orders → nested subprocesses → CSV and Excel

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 → Excel
  • 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 processCSV orders → nested subprocesses → CSV + Excel13 activities

Scroll sideways to see the whole flow.

Flow diagram of CSV orders → nested subprocesses → CSV + Excel13 activities and 12 transitions: Start, Read inbound orders CSV, Parse BOM / quoted / multiline CSV, Partition accepted and rejected records, Normalize accepted records with pinned nested calls, Fp Build Order Report, Render spreadsheet-safe accepted CSV, Write three-sheet XLSX using row streaming, Read generated Excel back before publishing, Hash immutable workbook bytes, Create accepted CSV (no overwrite), Create Excel report (no overwrite), Return verified result.StartstartRead inbound ordersCSVfile.readParse BOM / quoted /multiline CSVcsv.parsePartition accepted andrejected recordsdata.mapper1Normalize acceptedrecords with pinned…foreachFp Build Order Reportcall_processRenderspreadsheet-safe…csv.renderWrite three-sheet XLSXusing row streamingxlsx.write_workbookRead generated Excelback before publishingxlsx.read_workbook4Hash immutableworkbook bytesbinary.sha256Create accepted CSV(no overwrite)file.writeCreate Excel report(no overwrite)file.writeReturn verified resultend
List the 13 activities and 12 transitions

Activities

  1. Start start
  2. Read inbound orders CSV file.read
  3. Parse BOM / quoted / multiline CSV csv.parse
  4. Partition accepted and rejected records data.mapper
  5. Normalize accepted records with pinned nested calls foreach
  6. Fp Build Order Report call_process
  7. Render spreadsheet-safe accepted CSV csv.render
  8. Write three-sheet XLSX using row streaming xlsx.write_workbook
  9. Read generated Excel back before publishing xlsx.read_workbook
  10. Hash immutable workbook bytes binary.sha256
  11. Create accepted CSV (no overwrite) file.write
  12. Create Excel report (no overwrite) file.write
  13. Return verified result end

Transitions

  • Start → Read inbound orders CSV (on success)
  • Read inbound orders CSV → Parse BOM / quoted / multiline CSV (on success)
  • Parse BOM / quoted / multiline CSV → Partition accepted and rejected records (on success)
  • Partition accepted and rejected records → Normalize accepted records with pinned nested calls (on success)
  • Normalize accepted records with pinned nested calls → Fp Build Order Report (on success)
  • Fp Build Order Report → Render spreadsheet-safe accepted CSV (on success)
  • Render spreadsheet-safe accepted CSV → Write three-sheet XLSX using row streaming (on success)
  • Write three-sheet XLSX using row streaming → Read generated Excel back before publishing (on success)
  • Read generated Excel back before publishing → Hash immutable workbook bytes (on success)
  • Hash immutable workbook bytes → Create accepted CSV (no overwrite) (on success)
  • Create accepted CSV (no overwrite) → Create Excel report (no overwrite) (on success)
  • Create Excel report (no overwrite) → Return verified result (on success)
SubprocessNormalize one accepted order · subprocess4 activities

Scroll sideways to see the whole flow.

Flow diagram of Normalize one accepted order · subprocess4 activities and 3 transitions: Start, Fp Decimal Amount, Normalize fields, preserve literal notes, Return verified result.StartstartFp Decimal Amountcall_process2Normalize fields,preserve literal notesdata.mapperReturn verified resultend
List the 4 activities and 3 transitions

Activities

  1. Start start
  2. Fp Decimal Amount call_process
  3. Normalize fields, preserve literal notes data.mapper
  4. Return verified result end

Transitions

  • Start → Fp Decimal Amount (on success)
  • Fp Decimal Amount → Normalize fields, preserve literal notes (on success)
  • Normalize fields, preserve literal notes → Return verified result (on success)
SubprocessExact decimal amount · nested subprocess3 activities

Scroll sideways to see the whole flow.

Flow diagram of Exact decimal amount · nested subprocess3 activities and 2 transitions: Start, Quantity × price, decimal-safe, Return verified result.StartstartQuantity × price,decimal-safedata.mapperReturn verified resultend
List the 3 activities and 2 transitions

Activities

  1. Start start
  2. Quantity × price, decimal-safe data.mapper
  3. Return verified result end

Transitions

  • Start → Quantity × price, decimal-safe (on success)
  • Quantity × price, decimal-safe → Return verified result (on success)
SubprocessBuild accepted / rejected / summary workbook · subprocess3 activities

Scroll sideways to see the whole flow.

Flow diagram of Build accepted / rejected / summary workbook · subprocess3 activities and 2 transitions: Start, Prepare all three sheets before publishing, Return verified result.StartstartPrepare all threesheets before…data.mapper3Return verified resultend
List the 3 activities and 2 transitions

Activities

  1. Start start
  2. Prepare all three sheets before publishing data.mapper
  3. Return verified result end

Transitions

  • Start → Prepare all three sheets before publishing (on success)
  • Prepare all three sheets before publishing → Return verified result (on success)

Walkthrough

  1. Parse and partitionCSV quoting, BOM handling and business filters run before writing files.
  2. Nested callsEach accepted order calls a normalization subprocess, which calls the exact-decimal calculation subprocess.
  3. Prepare reportsBuild Accepted, Rejected and Summary sheets in a reusable subprocess.
  4. Write and verifyGenerate XLSX with a sequential writer, read it back, then publish CSV and workbook create-only.

What you will practise

  • Inspect native collection filters and nested pinned call frames.
  • Use decimal strings for money; do not silently coerce floats.
  • CSV formula escaping and XLSX literal cells prevent spreadsheet injection.
  • Row-streaming XLSX is bounded and excludes random patches / tables.
  • File creation is atomic per file, not a multi-file transaction; no automatic overwrite or retry.

Sample cases

4 cases with 14 assertions, run with python -m server.integration examples --all in simulation.

Two accepted orders, two rejected and exact decimal total

Passed

Two accepted orders, two rejected and exact decimal total — deterministic native engine; external file operations use fixtures in the gallery.

Expected result Two accepted orders, two rejected and exact decimal total. Each expected outcome is asserted.

6/6 assertions

  • status
  • /accepted
  • /rejected
  • /total
  • /excel_rows/2/7
  • step_count

This sample run only; not a production certification.

Invalid amount prevents both file writes

Expected failure verified

Invalid amount prevents both file writes — deterministic native engine; external file operations use fixtures in the gallery.

Expected result Invalid amount prevents both file writes. Each expected outcome is asserted.

3/3 assertions

  • status
  • error_code
  • step_count

This sample run only; not a production certification.

Header-only input produces a valid empty report

Passed

Header-only input produces a valid empty report — deterministic native engine; external file operations use fixtures in the gallery.

Expected result Header-only input produces a valid empty report. Each expected outcome is asserted.

3/3 assertions

  • status
  • /accepted
  • /total

This sample run only; not a production certification.

Duplicate CSV header fails before transformations

Expected failure verified

Duplicate CSV header fails before transformations — deterministic native engine; external file operations use fixtures in the gallery.

Expected result Duplicate CSV header fails before transformations. Each expected outcome is asserted.

2/2 assertions

  • status
  • error_code

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
  • openpyxl for Excel workbooks needed in every run, simulation included
Selected for this closure by the same rules as runtime packaging.
Simulation fixtures
  • pipeline_files file · file.read, file.write
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
bd5fbf6b6b2ab839800e305529dbd3766e3e0fb40d9735373bea45f68a83f436
Closure SHA-256
fcefc77dfd34d8614c4eb9bae9f369c5b101bd20eba608c2bee743cfb56c7984
Runtime
1.27.0
Results
4/4 cases, 14/14 assertions, mode simulate, external calls: none.
Files in the closure
  • server/integration/example_packs/csv_excel_subprocess_lab.json
  • server/integration/templates/fp_build_order_report.json
  • server/integration/templates/fp_csv_to_excel.json
  • server/integration/templates/fp_decimal_amount.json
  • server/integration/templates/fp_normalize_order.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 csv_excel_subprocess_lab
PYTHONPATH=. python scripts/export_public_gallery.py --check