workflow.SideEffect is useful for short, nondeterministic code snippets, such as getting a random
value or generating a UUID. It executes the provided function once and records its result into the
workflow.SideEffect does not re-execute upon replay, but instead returns the
recorded result. It can be seen as an "inline" activity. Something to note about
is that, unlike the Temporal guarantee of at-most-once execution for activities, there is no such
workflow.SideEffect. Under certain failure conditions,
end up executing a function more than once.
The only way to fail
SideEffect is to panic, which causes a decision task failure. After the
timeout, Temporal reschedules and then re-executes the decision task, giving
SideEffect another chance
to succeed. Do not return any data from
SideEffect other than through its recorded return value.
The following sample demonstrates how to use