Skip to content

feat(client): apply #[MethodRetry] to workflows started via WorkflowClient - #843

Open
rela589n wants to merge 1 commit into
temporalio:masterfrom
rela589n:feat/client-method-retry
Open

rela589n wants to merge 1 commit into
temporalio:masterfrom
rela589n:feat/client-method-retry

Conversation

@rela589n

Copy link
Copy Markdown

Problem

#[MethodRetry] on workflow handler work only for child workflows. Start same workflow via WorkflowClient::newWorkflowStub(): attribute silently dropped, no RetryPolicy sent. WorkflowOptions::mergeWith() existed but nothing in src/ called it.

Fix

newWorkflowStub() merge handler's #[MethodRetry] into WorkflowOptions, same as ChildWorkflowProxy. User-set retry fields still win.

#[CronSchedule] stay ignored on client starts on purpose: inheriting cron from class too risky. Docblock now say so.

Behavior change

Workflow with #[MethodRetry] on handler now retries when started from client.

Proof

WorkflowClientMethodRetryTestCase: retry policy from attribute, user field wins, cron empty. Fails without fix.

🤖 Generated with Claude Code

@rela589n
rela589n requested review from a team, roxblnfk and wolfy-j as code owners October 28, 2026 12:08
…lient

WorkflowClient::newWorkflowStub() now merges the handler's #[MethodRetry]
into WorkflowOptions, as child workflow stubs already do. User-set retry
fields keep precedence. #[CronSchedule] stays ignored on client starts.

Behavior change: a workflow whose handler has #[MethodRetry] now gets a
RetryPolicy when started from the client.
@rela589n
rela589n force-pushed the feat/client-method-retry branch from e9e8109 to 088c405 Compare October 28, 2026 12:09
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

This branch has not been deployed

No deployments
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.

2 participants