julee.workflows.extract_assemble

Temporal workflow for extract and assemble data operations.

This workflow orchestrates the ExtractAssembleDataUseCase with Temporal’s durability guarantees, providing retry logic, state management, and compensation for the complex document assembly process.

Attributes

Classes

ExtractAssembleWorkflow

Temporal workflow for document extract and assemble operations.

Module Contents

class julee.workflows.extract_assemble.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[source]
current_step = 'initialized'[source]
julee.workflows.extract_assemble.EXTRACT_ASSEMBLE_RETRY_POLICY[source]
julee.workflows.extract_assemble.logger[source]