Release sdk-2.0.0-alpha.1 #538
ParidelPooya
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Changelog
[2.0.0-alpha.1] — alpha — pre-release
Highlights
2.0.0ships five categories of change:withRetry— a new helper for retrying a chunk of durable logic(multi-operation blocks containing
waitForCallback,invoke, etc.)with a configurable backoff strategy.
createLinearRetryStrategyand the newretryPresets.linearpreset for fixed-increment backoff alongside theexisting exponential strategies.
context.configureSerdes()sets default serdes once instead ofpassing
serdes:to every operation;createFileSystemSerdesoffloads large payloads to a durable mount(Amazon S3 Files, EFS) so executions stay under the checkpoint size
limit;
GetDurableExecutionHistoryand theAWS console while the full value lives on disk.
NestingType.FLATonmapandparallelskips the per-iterationCONTEXToperation forup to 2x cost reduction and up to 2x more iterations per execution,
trading per-branch observability for throughput.
specific error subclasses (
PromiseCombinatorError,CallbackTimeoutError,CallbackSubmitterError). This is the mainsource of breaking changes for code that branches on
instanceof.A handful of operational fixes are also included.
⚠ Upgrade guide (breaking changes)
1. Promise combinator failures now throw
PromiseCombinatorErrorcontext.Promise.all,Promise.allSettled,Promise.any, andPromise.racepreviously rejected withStepError. They now reject withPromiseCombinatorError, which extendsDurableOperationErrordirectly —not
StepErrororChildContextError.If you don't care about distinguishing the operation type, catch the base
class:
2. Callback failures split into specific error types
createCallbackandwaitForCallbackpreviously threwCallbackErrorforevery failure mode. v2 introduces two new sibling classes that do not
extend
CallbackError:FAILEDCallbackErrorCallbackErrorTIMED_OUT)CallbackErrorCallbackTimeoutErrorwaitForCallbacksubmitter threwCallbackErrorCallbackSubmitterErrorinstanceof CallbackErrorwill silently stop matching for the timeoutand submitter cases.
Added
withRetry— retry a block of durable logicA new helper for retrying chunks of logic that contain operations a
stepcannot host (e.g.waitForCallback,invoke). Semantically arunInChildContextwith a retry policy wrapped around it.createLinearRetryStrategy+retryPresets.linearLinear backoff with configurable initial delay and increment.
context.configureSerdes()+SerdesConfigSet default serdes once on the context instead of passing
serdes:toevery operation. Defaults flow into
step,runInChildContext,invoke,and
waitForCondition. Callbacks (createCallback,waitForCallback)require an explicit
defaultCallbackDeserializer— they keep thepassthrough deserializer otherwise so customer-provided callback payloads
aren't accidentally JSON-parsed.
Per-operation
serdes:arguments still win over the default —configureSerdesonly changes the fallback.
createFileSystemSerdes(basePath, config?)A built-in
Serdesthat writes each value to a file underbasePathand stores only a small file pointer in the checkpoint. Use it to keep
executions under the per-checkpoint size limit (~256KB) when individual
operations produce large results.
The checkpoint envelope is one of:
{ "data": "<inline JSON>" } // OVERFLOW, under threshold { "file": "/mnt/s3/<execArn>/<entityId>.json" } // ALWAYS, or OVERFLOW spilledFiles are organized as
<basePath>/<urlEncodedExecutionArn>/<entityId>.json,so each execution's data is namespaced and easy to clean up.
Hiding sensitive data with inline previews
When a step's result contains PII — customer name, address, phone, payment
details — storing it directly in the checkpoint exposes it through the
GetDurableExecutionHistoryAPI and the durable-execution console UI toanyone with read access. v2 makes it possible to keep the full value
on a durable filesystem (where replay can still read it) while storing
only a redacted preview in the checkpoint that operators see.
createFileSystemSerdesaccepts an optionalgeneratePreviewfunction.The returned object is stored inline in the envelope alongside the file
pointer:
{ "file": "/mnt/s3/<execArn>/1.json", "preview": { "orderId": "ord-123", "status": "shipped", "total": 99.5 } }GetDurableExecutionHistoryand the AWS console render thepreviewfield; the file is read only by the SDK during replay.
Example: an order workflow with PII
Two complementary patterns
Allow-list (recommended for PII) — start with
EXCLUDE_ALL, list thefields safe to display:
Deny-list with masking — start with
INCLUDE_ALL, thenexcludefields that must never appear and
maskfields whose presence is usefulfor debugging but whose value is sensitive (e.g. show that
emailexistswithout leaking it):
How
maskactually behavesThree rules govern interaction between
include,exclude, andmask:excludealways wins. A field listed in bothexcludeandmaskis excluded — its key never appears in the preview at all. Use this
when even the presence of the field is sensitive.
maskimplies visibility. When a path matches amaskrule, thefield is emitted with
maskStringas its value regardless of themode. InEXCLUDE_ALLmode this means amaskentry alone makesthe field appear (redacted) — you don't also need to add it to
include. Use this to signal "this field exists in the result" withoutleaking its value.
Masking replaces the entire subtree. When the masked path is an
object or array, the whole value is replaced with
maskString;buildPreviewdoes not recurse into it.To redact only the leaves, list each leaf in
maskinstead of theparent.
Targeting a specific path
Field selectors default to
FieldMatchMode.ANYWHERE, which matches thefield name at any depth. Use
FieldMatchMode.PATHto pin a selector toan exact dot-path — useful when the same field name appears in multiple
sub-trees but only some are sensitive:
Custom previews
If
buildPreviewdoesn't fit, pass any function that returns the objectto embed:
NestingTypeformap,parallelTrade observability for cost on batch operations. Default is
NestingType.NESTED(today's behavior). Switching toNestingType.FLATskips per-iteration
CONTEXToperations for up to 2x cost reduction andhigher per-execution scale (up to 2x more iterations in map), at the price of less detailed history.
Because the default is
NESTED, existing code is unaffected unlessyou opt in.
errorMapperonChildConfigrunInChildContext, promise combinators, andwithRetryaccept afunction to remap the thrown error type. Useful when you want a domain
error class instead of
ChildContextError.Changed
runInChildContext(was
step). This enables Lambda termination during long idle waits incombinators and is a prerequisite for the typed
PromiseCombinatorErrorabove. (refactor(sdk): use runInChildContext for promise combinators #435, feat(sdk): add PromiseCombinatorError for promise combinators #436, feat(sdk): add specific error types for callback operations #441)
FileSystemSerdesConfig.mode→storageMode. Only relevant if youtracked the
2.0.0-alpha.1line; v1.x users are unaffected. (feat(sdk): add generatePreview to FileSystemSerdesConfig #536)aws-durable-execution-sdk-js/<version>andappends
-bundledwhen running from the Lambda bundled runtime path.(fix(sdk): update UserAgent header format #522, internal commit
5f951b1)Fixed
CheckpointDurableExecutionandGetDurableExecutionStateare now treated as non-retryable customererrors. See upgrade guide §3. (feat(sdk): treat KMS exceptions as non-retryable customer errors #508)
fix(eslint-plugin): removecontext.getSourceCode()so the pluginworks on ESLint v10. (fix(eslint-plugin): remove unused context.getSourceCode() call for ESLint v10 compatibility #472)
fix(sdk): resolve ESLint warnings surfaced during the build. (fix(sdk): resolve ESLint warnings in build process #483)fix(examples): prevent duplicateDeleteFunctioncalls duringcleanup in integration tests. (fix(examples): prevent duplicate DeleteFunction calls #486)
Security
@aws-sdk/*deps to pull in the patchedfast-xml-parser. (fix(sdk): Bump @aws-sdk dependencies to resolve fast-xml-parser vulnerability #488)fast-xml-parser,handlebars,flatted,lodash,minimatch,picomatch, andvite. Updateseslint-plugin-tsdocto^0.5.2. Zero outstanding advisories atrelease time. (fix(sdk): resolve high-severity security vulnerabilities #501)
This discussion was created from the release Release sdk-2.0.0-alpha.1.
Beta Was this translation helpful? Give feedback.
All reactions