PARAS MADAN
All writing

Latest in AI

Test a human review step with the AWS Lambda Durable Execution SDK for Rust

Use the Rust durable execution SDK to checkpoint a model draft, wait for a reviewer and test replay and rejection locally before deploying.

If you make a model draft a release note and a person reviews it the next morning, the two parts of the job should not share one running process. The workflow should save the draft, stop while it waits, and resume with the draft the reviewer actually saw.

AWS made its Lambda Durable Execution SDK for Rust generally available on November 19. The 1.0.0 release requires Rust 1.94.1 or newer. If you already use Rust, a small draft review is a useful first workflow because you can check what replay preserves without involving production data or publishing anything.

Save the draft before asking for review

Start with synthetic release notes. Put the model call inside one durable step, and return a fixed draft ID with either the generated text or an immutable reference to it. If you use a reference, make sure the document behind it cannot change after review begins.

Lambda replays the handler from the beginning after a wait or interruption. The SDK supplies saved results for completed operations rather than running them again. Keeping the model call in a step means a completed draft can be reused instead of generating new text while processing the decision.

Keep unrelated nondeterministic work out of the top-level handler. For this workflow, generate IDs from stable inputs or within a checkpointed step. If a fresh timestamp or random value changes which operation runs next, replay can encounter a different sequence than the original invocation.

Make the reviewer decision a separate operation

Use a durable callback to wait for a decision from the application that collects the review. Have that application show the exact draft and attach the reviewer decision to its ID. Keep callback identifiers in the service tier and have the application verify the reviewer is allowed to decide.

Approval can return the reviewed draft to the requesting application. A rejection should return a distinct result for editing, and a timeout should leave the draft unapproved. Keep public publishing outside this workflow. A completed callback tells you a decision arrived; the decision itself tells you whether the draft was approved.

Treat an interrupted model call as uncertain

The SDK does not promise exactly-once execution for an external model call. AWS documents at-least-once steps by default. A request can complete at the provider before Lambda records the result. If the step is interrupted in between, a retry can call the model again.

Use a stable operation ID in your records and set a bounded retry policy. Where the external service supports idempotency, pass the same key on retries. Otherwise, account for the possibility of a second billable call. Do not silently present a newer retry's draft as the one a reviewer already saw.

Exercise the approval paths locally

Use the SDK's Rust LocalRunner with a stub model call, not a live inference client. The runner works in-process, replays the handler and uses a virtual clock. Feed it a prepared callback reply or drive the callback through an operation handle.

Start with four cases:

  1. Approve: Confirm the returned draft ID matches the submitted one and the draft step was not rerun after the callback.
  2. Reject: Return the rejection outcome without producing an approved result.
  3. Timeout: Let the virtual clock expire the review. Assert that no approval exists.
  4. Interrupted step: Inject a checkpoint failure and check how retries affect the stub's call count. Do not assume it is always one.

The final output is only half the test. Inspect the operation history to see whether the workflow waited, what it replayed and where it stopped. These tests do not establish that your deployed roles, networking or callback integration are correct.

Preserve the replay contract when you deploy

Start a cloud pilot on a published Lambda version or alias, rather than $LATEST. AWS's invocation guide warns that a paused execution started on $LATEST may resume against changed code. A draft awaiting tomorrow's reviewer should not have to survive an unplanned change to step order tonight.

Keep checkpoints small and avoid storing secrets or full logs in step results. Durable state is useful because it survives a pause; that is also why you should be deliberate about what goes into it.

Explain how your tools work in production

I'm Paras. I work at the intersection of AI, engineering and distribution.

I help AI and infrastructure teams turn SDK releases and migration details into technical writing and product stories developers can use.

Book a 30-minute call.