Module workflow

Source
Expand description

§Workflow Execution Modes in Floxide

Floxide workflows can be executed in several modes, each suited to different use cases:

§1. Monolithic (Single-Process) Execution

  • Method: [run]
  • Description: Runs the entire workflow from start to finish in a single process, with no checkpointing or distributed coordination.
  • Use Case: Simple, local workflows where failure recovery and distributed scaling are not needed.

§2. Checkpointed (Resumable) Execution

  • Method: [run_with_checkpoint]
  • Description: Runs the workflow, checkpointing state after each step. If interrupted, can be resumed from the last checkpoint.
  • Use Case: Long-running workflows, or those that need to recover from process crashes or restarts.

§3. Resuming from Checkpoint

  • Method: [resume]
  • Description: Resumes a workflow run from its last checkpoint, restoring context and queue from the store.
  • Use Case: Recovery after failure, or continuing a workflow after a pause.

§4. Distributed Execution Primitives

  • a. Orchestration/Seeding
    • Method: [start_distributed]
    • Description: Seeds the distributed workflow by checkpointing the initial state and enqueuing the first work item(s). Does not execute any steps.
    • Use Case: Used by an orchestrator to start a new distributed workflow run, preparing it for workers to process.
  • b. Worker Step
    • Method: [step_distributed]
    • Description: A distributed worker dequeues a work item, loads the latest checkpoint, processes the node, enqueues successors, and persists state. Returns output if a terminal node is reached.
    • Use Case: Used by distributed workers to process workflow steps in parallel, with coordination via distributed queue and checkpoint store.

These distributed methods are the core primitives for building scalable, fault-tolerant workflow systems in Floxide.

Traits§

WorkItem
Trait for a workflow work item.
Workflow
Trait for a workflow.