You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation uses a sub workflow: #345 requires to provide WaitingForCompletionStateExecutionIds on starting workflow which is cumbersome to use. It's required because we want minimize the initiation of these sub workflows as optimization.
Additionally, it's not efficient because of the overhead of starting/signaling another workflow. It consume quite a lot of actions
A better way is:
Extend the stateExecutionCounter to track the completed state executionId
Use synchronous update with workflow.Await( ()-> stateExecutionCounter.stateExecuctionCompleted(stateExeId) ) in the handler to wait for the execution
Note that continueAsNew need to be handled properly:
In validator, it should check if the workflow has met continueAsNew threshold. If so, then return error
In the workflow.Await(...) should also check continueAsNew threshold to return error so that workflow can do a continueAsNew
The API service need to retry when continueAsNew interrupts the waiting
returning state completion output will not be supported
Also, it doesn't allow reuse workflowId for different executions, because of the RunID issues in Temporal. This v2 can solve the problems
Note that sync update feature is not prod ready in Temporal yet. We will start working on it when it is ready.
The text was updated successfully, but these errors were encountered:
longquanzheng
changed the title
Re-design waitForStateCompletion API using synchronous update feature
V2 of waitForStateCompletion API using synchronous update feature from Temporal when it's available in production
Dec 19, 2023
longquanzheng
changed the title
V2 of waitForStateCompletion API using synchronous update feature from Temporal when it's available in production
V2 of waitForStateCompletion API using synchronous update feature
Feb 21, 2024
The current implementation uses a sub workflow: #345 requires to provide
WaitingForCompletionStateExecutionIds
on starting workflow which is cumbersome to use. It's required because we want minimize the initiation of these sub workflows as optimization.Additionally, it's not efficient because of the overhead of starting/signaling another workflow. It consume quite a lot of actions
A better way is:
workflow.Await( ()-> stateExecutionCounter.stateExecuctionCompleted(stateExeId) )
in the handler to wait for the executionNote that continueAsNew need to be handled properly:
workflow.Await(...)
should also check continueAsNew threshold to return error so that workflow can do a continueAsNewAlso, it doesn't allow reuse workflowId for different executions, because of the RunID issues in Temporal. This v2 can solve the problems
Note that sync update feature is not prod ready in Temporal yet. We will start working on it when it is ready.The text was updated successfully, but these errors were encountered: