Skip to content

docs(workflow): add retry policy authoring example - #958

Closed
ekanshbannsal wants to merge 1 commit into
dapr:mainfrom
ekanshbannsal:docs/workflow-retry-policy-example
Closed

ekanshbannsal wants to merge 1 commit into
dapr:mainfrom
ekanshbannsal:docs/workflow-retry-policy-example

Conversation

@ekanshbannsal

Copy link
Copy Markdown

What does this PR do?
Adds a workflow authoring example (examples/workflow/authoring/src/retry-policy.ts) with corresponding npm scripts and README documentation demonstrating how to configure and apply Dapr RetryPolicy on both workflow activities and child workflows.

Why is this change needed?
While RetryPolicy is supported in the SDK via ctx.callActivity and ctx.callChildWorkflow, examples/workflow/authoring did not yet have a dedicated example explaining each RetryPolicy parameter (firstRetryInterval, maxNumberOfAttempts, backoffCoefficient, maxRetryInterval, and retryTimeout).

How was it implemented?

  • Added examples/workflow/authoring/src/retry-policy.ts documenting all five RetryPolicy fields and showing automatic retry recovery for both an activity (ctx.callActivity(..., { retryPolicy })) and a child workflow (ctx.callChildWorkflow(..., undefined, { retryPolicy })).
  • Added start:retry-policy and start:dapr:retry-policy scripts to examples/workflow/authoring/package.json.
  • Documented the new example in examples/workflow/authoring/README.md.

Testing performed

  • npm run build in repo root: compiled SDK to ./build/.
  • npx tsc --noEmit --target es2022 --module commonjs --esModuleInterop --strict --skipLibCheck src/retry-policy.ts in examples/workflow/authoring: passed with 0 errors.
  • npx eslint examples/workflow/authoring/src/retry-policy.ts: passed with 0 errors.
  • npx prettier --check examples/workflow/authoring/src/retry-policy.ts examples/workflow/authoring/package.json examples/workflow/authoring/README.md: passed.

Related issue
Closes #689

Signed-off-by: Ekansh Bannsal <ekanshbannsal@gmail.com>
@ekanshbannsal
ekanshbannsal requested review from a team as code owners November 28, 2026 10:35
@ekanshbannsal

Copy link
Copy Markdown
Author

Closing this myself — I raised it during a batch of contributions and it is outside the scope I can properly commit to maintaining. Better to clear it out of your review queue than leave it sitting.

Sorry for the time spent triaging it, and thanks for the docs.

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.

Workflow Retry Policy Examples

1 participant