Skip to content

Commit 85f8945

Browse files
committed
Enhancing A2I template and adding logic for failed review tasks
1 parent 111bd1c commit 85f8945

File tree

1 file changed

+3
-2
lines changed
  • patterns/pattern-1/src/hitl-process-function

1 file changed

+3
-2
lines changed

patterns/pattern-1/src/hitl-process-function/index.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ def check_all_sections_complete(document_id, tracking_table):
209209
has_failed_sections = False
210210
for section in sections:
211211
status = section.get('Status')
212-
if status == 'FAILED':
212+
if status == 'Failed':
213213
has_failed_sections = True
214-
elif status != 'COMPLETED':
214+
elif status != 'Completed':
215215
return False, False # Still has pending sections
216216

217217
return True, has_failed_sections
@@ -439,6 +439,7 @@ def lambda_handler(event, context):
439439

440440
# Check if all sections for this document are complete
441441
all_sections_complete, has_failed_sections = check_all_sections_complete(document_id, tracking_table)
442+
logger.info(f"all_sections_complete: {all_sections_complete}, has_failed_sections: {has_failed_sections}")
442443

443444
if all_sections_complete:
444445
section_task_token = find_doc_task_token(document_id, tracking_table)

0 commit comments

Comments
 (0)