Skip to content

Conversation

@carlydf
Copy link
Contributor

@carlydf carlydf commented Dec 9, 2025

What changed?

Give the option to upgrade-on-Continue-as-New with a continue-as-new option

Why?

To unlock "Trampolining"

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

Note

Introduces AutoUpgrade-on-Continue-as-New, adds target_deployment_version to RecordWorkflowTaskStartedRequest, propagates it through matching/history, and records explicit continue-as-new suggestion reasons.

  • Versioning/Behavior:
    • Implement AutoUpgrade-on-Continue-as-New (initial behavior) with logic to inherit or auto-upgrade across runs.
    • Compute and record explicit suggest_continue_as_new reasons, including target worker deployment version change.
  • API/Proto:
    • Add target_deployment_version to historyservice.v1.RecordWorkflowTaskStartedRequest (request_response.proto), regenerate Go stubs.
    • Extend WorkflowTaskStarted event attributes to include suggest_continue_as_new_reasons.
  • History Service:
    • Extend AddWorkflowTaskStartedEvent(...) signatures to accept target deployment version and pass along suggest-continue-as-new reasons.
    • Update mutable state CAN inheritance logic to respect AUTO_UPGRADE initial behavior.
  • Matching Service:
    • Determine and attach target worker deployment version when adding/dispatching tasks; include it in RecordWorkflowTaskStarted calls.
    • Update internal task structures and queue resolution to return target deployment version.
  • Tests:
    • Add functional tests for versioning v3 “trampolining” (upgrade-on-continue-as-new) and reason assertions.
    • Update existing tests to new method signatures.
  • Deps:
    • Adjust go.temporal.io/api module version in go.mod/go.sum.

Written by Cursor Bugbot for commit 9aff4da. This will update automatically on new commits. Configure here.

@carlydf carlydf requested review from a team as code owners December 9, 2025 23:59
@carlydf carlydf marked this pull request as draft December 10, 2025 00:54
@carlydf carlydf changed the title [WIP] AutoUpgrade-on-Continue-as-New option (Trampolining) AutoUpgrade-on-Continue-as-New option (Trampolining) Dec 12, 2025
@carlydf carlydf marked this pull request as ready for review December 12, 2025 03:18
request.WorkerVersionStamp,
workflowTask.BuildIdRedirectCounter,
nil,
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Continue-as-new reasons lost for transient/speculative workflow tasks

When transient or speculative workflow tasks are converted to normal tasks, nil is passed for suggestContinueAsNewReasons because the WorkflowTaskInfo struct only stores the SuggestContinueAsNew boolean, not the reasons array. The new TARGET_WORKER_DEPLOYMENT_VERSION_CHANGED reason is calculated in AddWorkflowTaskStartedEvent but never stored, so it's lost when the event is created during conversion. This results in events with SuggestContinueAsNew=true but an empty SuggestContinueAsNewReasons slice, preventing SDKs from knowing why continue-as-new was suggested.

Additional Locations (2)

Fix in Cursor Fix in Web

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