julee.workflows =============== .. py:module:: julee.workflows .. autoapi-nested-parse:: 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 ---------- .. toctree:: :maxdepth: 1 /autoapi/julee/workflows/extract_assemble/index /autoapi/julee/workflows/validate_document/index Attributes ---------- .. autoapisummary:: julee.workflows.EXTRACT_ASSEMBLE_RETRY_POLICY julee.workflows.VALIDATE_DOCUMENT_RETRY_POLICY Classes ------- .. autoapisummary:: julee.workflows.ExtractAssembleWorkflow julee.workflows.ValidateDocumentWorkflow Package Contents ---------------- .. py:class:: ExtractAssembleWorkflow 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. .. py:method:: cancel_assembly(reason) :async: Signal handler to cancel the assembly process. :param reason: Reason for cancellation .. note:: This is a placeholder for future cancellation logic. Currently, we rely on Temporal's built-in workflow cancellation. .. py:method:: get_assembly_id() Query method to get the assembly ID once created .. py:method:: get_current_step() Query method to get the current workflow step .. py:method:: run(document_id, assembly_specification_id) :async: Execute the extract and assemble workflow. :param document_id: ID of the document to assemble :param assembly_specification_id: ID of the specification to use :returns: Completed Assembly object with assembled document :raises ValueError: If required entities are not found :raises RuntimeError: If assembly processing fails after retries .. py:attribute:: assembly_id :type: str | None :value: None .. py:attribute:: current_step :value: 'initialized' .. py:class:: ValidateDocumentWorkflow 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. .. py:method:: cancel_validation(reason) :async: Signal handler to cancel the validation process. :param reason: Reason for cancellation .. note:: This is a placeholder for future cancellation logic. Currently, we rely on Temporal's built-in workflow cancellation. .. py:method:: get_current_step() Query method to get the current workflow step .. py:method:: get_validation_id() Query method to get the validation ID once created .. py:method:: run(document_id, policy_id) :async: Execute the document validation workflow. :param document_id: ID of the document to validate :param policy_id: ID of the policy to validate against :returns: Completed DocumentPolicyValidation object with validation results :raises ValueError: If required entities are not found :raises RuntimeError: If validation processing fails after retries .. py:attribute:: current_step :value: 'initialized' .. py:attribute:: validation_id :type: str | None :value: None .. py:data:: EXTRACT_ASSEMBLE_RETRY_POLICY .. py:data:: VALIDATE_DOCUMENT_RETRY_POLICY