Skip to content

Commit 04edb92

Browse files
authored
Clarify that WORKFLOW_ID_REUSE_POLICY_TERMINATE_IF_RUNNING is deprecated (#681)
1 parent 7acda96 commit 04edb92

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

openapi/openapiv2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17473,7 +17473,7 @@
1747317473
"WORKFLOW_ID_REUSE_POLICY_TERMINATE_IF_RUNNING"
1747417474
],
1747517475
"default": "WORKFLOW_ID_REUSE_POLICY_UNSPECIFIED",
17476-
"description": "Defines whether to allow re-using a workflow id from a previously *closed* workflow.\nIf the request is denied, the server returns a `WorkflowExecutionAlreadyStartedFailure` error.\n\nSee `WorkflowIdConflictPolicy` for handling workflow id duplication with a *running* workflow.\n\n - WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE: Allow starting a workflow execution using the same workflow id.\n - WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY: Allow starting a workflow execution using the same workflow id, only when the last\nexecution's final state is one of [terminated, cancelled, timed out, failed].\n - WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE: Do not permit re-use of the workflow id for this workflow. Future start workflow requests\ncould potentially change the policy, allowing re-use of the workflow id.\n - WORKFLOW_ID_REUSE_POLICY_TERMINATE_IF_RUNNING: This option belongs in WorkflowIdConflictPolicy but is here for backwards compatibility.\nIf specified, it acts like ALLOW_DUPLICATE, but also the WorkflowId*Conflict*Policy on\nthe request is treated as WORKFLOW_ID_CONFLICT_POLICY_TERMINATE_EXISTING.\nIf no running workflow, then the behavior is the same as ALLOW_DUPLICATE."
17476+
"description": "Defines whether to allow re-using a workflow id from a previously *closed* workflow.\nIf the request is denied, the server returns a `WorkflowExecutionAlreadyStartedFailure` error.\n\nSee `WorkflowIdConflictPolicy` for handling workflow id duplication with a *running* workflow.\n\n - WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE: Allow starting a workflow execution using the same workflow id.\n - WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY: Allow starting a workflow execution using the same workflow id, only when the last\nexecution's final state is one of [terminated, cancelled, timed out, failed].\n - WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE: Do not permit re-use of the workflow id for this workflow. Future start workflow requests\ncould potentially change the policy, allowing re-use of the workflow id.\n - WORKFLOW_ID_REUSE_POLICY_TERMINATE_IF_RUNNING: Terminate the current Workflow if one is already running; otherwise allow reusing the\nWorkflow ID. When using this option, `WorkflowIdConflictPolicy` must be left unspecified.\n\nDeprecated. Instead, set `WorkflowIdReusePolicy` to `ALLOW_DUPLICATE` and\n`WorkflowIdConflictPolicy` to `TERMINATE_EXISTING`. Note that `WorkflowIdConflictPolicy`\nrequires Temporal Server v1.24.0 or later."
1747717477
},
1747817478
"v1WorkflowPropertiesModifiedEventAttributes": {
1747917479
"type": "object",

temporal/api/enums/v1/workflow.proto

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ enum WorkflowIdReusePolicy {
2323
// Do not permit re-use of the workflow id for this workflow. Future start workflow requests
2424
// could potentially change the policy, allowing re-use of the workflow id.
2525
WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE = 3;
26-
// This option belongs in WorkflowIdConflictPolicy but is here for backwards compatibility.
27-
// If specified, it acts like ALLOW_DUPLICATE, but also the WorkflowId*Conflict*Policy on
28-
// the request is treated as WORKFLOW_ID_CONFLICT_POLICY_TERMINATE_EXISTING.
29-
// If no running workflow, then the behavior is the same as ALLOW_DUPLICATE.
30-
WORKFLOW_ID_REUSE_POLICY_TERMINATE_IF_RUNNING = 4;
26+
// Terminate the current Workflow if one is already running; otherwise allow reusing the
27+
// Workflow ID. When using this option, `WorkflowIdConflictPolicy` must be left unspecified.
28+
//
29+
// Deprecated. Instead, set `WorkflowIdReusePolicy` to `ALLOW_DUPLICATE` and
30+
// `WorkflowIdConflictPolicy` to `TERMINATE_EXISTING`. Note that `WorkflowIdConflictPolicy`
31+
// requires Temporal Server v1.24.0 or later.
32+
WORKFLOW_ID_REUSE_POLICY_TERMINATE_IF_RUNNING = 4 [deprecated = true];
3133
}
3234

3335
// Defines what to do when trying to start a workflow with the same workflow id as a *running* workflow.

0 commit comments

Comments
 (0)