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

ExtractAssembleWorkflow

Temporal workflow for document extract and assemble operations.

ValidateDocumentWorkflow

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.

get_assembly_id()[source]

Query method to get the assembly ID once created

get_current_step()[source]

Query method to get the current workflow step

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:

julee.domain.models.assembly.Assembly

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.

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'
validation_id: str | None = None
julee.workflows.EXTRACT_ASSEMBLE_RETRY_POLICY[source]
julee.workflows.VALIDATE_DOCUMENT_RETRY_POLICY[source]