temporalio / temporalio/sdk-java

PollWorkflowTaskQueueResponse should be available for interception

Open
#1,051 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
433
Forks
249
Avg merge
5d 6h
Merged PRs (30d)
26

Description

Is your feature request related to a problem? Please describe.
PollWorkflowTaskQueueResponse has the information about the WorkflowTask and contains some pieces of information that may be needed for reporting/logging.
Specifically, the most interesting one is PollWorkflowTaskQueueResponse#attempt that may be used to log workflows that can't progress for a long time.

Describe the solution you'd like
PollWorkflowTaskQueueResponse or some parts of it should be made available to the user-configured handler/interceptor.

TBD. It also can become an input of a new method of WorkflowInboundInterceptor. TBD because currently all methods of Interceptors are extremely bound to the user code lifecycle and directly connected to events in the user code, while this method would be something that interceptors are not currently observed/expose.

Describe alternatives you've considered
To solve the specific problem of reporting a workflow that doesn't progress because of a large number of failures, we can just hardcode logging in a manner that Server currently does: https://github.com/temporalio/temporal/blob/61b9b65744e455d4a85681b117e8315287911621/service/history/workflow/workflow_task_state_machine.go#L763
This solution is not flexible and doesn't move the extensibility of the SDK forward though.

Additional context
Related to https://github.com/temporalio/temporal/issues/2526

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the PollWorkflowTaskQueueResponse and WorkflowInboundInterceptor references in the issue, then review the related temporalio/temporal#2526 discussion and the linked workflow_task_state_machine.go context. The scope is complete when a concrete interception design is agreed on, including the information exposed and its lifecycle, with corresponding SDK tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.