julee.workflows¶
Temporal workflows for the julee domain.
This package contains Temporal workflow definitions that orchestrate use cases with durability guarantees, retry logic, and state management.
Workflows in this package: - ExtractAssembleWorkflow: Orchestrates document extraction and assembly - ValidateDocumentWorkflow: Orchestrates document validation against policies
Submodules¶
Attributes¶
Classes¶
Temporal workflow for document extract and assemble operations. |
|
Temporal workflow for document validation operations. |
Package Contents¶
- class julee.workflows.ExtractAssembleWorkflow[source]¶
Temporal workflow for document extract and assemble operations.
This workflow: 1. Receives document_id and assembly_specification_id 2. Orchestrates the ExtractAssembleDataUseCase with workflow-safe proxies 3. Provides durability and retry logic for long-running assembly 4. Returns the completed Assembly 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_assembly(reason)[source]¶
Signal handler to cancel the assembly 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, assembly_specification_id)[source]¶
Execute the extract and assemble workflow.
- Parameters:
document_id (str) – ID of the document to assemble
assembly_specification_id (str) – ID of the specification to use
- Returns:
Completed Assembly object with assembled document
- Raises:
ValueError – If required entities are not found
RuntimeError – If assembly processing fails after retries
- Return type:
- assembly_id: str | None = None¶
- current_step = 'initialized'¶
- class julee.workflows.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:
- current_step = 'initialized'¶
- validation_id: str | None = None¶