If you generate the UUID in memory when invoking the service, a retry will result in a new UUID. If the UUID you are passing is a persisted (non-transient) process or task scoped variable, it will be re-used. So for your case, if it’s not already a variable, you could for instance create it as a locally scoped variable in an ExecutionListener at the start event of the task and then just use that variable in the call to ensure you use the same value on each invocation. Make sure the task is async before in that case.
@tiesebarrell , thanks for the response. So to summarise your answer:
If I generate the UUID as Input Variable it will create the variable every time.
If I generate the UUID in the Execution Listener (start) it will create the variable just ones.
Doesn’t the listener get executed each time the job is executed? I.e. wouldn’t a new UUID be generated on each retry?
IIUC, in order to have the same UUID, one should generate it in a previuos step (and save as a process variable), and have an async point somewhere before the step in question (e.g. mark the step as “async before”).
The listener is executed when the task is started, so precisely once for each execution. Indeed, if you need that variable to be consistent across all executions, you cannot set it in a start listener of the same task. My mistake, sorry. You have to set it either in a task before (using, for instance, a listener) or in a listener on the sequence flow that flows into the task.