Skip to main content

Enumeration: WorkflowIdReusePolicy

enums.v1.WorkflowIdReusePolicy

Defines whether to allow re-using a workflow id from a previously closed workflow. If the request is denied, the server returns a WorkflowExecutionAlreadyStartedFailure error.

See WorkflowIdConflictPolicy for handling workflow id duplication with a running workflow.

Enumeration Members

WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE

WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE = 1

Allow starting a workflow execution using the same workflow id.


WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY

WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY = 2

Allow starting a workflow execution using the same workflow id, only when the last execution's final state is one of [terminated, cancelled, timed out, failed].


WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE

WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE = 3

Do not permit re-use of the workflow id for this workflow. Future start workflow requests could potentially change the policy, allowing re-use of the workflow id.


WORKFLOW_ID_REUSE_POLICY_TERMINATE_IF_RUNNING

WORKFLOW_ID_REUSE_POLICY_TERMINATE_IF_RUNNING = 4

Terminate the current Workflow if one is already running; otherwise allow reusing the Workflow ID. When using this option, WorkflowIdConflictPolicy must be left unspecified.

Deprecated. Instead, set WorkflowIdReusePolicy to ALLOW_DUPLICATE and WorkflowIdConflictPolicy to TERMINATE_EXISTING. Note that WorkflowIdConflictPolicy requires Temporal Server v1.24.0 or later.


WORKFLOW_ID_REUSE_POLICY_UNSPECIFIED

WORKFLOW_ID_REUSE_POLICY_UNSPECIFIED = 0

WORKFLOW_ID_REUSE_POLICY_UNSPECIFIED value