Skip to content

feat(sdk): add updated operations to invocation info#693

Merged
SilanHe merged 19 commits into
mainfrom
feat/add-updated-operations-to-invocation-info
Jul 7, 2026
Merged

feat(sdk): add updated operations to invocation info#693
SilanHe merged 19 commits into
mainfrom
feat/add-updated-operations-to-invocation-info

Conversation

@SilanHe

@SilanHe SilanHe commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:

InvocationInfo now has an updatedOperations: Record<string, OperationInfo> field — the subset of operations that changed externally between invocations (populated from event.UpdatedOperationIds)
Type hierarchy (before → after):

BEFORE:

InvocationBaseInfo: { requestId, executionArn }
InvocationInfo extends InvocationBaseInfo: { isFirstInvocation, executionInput, operations }
InvocationEndInfo extends InvocationInfo: { status, executionResult?, executionError? }
OperationChangeInfo extends InvocationBaseInfo: { updatedOperations, operations }

AFTER:

InvocationBaseInfo: { requestId, executionArn, executionInput, operations }
InvocationInfo extends InvocationBaseInfo: { isFirstInvocation, updatedOperations }
InvocationEndInfo extends InvocationBaseInfo: { status, executionResult?, executionError? }
OperationChangeInfo (standalone): { executionArn, updatedOperations, operations }

Key design decisions:
InvocationEndInfo no longer carries isFirstInvocation or updatedOperations — no onInvocationEnd consumer used them
OperationChangeInfo is fully decoupled — it only needs executionArn, not requestId
executionInput and operations live on InvocationBaseInfo so both InvocationInfo and InvocationEndInfo get them without duplication

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

hsilan and others added 12 commits July 3, 2026 11:43
…rtions

Remove localOnly flag from all OTel examples to enable cloud deployment
and integration testing. Update otel-invoke to target otel-basic-steps
(which matches the *-NodeJS* IAM permission pattern) instead of a
non-existent invoke-target function. Update retry-steps to use
createRetryStrategy from the SDK. Strengthen test assertions to verify
specific span names, types, parent-child hierarchy, and attributes
rather than just counts.
…rtions

Remove localOnly flag from all OTel examples to enable cloud deployment
and integration testing. Update otel-invoke to target otel-basic-steps
(which matches the *-NodeJS* IAM permission pattern). Update retry-steps
to use createRetryStrategy from the SDK.

Refactor tests to read spans from the exported getSerializedSpans()
function after runner.run() returns (local) or from result.spans
(cloud). This ensures the final invocation span is always included,
giving consistent exact span counts across environments.

Strengthen test assertions to verify specific span names, types,
parent-child hierarchy, and attributes rather than just counts.
…helper

Add type guard in assertSpanAttributes to skip metadata namespace
entries that are not objects (e.g. plain strings like the function name),
preventing TypeError when using the 'in' operator.
Add updatedOperations to InvocationInfo populated from the
UpdatedOperationIds field in the durable Lambda invocation input.
This gives plugin authors visibility into which operations changed
externally between invocations (e.g., wait timer expired, callback
received, chained invoke completed).

Also refactor plugin type hierarchy:
- Move operations and executionInput to InvocationBaseInfo
- Decouple OperationChangeInfo from InvocationBaseInfo (inline
  executionArn, remove unused requestId)
@SilanHe SilanHe changed the title Feat/add updated operations to invocation info feat(sdk): add updated operations to invocation info Jul 6, 2026
@SilanHe SilanHe closed this Jul 6, 2026
@SilanHe SilanHe reopened this Jul 6, 2026
InvocationEndInfo no longer inherits isFirstInvocation and
updatedOperations from InvocationInfo. These fields are only
relevant during invocation start and are not used by any
onInvocationEnd consumer.
hsilan and others added 3 commits July 6, 2026 16:56
Remove isFirstInvocation and updatedOperations from
makeInvocationEndInfo since InvocationEndInfo now extends
InvocationBaseInfo directly.
Spread invocationBaseInfo instead of invocationInfo into
onInvocationEnd calls so that only the fields from
InvocationBaseInfo (requestId, executionArn, executionInput,
operations) are passed, not isFirstInvocation or updatedOperations.
@SilanHe
SilanHe marked this pull request as ready for review July 7, 2026 20:40
Comment thread packages/aws-durable-execution-sdk-js/src/types/plugin.ts
Comment thread packages/aws-durable-execution-sdk-js/src/types/plugin.ts
Comment thread packages/aws-durable-execution-sdk-js/src/types/plugin.ts
@SilanHe
SilanHe merged commit 3ff2623 into main Jul 7, 2026
11 of 12 checks passed
@SilanHe
SilanHe deleted the feat/add-updated-operations-to-invocation-info branch July 8, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants