Architecture
1. Define the completion boundary
An upload session is a temporary control record. The durable input is the finalizedstorageEntryId. Do not start processing from a signed transfer response or an unfinished session.
Choose the statistics policy before creating the session:
- use synchronous statistics when finalization should return only after required metadata is ready;
- use asynchronous statistics when upload latency matters more, then start statistics-dependent work from the synchronized lifecycle event;
- use no statistics when the consumer does not need a derived index.
2. Declare structured input when you know it
CSV, TSV, and XLSX use one shared structured-file schema contract. Declare columns and parsing policy when the producer and consumer already agree on the format. Use the default fallback policy when an occasional malformed value should remain readable through a safe fallback. Use strict policy when a mismatched sheet, column, or value must reject finalization rather than enter the downstream workflow. See Structured files for supported types, object parsing, null behavior, sheets, and schema policy.3. Configure the Event
Subscribe to:STORAGE_CREATEDwhen finalized bytes and entry metadata are sufficient;STORAGE_SYNCHRONIZEDwhen asynchronous statistics or cached batch reads must already be available.
4. Run a durable Job
The selected Job template should:- read
storageEntryIdfrom the Event message; - load the current entry and validate its location, type, version, and metadata;
- read structured data in bounded pages;
- validate business invariants independently from parser type conversion;
- write the result to a controlled folder;
- return the input and output entry IDs plus the execution correlation identifier.
5. Verify the outcome
Use different evidence for different questions:
An Event dispatch or successful Job submission is not proof that processing or output persistence completed.
Failure policy
- If finalization is uncertain, read the upload session before creating another one.
- If parsing fails under strict policy, keep the rejected input for operator inspection according to retention policy.
- If external effects occur after reading the file, use a business idempotency key and reconcile ambiguous timeouts.
- If output persistence fails after another business effect succeeded, reconstruct the output from the durable business record rather than repeating the external effect.

