From 743df2d94d9564987bc44d6d0057baa0194198c4 Mon Sep 17 00:00:00 2001 From: vishnuszipstack Date: Mon, 9 Feb 2026 13:43:19 +0530 Subject: [PATCH] [FIX] Fix HITL review screen showing "Never expires" despite TTL being set Fix two interacting bugs that prevented TTL from propagating to HITL queue records: 1. WorkflowUtil.get_hitl_ttl_seconds was an OSS stub that always returned None. Now delegates to get_hitl_ttl_seconds_by_workflow via try/except import, falling back to None in OSS environments. 2. _push_to_queue_for_api_deployment never fetched TTL. Now mirrors the connector path by calling WorkflowUtil.get_hitl_ttl_seconds and passing ttl_seconds through to _create_queue_result and _enqueue_to_packet_or_regular_queue. Co-Authored-By: Claude Opus 4.6 --- backend/plugins/workflow_manager/workflow_v2/utils.py | 10 ++++++++-- backend/workflow_manager/endpoint_v2/destination.py | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/backend/plugins/workflow_manager/workflow_v2/utils.py b/backend/plugins/workflow_manager/workflow_v2/utils.py index fa8a36bcb0..f65842ca27 100644 --- a/backend/plugins/workflow_manager/workflow_v2/utils.py +++ b/backend/plugins/workflow_manager/workflow_v2/utils.py @@ -134,5 +134,11 @@ def get_hitl_ttl_seconds(workflow: Workflow) -> Any: Optional[int]: TTL in seconds if custom TTL is set, None for unlimited TTL. For OSS version, always returns None (unlimited TTL). """ - # TTL feature is cloud-only, return None for unlimited TTL in OSS - return None + try: + from pluggable_apps.manual_review_v2.helper import ( + get_hitl_ttl_seconds_by_workflow, + ) + + return get_hitl_ttl_seconds_by_workflow(workflow) + except ImportError: + return None diff --git a/backend/workflow_manager/endpoint_v2/destination.py b/backend/workflow_manager/endpoint_v2/destination.py index f86f76827d..0e63e129a2 100644 --- a/backend/workflow_manager/endpoint_v2/destination.py +++ b/backend/workflow_manager/endpoint_v2/destination.py @@ -1041,6 +1041,7 @@ def _push_to_queue_for_api_deployment( input_file_path, file_name ) q_name = self._get_review_queue_name() + ttl_seconds = WorkflowUtil.get_hitl_ttl_seconds(self.workflow) queue_result = self._create_queue_result( file_name=file_name, @@ -1048,11 +1049,12 @@ def _push_to_queue_for_api_deployment( file_content_base64=file_content_base64, file_execution_id=file_execution_id, meta_data=meta_data, + ttl_seconds=ttl_seconds, ) queue_result_json = json.dumps(queue_result) self._enqueue_to_packet_or_regular_queue( - file_name, queue_result, queue_result_json, q_name + file_name, queue_result, queue_result_json, q_name, ttl_seconds ) def _push_to_queue_for_connector(