aws / aws/aws-durable-execution-sdk-js

[Feature]: Expand SerdesContext with payload and operation metadata

Open
#863 0 comments 0 reactions 0 assignees View on GitHub
enhancement parity pkg:sdk
Dominant language
TypeScript
Stars
84
Forks
28
Avg merge
1d 19h
Merged PRs (30d)
43

Description

## What would you like?

Expand `SerdesContext` beyond `entityId` and `durableExecutionArn` so context-aware SerDes implementations can identify the exact durable payload being processed.

Useful optional metadata includes:

- payload kind, such as execution input/output, operation result, invoke payload, state, or exception;
- operation ID and display name;
- parent context ID;
- operation type and subtype;
- retry attempt number when applicable.

This enables safer external-storage ownership rules, better diagnostics, and stage behavior without parsing `entityId`.

## Possible Implementation

- Add optional fields to `SerdesContext` while preserving the existing required fields.
- Populate the fields for every SDK-managed serialization and deserialization path, including execution input/output, steps, child contexts, callbacks, wait-for-condition state, invoke payload/results, exceptions, and retry attempts.
- Document which fields are always present and which are operation-specific.
- Ensure the same context is passed to every attempt of a retryable SerDes operation.
- Add parity tests that capture context from each payload path and validate first execution versus replay.
- Use the richer context when implementing owner-bound filesystem envelopes and safely rebinding forwarded error data across invoke/child-context boundaries.

## Is this a breaking change?

No. The new properties can be optional so existing custom SerDes implementations and context object construction remain valid.

## Does this require an RFC?

Yes.

## Additional Context

The Java SDK work in aws/aws-durable-execution-sdk-java#648 passes payload kind, stable entity identity, operation metadata, and attempt number explicitly to SerDes stages.

Contributor guide

Open the contributing guide

Research direction

Start with the SerdesContext definition and compare the Java SDK work referenced in aws/aws-durable-execution-sdk-java#648. Trace each SDK-managed serialization and deserialization path listed in the issue, then define parity tests for every payload path, including first execution and replay. Done means optional metadata is documented, populated across those paths, and preserved across retry attempts.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.