# alpha-unito/streamflow architecture

> Architecture diagram of the GitHub repository alpha-unito/streamflow, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alpha-unito/streamflow
- Repository: https://github.com/alpha-unito/streamflow

## Overview

StreamFlow is a container-native workflow management system for running concurrent, communicating tasks across multi-container, cloud, and HPC environments. The principal workflow is to invoke the CLI with a configuration, parse and translate a CWL workflow, execute its steps using scheduling, deployment, and data-transfer services, then persist results and provenance. Its context assembles pluggable runtime managers; SQLite, recovery, and provenance support durable and restartable runs. The README documents broad CWL compatibility and Kubernetes/Helm deployment. Some subsystem links below rely on SOURCE INDEX references or README statements rather than inspected implementations.

Main entry points: [`streamflow/main.py`](https://github.com/alpha-unito/streamflow/blob/master/streamflow/main.py) (CLI orchestration), [`streamflow/workflow/step.py`](https://github.com/alpha-unito/streamflow/blob/master/streamflow/workflow/step.py) (Step execution), [`streamflow/core/context.py`](https://github.com/alpha-unito/streamflow/blob/master/streamflow/core/context.py) (Runtime context), [`streamflow/cwl/main.py`](https://github.com/alpha-unito/streamflow/blob/master/streamflow/cwl/main.py) (CWL entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and configuration"]
  node_cli["CLI orchestration<br/>[main.py]"]
  node_config["Config validation<br/>[validator.py]"]
  node_parser["Plugin parser<br/>[parser.py]"]
end

subgraph group_cwl["CWL workflow model"]
  node_cwl_adapter["CWL entry<br/>[main.py]"]
  node_cwl_translate["CWL translation<br/>[translator.py]"]
  node_cwl_steps["CWL step handling<br/>[step.py]"]
end

subgraph group_runtime["Workflow runtime"]
  node_workflow_exec["Workflow executor<br/>[executor.py]"]
  node_workflow_steps["Step execution<br/>[step.py]"]
  node_tokens["Workflow tokens<br/>[token.py]"]
  node_context["Runtime context<br/>[context.py]"]
end

subgraph group_infra["Execution infrastructure"]
  node_scheduler["Task scheduling<br/>[scheduler.py]"]
  node_deployments["Deployment management<br/>[manager.py]"]
  node_connectors["Infrastructure connectors"]
  node_data["Data management<br/>[manager.py]"]
end

subgraph group_state["State and recovery"]
  node_database[("SQLite persistence<br/>[sqlite.py]")]
  node_recovery["Failure recovery<br/>[failure_manager.py]"]
  node_provenance["Run provenance<br/>[run_crate.py]"]
end

node_user(("Workflow operator"))
node_results["Workflow results"]

node_user -->|"runs configuration"| node_cli
node_cli -->|"validates config"| node_config
node_cli -->|"loads plugins"| node_parser
node_cli -->|"starts CWL"| node_cwl_adapter
node_cwl_adapter -->|"translates workflow"| node_cwl_translate
node_cwl_translate -->|"builds steps"| node_cwl_steps
node_cwl_adapter -->|"creates executor"| node_workflow_exec
node_workflow_exec -.->|"runs steps"| node_workflow_steps
node_workflow_steps -->|"passes tokens"| node_tokens
node_context -->|"constructs manager"| node_scheduler
node_context -->|"constructs manager"| node_deployments
node_context -->|"constructs manager"| node_data
node_workflow_steps -->|"requests scheduling"| node_scheduler
node_scheduler -->|"selects targets"| node_deployments
node_deployments -->|"uses connectors"| node_connectors
node_workflow_steps -->|"uses data services"| node_data
node_workflow_steps -->|"persists workflow state"| node_database
node_workflow_steps -->|"supports recovery"| node_recovery
node_cli -->|"records provenance"| node_provenance
node_cli -->|"produces outputs"| node_results

click node_cli "https://github.com/alpha-unito/streamflow/blob/master/streamflow/main.py"
click node_config "https://github.com/alpha-unito/streamflow/blob/master/streamflow/config/validator.py"
click node_parser "https://github.com/alpha-unito/streamflow/blob/master/streamflow/parser.py"
click node_cwl_adapter "https://github.com/alpha-unito/streamflow/blob/master/streamflow/cwl/main.py"
click node_cwl_translate "https://github.com/alpha-unito/streamflow/blob/master/streamflow/cwl/translator.py"
click node_cwl_steps "https://github.com/alpha-unito/streamflow/blob/master/streamflow/cwl/step.py"
click node_workflow_exec "https://github.com/alpha-unito/streamflow/blob/master/streamflow/workflow/executor.py"
click node_workflow_steps "https://github.com/alpha-unito/streamflow/blob/master/streamflow/workflow/step.py"
click node_tokens "https://github.com/alpha-unito/streamflow/blob/master/streamflow/workflow/token.py"
click node_context "https://github.com/alpha-unito/streamflow/blob/master/streamflow/core/context.py"
click node_scheduler "https://github.com/alpha-unito/streamflow/blob/master/streamflow/scheduling/scheduler.py"
click node_deployments "https://github.com/alpha-unito/streamflow/blob/master/streamflow/deployment/manager.py"
click node_connectors "https://github.com/alpha-unito/streamflow/tree/master/streamflow/deployment/connector"
click node_data "https://github.com/alpha-unito/streamflow/blob/master/streamflow/data/manager.py"
click node_database "https://github.com/alpha-unito/streamflow/blob/master/streamflow/persistence/sqlite.py"
click node_recovery "https://github.com/alpha-unito/streamflow/blob/master/streamflow/recovery/failure_manager.py"
click node_provenance "https://github.com/alpha-unito/streamflow/blob/master/streamflow/provenance/run_crate.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_config,node_parser toneBlue
class node_cwl_adapter,node_cwl_translate,node_cwl_steps toneAmber
class node_workflow_exec,node_workflow_steps,node_tokens,node_context toneMint
class node_scheduler,node_deployments,node_connectors,node_data toneRose
class node_database,node_recovery,node_provenance,node_user,node_results toneIndigo
```

## Components

### Entry and configuration

- [CLI orchestration](https://github.com/alpha-unito/streamflow/blob/master/streamflow/main.py): `streamflow/main.py`
- [Config validation](https://github.com/alpha-unito/streamflow/blob/master/streamflow/config/validator.py): `streamflow/config/validator.py`
- [Plugin parser](https://github.com/alpha-unito/streamflow/blob/master/streamflow/parser.py): `streamflow/parser.py`

### CWL workflow model

- [CWL entry](https://github.com/alpha-unito/streamflow/blob/master/streamflow/cwl/main.py): `streamflow/cwl/main.py`
- [CWL translation](https://github.com/alpha-unito/streamflow/blob/master/streamflow/cwl/translator.py): `streamflow/cwl/translator.py`
- [CWL step handling](https://github.com/alpha-unito/streamflow/blob/master/streamflow/cwl/step.py): `streamflow/cwl/step.py`

### Workflow runtime

- [Workflow executor](https://github.com/alpha-unito/streamflow/blob/master/streamflow/workflow/executor.py): `streamflow/workflow/executor.py`
- [Step execution](https://github.com/alpha-unito/streamflow/blob/master/streamflow/workflow/step.py): `streamflow/workflow/step.py`
- [Workflow tokens](https://github.com/alpha-unito/streamflow/blob/master/streamflow/workflow/token.py): `streamflow/workflow/token.py`
- [Runtime context](https://github.com/alpha-unito/streamflow/blob/master/streamflow/core/context.py): `streamflow/core/context.py`

### Execution infrastructure

- [Task scheduling](https://github.com/alpha-unito/streamflow/blob/master/streamflow/scheduling/scheduler.py): `streamflow/scheduling/scheduler.py`
- [Deployment management](https://github.com/alpha-unito/streamflow/blob/master/streamflow/deployment/manager.py): `streamflow/deployment/manager.py`
- [Infrastructure connectors](https://github.com/alpha-unito/streamflow/tree/master/streamflow/deployment/connector): `streamflow/deployment/connector`
- [Data management](https://github.com/alpha-unito/streamflow/blob/master/streamflow/data/manager.py): `streamflow/data/manager.py`

### State and recovery

- [SQLite persistence](https://github.com/alpha-unito/streamflow/blob/master/streamflow/persistence/sqlite.py): `streamflow/persistence/sqlite.py`
- [Failure recovery](https://github.com/alpha-unito/streamflow/blob/master/streamflow/recovery/failure_manager.py): `streamflow/recovery/failure_manager.py`
- [Run provenance](https://github.com/alpha-unito/streamflow/blob/master/streamflow/provenance/run_crate.py): `streamflow/provenance/run_crate.py`

### Other components

- **Workflow operator**
- **Workflow results**

## Connections

- Workflow operator → CLI orchestration: runs configuration (evidence: `README.md`)
- CLI orchestration → Config validation: validates config (evidence: `streamflow/main.py`)
- CLI orchestration → Plugin parser: loads plugins (evidence: `streamflow/main.py`)
- CLI orchestration → CWL entry: starts CWL (evidence: `streamflow/main.py`)
- CWL entry → CWL translation: translates workflow (evidence: `streamflow/cwl/main.py`)
- CWL translation → CWL step handling: builds steps (evidence: `streamflow/cwl/translator.py`)
- CWL entry → Workflow executor: creates executor (evidence: `streamflow/cwl/main.py`)
- Workflow executor → Step execution: runs steps
- Step execution → Workflow tokens: passes tokens (evidence: `streamflow/workflow/step.py`)
- Runtime context → Task scheduling: constructs manager (evidence: `streamflow/core/context.py`)
- Runtime context → Deployment management: constructs manager (evidence: `streamflow/core/context.py`)
- Runtime context → Data management: constructs manager (evidence: `streamflow/core/context.py`)
- Step execution → Task scheduling: requests scheduling (evidence: `streamflow/workflow/step.py`)
- Task scheduling → Deployment management: selects targets (evidence: `streamflow/scheduling/scheduler.py`)
- Deployment management → Infrastructure connectors: uses connectors (evidence: `streamflow/deployment/manager.py`)
- Step execution → Data management: uses data services (evidence: `streamflow/workflow/step.py`)
- Step execution → SQLite persistence: persists workflow state (evidence: `streamflow/workflow/step.py`)
- Step execution → Failure recovery: supports recovery (evidence: `streamflow/workflow/step.py`)
- CLI orchestration → Run provenance: records provenance (evidence: `streamflow/main.py`)
- CLI orchestration → Workflow results: produces outputs (evidence: `README.md`)
