Hello,
this is subjective but I find the documentation on how workflow versioning works, very confusing.
Specifically the part (or lack of) that explains how it helps with workflow replayability during the first execution of versioned change (not the subsequent executions, which are explained well).
I’ve read docs from Go, Java, C# and watched the youtube video as well, none of them explained why the patched workflow runs the new code on it’s first execution, but doesn’t during replay, when the exact same code runs in both cases AND there is definitely no marker yet in the event history.
My question was only answered by experimenting and looking at source, specifically sdk-go/internal/internal_event_handlers.go at 4a4695e7fc3bef291e6aead3301d240bb0c0fef6 · temporalio/sdk-go · GitHub)
So the key information is that some temporal API calls behave differently during replay!
Apart from GetVersion, also the logger is noop during replay.
I’d suggest mentioning a simple sentence like:
During workflow replay, the GetVersion will always return DefaultVersion. Only new executions of the workflow, started after the change was introduced, will return the version provided (e.g. 1).
Also, during workflow replay, no marker will be noted in the event history.
It might be obvious to you, but it seemed like magic to me, until I realized this. Especially because the logs that I added to help demistify it were only printed only on new workflows.
Thank you for consideration.