Slug: document-timeout Version: 1.0.0 Infer: No Event Aware: Yes

Overview

Document Timeout Model

The Document Timeout model provides automated monitoring and handling of stalled documents in processing pipelines. It runs on a scheduled basis to identify documents stuck in processing states for too long and updates their status to indicate a timeout condition.

How It Works

  1. The model runs on a scheduled basis (typically set up as a recurring event)
  2. It queries the specified document store using a configurable timeout filter
  3. The filter identifies documents that may be stuck in processing states
  4. For each identified document, it updates the status to a designated timeout status
  5. This allows for appropriate handling of documents that may have stalled in processing

Options Configuration

OptionDescription
document_store_refThe document store to scan for potential timeouts
timeout_filterA query expression that identifies documents that may have timed out
timeout_status_idThe status to apply to documents that are determined to have timed out

Timeout Filter Syntax

The timeout filter uses Kodexa’s query language to identify documents. The default filter looks for:

  1. Documents with executions in PENDING, RUNNING, or FAILED states
  2. Documents with execution events in PENDING, RUNNING, or FAILED states
  3. Documents modified within the last 24 hours

You can customize this filter to match your specific timeout criteria, such as:

  • Longer or shorter timeouts
  • Different status combinations
  • Additional conditions based on document metadata
  • Specific document types or processing stages

Process Flow

Use Cases

The Document Timeout model is particularly useful for:

  • Workflow Monitoring: Identifying stuck documents in automated workflows
  • Error Recovery: Handling documents that have stalled due to processing errors
  • SLA Compliance: Ensuring documents are processed within defined time periods
  • Queue Management: Preventing document backlogs in processing queues
  • Pipeline Monitoring: Ensuring smooth operation of document processing pipelines

Example Configuration

To set up a basic timeout detection that flags documents stuck in processing for more than 12 hours:

document_store_ref: "your-organization/document-processing:1.0.0"
timeout_filter: "exists(executions.status in ['PENDING','RUNNING']) and modified < dateMath('now - 12 hours')"
timeout_status_id: "Timed Out"

Integration Considerations

  • The model should be configured to run on a schedule that makes sense for your processing timelines
  • The timeout status should be defined in your project’s status configuration
  • You may want to create different timeout handlers for different document types or processing stages
  • Consider creating notifications or alerts when documents timeout
  • Timeout handling can be complemented with retry mechanisms using the Document Retry model

Inference Options

The following options can be configured when using this model for inference:

NameLabelTypeDescriptionDefaultRequired
document_store_refDocument StoredocumentStoreN/A-No
timeout_filterTimeout FilterstringN/Aexists(executions.status in [‘PENDING’,‘RUNNING’, ‘FAILED’]) and exists(executions.events.status in [‘PENDING’, ‘RUNNING’,‘FAILED’]) and modified > dateMath(‘now - 24 hours’)No
timeout_status_idTimeout StatusdocumentStatusN/A-No

Model Details

  • Provider: Kodexa AI