Skip to content

feat(plugin): surface execution input and result on invocation hooks - #616

Draft
wangyb-A wants to merge 1 commit into
mainfrom
feat/plugin-invocation-input-result
Draft

feat(plugin): surface execution input and result on invocation hooks#616
wangyb-A wants to merge 1 commit into
mainfrom
feat/plugin-invocation-input-result

Conversation

@wangyb-A

@wangyb-A wangyb-A commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Widens the plugin invocation hooks so instrumentation plugins can record execution
input/output:

  • InvocationInfo.execution_input: Any — the deserialized execution input, populated by
    durable_execution() from the invocation's input event
  • InvocationEndInfo.execution_result: str | None — the serialized result JSON from
    DurableExecutionInvocationOutput.result (None on failure/suspend), threaded through
    from_durable_execution_invocation_output

Both fields are kw-only with None defaults, so existing plugins, hook constructors,
and positional callers are unaffected — this is a purely additive API widening.

Motivation

The JS SDK already exposes this data to plugins (InvocationInfo.executionInput /
InvocationEndInfo.executionResult), and its Workflow Insight plugin depends on it to emit
execution records carrying input/output. Porting that plugin to Python (validated
against the cross-SDK insight conformance suite,
aws-durable-execution-conformance-tests#73) is blocked without these fields — the plugin
cannot honestly emit data the SDK never hands it. The Java SDK is adding the analogous
plugin accessor in aws-durable-execution-sdk-java#596.

Changes

File Change
src/aws_durable_execution_sdk_python/plugin.py the two kw-only fields + docstrings; from_durable_execution_invocation_output carries them; PluginExecutor start-info plumbing
src/aws_durable_execution_sdk_python/execution.py one line: pass input_event into the invocation-start plugin info
tests/plugin_test.py fixtures extended; new tests: default-None backward compatibility, and the end-info factory carrying input+result

Testing

  • hatch run test:all packages/aws-durable-execution-sdk-python/tests/plugin_test.py — 70 passed
  • hatch run test:all packages/aws-durable-execution-sdk-python/tests/execution_test.py — 82 passed
  • hatch fmt --check clean on all touched files
  • End-to-end: with these fields, the preview Python Workflow Insight plugin passes the
    18-requirement insight conformance suite 18/18 on both record sinks (live, us-west-2)

Adds InvocationInfo.execution_input (the deserialized execution input)
and InvocationEndInfo.execution_result (the serialized result JSON) so
instrumentation plugins can record execution I/O. Both are kw-only with
None defaults, so existing plugins and callers are unaffected. Mirrors
the JS SDK's InvocationInfo.executionInput / InvocationEndInfo
.executionResult (the Java SDK is adding the analogous accessor in
aws-durable-execution-sdk-java#596).
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.

1 participant