withRetry helper for durable operations #140
Replies: 3 comments 7 replies
-
|
NICE! Question, the type definition is incompatible with the existing retries we have on |
Beta Was this translation helpful? Give feedback.
-
|
2026-04-23 Update:Based on some internal feedback we changed the name to |
Beta Was this translation helpful? Give feedback.
-
|
+1 on the motivation, we hit this daily. We use durable functions to orchestrate AI pipelines that route between real-time inference and batch based on priority/volume. The 3,000 op limit forces us to coarsen pretty aggressively — we wrap ~100 ops worth of ML compute into single invokes via orchestration lambdas. We've hand-rolled retry around those invokes already so Two things I'd push on: Partial failure. Our main failure mode is k-of-N — a batch invoke processes 100 items and 2 fail. Attempt identity. The examples thread |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
[Feedback wanted] New
withRetryhelper for retrying callbacks, invokes, and other durable operationsWe are exploring a new SDK helper called
withRetryand would love your feedback before we lock the API. Draft PR is here: https://github.com/aws/aws-durable-execution-sdk-js/pull/new/feat/sdk-retry-operationThe problem
context.step()already has a greatretryStrategyoption — you get exponential backoff, jitter, error-type filtering, and per-attempt decisions for free viacreateRetryStrategy. But that only works forstep.For other durable operations (
waitForCallback,invoke,waitForCondition, etc.) there's no equivalent — and they can't be nested inside astep, so you end up hand-rolling something like:Every team I've talked to has written some variant of this. The pattern isn't hard, but it's easy to get subtly wrong (forgetting
context.waitfor backoff, usingsetTimeout, accidentally nesting durable ops inside astep, etc.).The proposal
A single helper that uses the same
retryStrategyshape you already know fromStepConfig:Works with any durable primitive — here it is retrying an
invoke:Links
Appreciate any and all feedback.
Beta Was this translation helpful? Give feedback.
All reactions