@@ -281,6 +281,231 @@ Map and parallel perations support two SerDes fields that apply at different lev
281281 --8<-- "examples/java/sdk-reference/serialization/PassThroughSerdesExample.java"
282282 ```
283283
284+ ## FileSystem serdes
285+
286+ The FileSystem serdes stores data on the filesystem and keeps a file pointer in
287+ the checkpoint. This can be useful when you do not want to store your data in the
288+ checkpoint itself, for example when your payload exceeds the durable execution
289+ checkpoint size limit. The persisted value lives on the filesystem and the SDK
290+ reads it on replay.
291+
292+ The FileSystem serdes requires a filesystem that persists across invocations and
293+ that every Lambda execution environment can read. In AWS Lambda, this means:
294+
295+ - [ Amazon Elastic File System (Amazon EFS)] ( https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem-efs.html ) .
296+ Serverless file system that scales automatically with your workloads.
297+ - [ Amazon S3 Files] ( https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem-s3files.html ) .
298+ Serverless file system for mounting an Amazon S3 bucket. Amazon S3 Files
299+ provides access to Amazon S3 objects as files using standard file system
300+ operations such as read and write on the local mount path.
301+
302+ !!! warning "Do not use Lambda's ` /tmp ` directory"
303+
304+ Lambda's `/tmp` filesystem is local to a single execution environment. A
305+ different execution environment may run the next invocation, so the SDK cannot
306+ find files written to `/tmp` on replay and deserialization fails. Always mount
307+ a persistent, shared filesystem.
308+
309+ === "TypeScript"
310+
311+ Pass the FileSystem serdes to a single operation through `StepConfig`,
312+ `CallbackConfig`, `MapConfig`, or `ParallelConfig`. Other operations in the
313+ same handler continue to use the default serdes.
314+
315+ ```typescript
316+ --8<-- "examples/typescript/sdk-reference/serialization/filesystem-serdes-walkthrough.ts"
317+ ```
318+
319+ === "Python"
320+
321+ Coming soon. See
322+ [aws-durable-execution-sdk-python#479](https://github.com/aws/aws-durable-execution-sdk-python/issues/479).
323+
324+ === "Java"
325+
326+ Coming soon. See
327+ [aws-durable-execution-sdk-java#463](https://github.com/aws/aws-durable-execution-sdk-java/issues/463).
328+
329+ ### createFileSystemSerdes signature
330+
331+ === "TypeScript"
332+
333+ ```typescript
334+ --8<-- "examples/typescript/sdk-reference/serialization/filesystem-serdes-signature.ts"
335+ ```
336+
337+ **Parameters:**
338+
339+ - `basePath` Directory path where data files are written. Set this to your
340+ filesystem mount point.
341+ - `config` (optional) `FileSystemSerdesConfig` controlling storage mode, path
342+ encoding, and preview generation.
343+
344+ **Returns:** A `Serdes` that reads and writes JSON files under `basePath`.
345+
346+ === "Python"
347+
348+ Coming soon.
349+
350+ === "Java"
351+
352+ Coming soon.
353+
354+ ### FileSystemSerdesConfig
355+
356+ === "TypeScript"
357+
358+ ```typescript
359+ --8<-- "examples/typescript/sdk-reference/serialization/filesystem-serdes-config.ts"
360+ ```
361+
362+ **Fields:**
363+
364+ - `storageMode` (optional) A `FileSystemSerdesMode` value. Default:
365+ `FileSystemSerdesMode.ALWAYS`.
366+ - `pathEncoding` (optional) A `FileSystemPathEncoding` value. Default:
367+ `FileSystemPathEncoding.URI`.
368+ - `generatePreview` (optional) Function that returns a preview object. The SDK
369+ stores the preview inline in the checkpoint envelope alongside the file
370+ pointer. Use the [`buildPreview`](#preview-and-pii-masking) helper or
371+ write your own.
372+
373+ === "Python"
374+
375+ Coming soon.
376+
377+ === "Java"
378+
379+ Coming soon.
380+
381+ ### Storage modes
382+
383+ The ` storageMode ` enumerated field controls when the SDK writes to the filesystem.
384+
385+ ` FileSystemSerdesMode.ALWAYS ` writes every value to a file. The checkpoint stores
386+ only the file pointer.
387+
388+ ` FileSystemSerdesMode.OVERFLOW ` uses the standard durable execution checkpoint
389+ store and only writes to the filesystem when the value would exceed the durable
390+ execution checkpoint size limit. See
391+ [ AWS Lambda service quotas] ( https://docs.aws.amazon.com/general/latest/gr/lambda-service.html ) .
392+
393+ === "TypeScript"
394+
395+ ```typescript
396+ --8<-- "examples/typescript/sdk-reference/serialization/filesystem-serdes-overflow.ts"
397+ ```
398+
399+ === "Python"
400+
401+ Coming soon.
402+
403+ === "Java"
404+
405+ Coming soon.
406+
407+ ### Path encoding
408+
409+ The ` pathEncoding ` field controls how the durable execution ARN and the entity ID
410+ become the on-disk directory and file names.
411+
412+ ` FileSystemPathEncoding.URI ` builds a per-execution directory from the function
413+ name, execution name, and invocation ID parsed from the ARN, and encodes the entity
414+ ID with ` encodeURIComponent ` for the file name. Names stay readable when you read
415+ files directly from the mount. A very long entity ID may exceed the filesystem's
416+ per-name length limit, commonly 255 bytes.
417+
418+ ` FileSystemPathEncoding.HASH ` replaces the ARN and the entity ID with their SHA-256
419+ hex digests. Names are a fixed 64 characters and are always filesystem-safe
420+ regardless of the input characters or length. Choose ` HASH ` when entity IDs may
421+ contain characters that are unsafe in a file name, such as ` / ` , or may be long
422+ enough to exceed the name-length limit.
423+
424+ === "TypeScript"
425+
426+ ```typescript
427+ --8<-- "examples/typescript/sdk-reference/serialization/filesystem-serdes-path-encoding.ts"
428+ ```
429+
430+ === "Python"
431+
432+ Coming soon.
433+
434+ === "Java"
435+
436+ Coming soon.
437+
438+ ### Preview and PII masking
439+
440+ When the FileSystem serdes writes to a file, the checkpoint envelope only contains
441+ the file pointer, so the GetDurableExecution API and the AWS Console cannot show
442+ the actual data for that operation. Configure ` generatePreview ` to embed a small
443+ object inline so you can see the data without reading the file.
444+
445+ Use ` buildPreview ` to compute the preview from a ` PreviewConfig ` . The config
446+ selects which fields to include, exclude, or mask. Masking replaces a field's value
447+ with ` *** ` or a custom string. The preview object is capped at 4096 bytes by
448+ default.
449+
450+ === "TypeScript"
451+
452+ ```typescript
453+ --8<-- "examples/typescript/sdk-reference/serialization/filesystem-serdes-preview.ts"
454+ ```
455+
456+ **`PreviewConfig` fields:**
457+
458+ - `mode` Either `PreviewMode.INCLUDE_ALL` or `PreviewMode.EXCLUDE_ALL`. Sets
459+ the starting point before applying `include`, `exclude`, and `mask`.
460+ - `include` (optional) Fields to add when starting from `EXCLUDE_ALL`, or to
461+ force-include when starting from `INCLUDE_ALL`.
462+ - `exclude` (optional) Fields to remove. Always wins over `mask`.
463+ - `mask` (optional) Fields whose values become `maskString`. A masked field is
464+ visible in the preview unless it is also excluded.
465+ - `maskString` (optional) Replacement value for masked fields. Default: `***`.
466+ - `maxPreviewBytes` (optional) Maximum size in bytes for the preview object
467+ when JSON-serialized. Default: `4096`.
468+
469+ Each `PreviewField` selector has a `name` and an optional `match`. Use
470+ `FieldMatchMode.ANYWHERE` (default) to match the field name at any depth in
471+ the object tree, or `FieldMatchMode.PATH` to match an exact dot-notation path
472+ from the root.
473+
474+ Field names that contain a dot are not supported in selectors because a dot is
475+ indistinguishable from a path separator. Array structure is not preserved in
476+ the output: fields from array elements merge into a plain object at the
477+ array's path.
478+
479+ === "Python"
480+
481+ Coming soon.
482+
483+ === "Java"
484+
485+ Coming soon.
486+
487+ ### Set as the default for the handler
488+
489+ When you want every step result, child-context result, invoke result, and
490+ waitForCondition result in the handler to use the FileSystem serdes, configure it
491+ once with ` configureSerdes ` .
492+
493+ === "TypeScript"
494+
495+ ```typescript
496+ --8<-- "examples/typescript/sdk-reference/serialization/filesystem-serdes-default.ts"
497+ ```
498+
499+ === "Python"
500+
501+ Coming soon. See
502+ [aws-durable-execution-sdk-python#479](https://github.com/aws/aws-durable-execution-sdk-python/issues/479).
503+
504+ === "Java"
505+
506+ Coming soon. See
507+ [aws-durable-execution-sdk-java#463](https://github.com/aws/aws-durable-execution-sdk-java/issues/463).
508+
284509## Serialization errors
285510
286511When serialization or deserialization fails, each SDK raises or throws a specific
0 commit comments