Skip to content

[Feature Request] Allow force complete current workflow task when localActivity is completed or failed #12174

Description

@longquanzheng

Is your feature request related to a problem? Please describe.

When executing many local activities in a row or parallel within a workflow task, (or a local activity is retrying), the workflow task is waiting until passed 80% of the workflow task timeout(10s). This could cause a big delay of query processing, or signal processing.

In certain scenarios, it's more flexible to let user workflow to decide when they can report the workflow task completed and then get(lease) a new workflow task to execute the next activities. This will then make it possible to process query task, or new signals.

Describe the solution you'd like

  • LocalActivityOptions provides a flag to allow user to force complete current workflow task when it's completed and/or failed.
  • alternatively, have an API like activity.forceCompleteWorkflowTask() to be invoked by user code
  • It should be only a SDK feature, likely server doesn't need to do anything.

Additional context

Acknowledged by Maxim in the internal thread.

Activity

cretz commented on Feb 26, 2024

@cretz
Contributor

This sounds like you want to just expose the internal concept we have called workflow task heartbeating (whereby we request a new workflow task for long running local activities). I think that is probably doable, though if you know that you may go beyond a workflow task boundary, it might be worth questioning whether local activities were the right thing to use. It could be very dangerous to expose this because people might inadvertently blow up their history with tasks if I understand correctly.

locked and limited conversation to collaborators on Sep 18, 2026
converted this issue into a discussion #12175 on Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions