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

ValidateDocumentWorkflow

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.

get_current_step()[source]

Query method to get the current workflow step

get_validation_id()[source]

Query method to get the validation ID once created

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:

julee.domain.models.policy.DocumentPolicyValidation

current_step = 'initialized'[source]
validation_id: str | None = None[source]
julee.workflows.validate_document.VALIDATE_DOCUMENT_RETRY_POLICY[source]
julee.workflows.validate_document.logger[source]