Greetings. I’d like to ask for some documentation clarification.
(Temporal 1.26,2, Java SDK 1.27.1)
Here, it states:
Update-with-Start lets you send an Update that checks whether an already-running Workflow with that ID exists:
If the Workflow exists, the Update is processed.
If the Workflow does not exist, a new Workflow Execution is started with the given ID, and the Update is processed immediately after.
Now, my workflow has an @ExecuteMethod
, and an @UpdateMethod
.
When using startUpdateWithStart(..)
, mine looks like:
WorkflowClient
.startUpdateWithStart(
lockWorkflow::obtainLock,
lockRequest,
UpdateOptions.<Boolean>newBuilder()
.setWaitForStage(WorkflowUpdateStage.COMPLETED)
.build(),
new WithStartWorkflowOperation<>(
lockWorkflow::execute, lockRequest.maxNumLockHolders(), null))
.getResult();
. . . what is the call sequence into the workflow?
- @ExecuteWorkflow, then @UpdateWorkflow . . . . or . . . .
- @UpdateWorkflow, then @ExecuteWorkflow.
I think I’d expect 1, but I’m seeing 2. So, from the documentation, what is the definition of “a new Workflow Execution is started”?
Update: what if a workflow that has (a) @UpdateMethod
, but also internally uses (b) continueAsNew
– could it get into a state, when continuing, that @UpdateMethod could get called before @UpdatedMethod
? That would a problem, as you’d be unable to consistently/reliably pass state into the workflow AND honor update calls correctly.
Any comments?
Thank you!
Sean