Start building

Files, storage and batch

Files · complete lifecycle

Write, append, copy, rename and remove a temporary file while retaining an archive. Live operations use a restricted local filesystem; simulated effects never touch disk.

  • Files → Files
  • Intermediate
  • 4 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 processFiles · complete lifecycle8 activities

Scroll sideways to see the whole flow.

Flow diagram of Files · complete lifecycle8 activities and 7 transitions: Start, Write the work file, Append an audit line, Copy into the archive, Rename the archive, Delete the temporary source, Read the retained archive, End.StartstartWrite the work filefile.write1Append an audit linefile.append2Copy into the archivefile.copy3Rename the archivefile.rename4Delete the temporarysourcefile.delete5Read the retainedarchivefile.read6Endend
List the 8 activities and 7 transitions

Activities

  1. Start start
  2. Write the work file file.write
  3. Append an audit line file.append
  4. Copy into the archive file.copy
  5. Rename the archive file.rename
  6. Delete the temporary source file.delete
  7. Read the retained archive file.read
  8. End end

Transitions

  • Start → Write the work file (on success)
  • Write the work file → Append an audit line (on success)
  • Append an audit line → Copy into the archive (on success)
  • Copy into the archive → Rename the archive (on success)
  • Rename the archive → Delete the temporary source (on success)
  • Delete the temporary source → Read the retained archive (on success)
  • Read the retained archive → End (on success)

Walkthrough

  1. Write the work filePublish UTF-8 text atomically. Existing files are never overwritten by default.
  2. Append an audit lineRoot-confined regular files only. Explicit operator permission required. Destination is create-only; no directory deletion.
  3. Copy into the archiveRoot-confined regular files only. Explicit operator permission required. Destination is create-only; no directory deletion.
  4. Rename the archiveRoot-confined regular files only. Explicit operator permission required. Destination is create-only; no directory deletion.
  5. Delete the temporary sourceRoot-confined regular files only. Explicit operator permission required. Destination is create-only; no directory deletion.
  6. Read the retained archiveRead a bounded UTF-8 file beneath an approved root. Symlinks are blocked.

What you will practise

  • Write, append, copy, rename and remove a temporary file while retaining an archive. Live operations use a restricted local filesystem; simulated effects never touch disk.
  • Shared connection IDs stay explicit. Simulation uses fixtures; live actions require operator approval.

Sample cases

1 case with 3 assertions, run with python -m server.integration examples --all in simulation.

End-to-end sample

Passed

Execute the actual flow with explicit external fixtures.

Expected result Every activity completes and the expected final result matches.

3/3 assertions

  • Flow completes
  • Final output
  • No unconfirmed receipts

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
  • files_demo file · file.write, file.append, file.copy, file.rename, file.delete, file.read
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
e06dd283b06c7154f294554cfba3ccba73fd9d51b18b00b87cee0e78daaed812
Closure SHA-256
e59b35867034d796e0c746da9918830757518bf7926329eee87daabd31a937dd
Runtime
1.27.0
Results
1/1 cases, 3/3 assertions, mode simulate, external calls: none.
Files in the closure
  • server/integration/example_packs/file_lifecycle_lab.json
  • server/integration/templates/file_lifecycle_lab.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 file_lifecycle_lab
PYTHONPATH=. python scripts/export_public_gallery.py --check