ADR 013: Optional YAML Support via PyYAML Extra¶
Context¶
Many users and workflow authors prefer YAML for human readability. However, parsing YAML requires third-party dependencies (e.g. PyYAML), which would compromise the engine's core zero-runtime-dependency commitment.
Options Considered¶
- Require PyYAML as a mandatory runtime dependency:
- Tradeoff: Violates the zero-runtime-dependencies promise for users only using JSON or Python programmatic builders.
- Optional extra
orchestration-engine[yaml]with lazy import (Chosen): - Core library remains 100% dependency-free.
- Introduce
load_workflow_from_yamlwhich importsyamllazily on call. - If
yamlis missing, raise a clearOrchestrationErrorinstructing the user to installorchestration-engine[yaml]. - Always parse with
yaml.safe_loadto prevent arbitrary code execution vulnerabilities.
Decision¶
- Add optional dependency
yaml = ["pyyaml>=6.0"]inpyproject.toml. - Provide
load_workflow_from_yamlinloader.py. - Export
load_workflow_from_yamlinorchestration_engine.__all__.
Consequences¶
- Core stays dependency-free; users wanting YAML install the optional extra safely.
- Safe YAML parsing prevents deserialization security attacks.