In this article
Specify the intended closed-run reuse and open-run conflict behavior separately, including what the namespace retention period lets the service remember.
Identify the execution state before choosing a policy
A client retries starting an agent task using its business identifier. The earlier task may still be running or may already have completed. Temporal’s identity guide assigns these situations different policies. Workflow ID Reuse Policy concerns closed executions; Workflow ID Conflict Policy concerns an open execution. Treating them as one duplicate switch obscures the behavior precisely when recovery needs a predictable outcome.
Decide what should happen to a running task
The Python conflict-policy reference provides failure, use-existing and terminate-existing choices. Returning an existing execution can let a caller attach to ongoing work. Terminating it and starting another execution has a much larger effect. Do not select replacement merely to silence an already-started error. Determine whether the user’s request is another observation of the same task or an authorized request to replace its active execution.
Decide whether a closed identifier may run again
The reuse-policy reference exposes choices such as allowing reuse, allowing failed-only reuse and rejecting duplicates. A successful completed research job may need different treatment from a failed attempt. Make that business distinction explicit. Reusing an identifier after completion is not the same as attaching to the old completed result, and a new run should not silently be presented as historical evidence from the previous run.
Respect retention and run identity
The concept guide limits closed-execution checks to retained history. Rejecting duplicate IDs is therefore not an everlasting business ledger after that evidence expires. If the application needs permanent duplicate detection, maintain the appropriate durable business record. Also distinguish the workflow’s business ID from its system-generated Run ID, which can change through operations such as Continue-As-New. Record the relevant namespace and execution identity when diagnosing an unexpected start result.
Verify the complete start contract
Exercise a harmless example against both an open execution and retained closed outcomes, then inspect whether the caller receives the intended existing run, failure or new execution. The task-contract guide states whether replacement is authorized; tool observations distinguish attempted start from actual execution. Preserve both policies with the client configuration. A meaningful ID is valuable only when its lifecycle behavior matches the application’s intended task identity.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.