julee.workflows.validate_document¶
Temporal workflow for document validation operations.
This workflow orchestrates the ValidateDocumentUseCase with Temporal’s durability guarantees, providing retry logic, state management, and compensation for the document validation process.
Attributes¶
Classes¶
Temporal workflow for document validation operations. |
Module Contents¶
- class julee.workflows.validate_document.ValidateDocumentWorkflow[source]¶
Temporal workflow for document validation operations.
This workflow: 1. Receives document_id and policy_id 2. Orchestrates the ValidateDocumentUseCase with workflow-safe proxies 3. Provides durability and retry logic for validation processing 4. Returns the completed DocumentPolicyValidation object
The workflow remains framework-agnostic by delegating all business logic to the use case, while providing Temporal-specific orchestration concerns like retry policies, timeouts, and state management.
- async cancel_validation(reason)[source]¶
Signal handler to cancel the validation process.
- Parameters:
reason (str) – Reason for cancellation
Note
This is a placeholder for future cancellation logic. Currently, we rely on Temporal’s built-in workflow cancellation.
- async run(document_id, policy_id)[source]¶
Execute the document validation workflow.
- Parameters:
document_id (str) – ID of the document to validate
policy_id (str) – ID of the policy to validate against
- Returns:
Completed DocumentPolicyValidation object with validation results
- Raises:
ValueError – If required entities are not found
RuntimeError – If validation processing fails after retries
- Return type: