YAML workflow engine — parses, validates, and executes step-based workflows with pluggable Action / Evaluator / Predicate / Iterable methods.
Project description
YAML Workflow Framework
YAML workflow engine — parses, validates, and executes step-based workflows with pluggable Action / Evaluator / Predicate / Iterable methods.
Overview
vcti-ywf is the workflow engine behind VCollab Insights. A workflow is a
directory of YAML files — about.yaml, variables/main.yaml,
steps/main.yaml — that describe an automated process declaratively. The
engine parses those files (with support for !var, !include, and !module
tags), resolves variables, evaluates control-flow blocks (if-else,
for-each, try-except), and dispatches each step to a registered method
plugin.
Method plugins come in four typed shapes — Action (side-effecting),
Evaluator (produces a value), Predicate (boolean test), and
Iterable (yields keys for for-each). A built-in stdlib package ships
common methods; downstream consumers add domain-specific methods (CAE data
extraction, plotting, report generation) by registering their own classes.
Workflow YAML is evaluated against a sandboxed Context by default —
- evaluator: evaluate expressions go through simpleeval, and
{{ var }} template interpolation goes through Jinja2's
SandboxedEnvironment. Engine-internal context variables
(__runtime__ and friends) are filtered from author-facing scope.
Hosts that run fully-trusted YAML can opt into raw eval or the
full Jinja2 environment by constructing the Context themselves and
passing it to Runner.run().
Installation
pip install vcti-ywf>=3.0.1
In requirements.txt
vcti-ywf>=3.0.1
In pyproject.toml dependencies
dependencies = [
"vcti-ywf>=3.0.1",
]
Quick Start
Run a workflow from Python:
from pathlib import Path
from vcti.ywf import Runner, Workflow
workflow = Workflow(Path("path/to/my-workflow"))
workflow.read_all()
result = Runner(workflow).run({"input_file": "data/model.h5"})
print(result.return_value) # top-level block's value
print(result.outputs) # declared outputs read from final context
For monitoring or debugging, build an ObservableContext, attach
observers, and pass it to run():
from vcti.ywf import ObservableContext, Runner
from vcti.ywf.execution.observers.history_observer import HistoryObserver
context = ObservableContext()
context.add_observer(HistoryObserver())
Runner(workflow).run({"input_file": "data/model.h5"}, context)
A minimal workflow directory looks like:
my-workflow/
├── about.yaml # title, description, tags, images
├── variables/
│ └── main.yaml # inputs + outputs declarations
└── steps/
└── main.yaml # execution steps
variables/main.yaml declares the workflow's external contract —
inputs (supplied by the caller) and outputs (produced by the run):
inputs:
- name: input_file
type: input_file_path
description: Path to the simulation results
default: data/sample.h5
outputs:
- name: mode_count
type: int
default: 0
description: Number of modes extracted.
steps/main.yaml lists actions, evaluators, predicates, and iterables —
each is a YAML mapping keyed by its method name. The data-scope actions
illustrate the typical pattern:
- action: define_data_scope
name: simulation
type: paths-group
- action: add_path_source
path: !var input_file
format: hdf5-file
label: results
- action: load_data_scope
- if:
predicate: is_data_scope_valid
then:
- action: log_message
message: "Data scope ready."
else:
- action: log_message
log_level: error
message: "Data scope failed to load."
Documentation
User guides — start here:
- docs/tutorial.md — walk through the greeting workflow end-to-end with the Python API, then expand to control-flow blocks and data-scope actions.
- docs/yaml-reference.md — exhaustive field reference for
about.yaml,variables/main.yaml,steps/main.yaml, and every step type (action / evaluator / predicate / iterable / if-else / for-each / try-except). - docs/yaml-tags.md —
!var,!include, and!modulesemantics with scoping rules. - docs/plugins.md — author guide for custom workflow methods.
- docs/api.md — autogenerated API reference.
Developer reference — engine concepts subpackage by subpackage:
- docs/developer/README.md — index for the developer documentation.
- docs/developer/core/workflow-structure.md — how a workflow is organised on disk.
- docs/developer/core/variables.md —
inputs:/outputs:sections, host-facing helpers. - docs/developer/core/runtime.md —
Runtime,Runner,RunResult, caller-supplied context. - docs/developer/core/execution-context.md — the sandboxed
Context, trust posture, custom Jinja2 filters. - docs/developer/core/methods.md — method registry, dispatchers, plugin authoring.
- docs/developer/core/flow.md —
Blockvariants and dispatch. - docs/developer/core/dsl.md —
Value/Property,ContextBase, executables. - docs/developer/core/stdlib.md — built-in actions, evaluators, predicates, iterables.
Internals — for engine maintainers and tool builders:
- docs/developer/internals/overview.md — source-location tracking, observation, and control as three interlocking pieces.
- docs/developer/internals/dsl.md —
MetadataMixin,Source/StepMetadata, the_metafield. - docs/developer/internals/yaml-loader.md — the three loader classes,
subdir_dir/current_fileinvariants,!var/!include/!moduleimplementation. - docs/developer/internals/execution-observing.md —
ObservableContext, the event hierarchy, built-in observers, theExecutionController. - docs/developer/internals/debug-command.md — how to build a step-by-step debugger on top of the controller + observer pair.
Dependencies
Third-party:
- pydantic (>=2.0) — model validation
- PyYAML (>=6.0) and pyyaml-include (>=2.0) — YAML parsing with
!include - Jinja2 (>=3.0) —
{{ var }}interpolation inProperty[str]fields (sandboxed viaSandboxedEnvironmentin the defaultContext) - simpleeval (>=1.0) — sandboxed expression evaluator for
- evaluator: evaluate - NumPy (>=1.24) — array handling via
vcti-array-tree - pandas (>=2.0) — CSV reading in the
read_fileevaluator and DataFrame iteration inlist_items
VCollab platform packages:
- vcti-array-tree — hierarchical array data
- vcti-config — environment-variable decoding (
get_envevaluator) - vcti-data-scope —
DataScope/PathsGrouptypes used by the data-scope actions - vcti-enum — value-generated enums + Pydantic helpers
- vcti-error — error codes
- vcti-fileloader — pluggable loader registry
- vcti-logging — logger
- vcti-lookup —
Rule-based attribute filtering - vcti-path — safe path & filename validation
- vcti-path-format, vcti-path-format-descriptors — file-format identification
- vcti-path-tree — directory tree scanning
Optional extras:
vcti-ywf[hdf5]— pulls in vcti-fileloader-hdf5, whichRunnerauto-registers if installed.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vcti_ywf-3.0.1.tar.gz.
File metadata
- Download URL: vcti_ywf-3.0.1.tar.gz
- Upload date:
- Size: 136.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1e4378ebe2159d414054acd99defcb2caa7f73beeaab2642692644726c90ea5
|
|
| MD5 |
233e717d5f1dfacc0af76738ca06abe9
|
|
| BLAKE2b-256 |
a168d9f112e189cbb3fc65623c07dcb4f632da8356ad912643bff268786757b8
|
Provenance
The following attestation bundles were made for vcti_ywf-3.0.1.tar.gz:
Publisher:
release.yml on vcollab/vcti-python-ywf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vcti_ywf-3.0.1.tar.gz -
Subject digest:
e1e4378ebe2159d414054acd99defcb2caa7f73beeaab2642692644726c90ea5 - Sigstore transparency entry: 1626549099
- Sigstore integration time:
-
Permalink:
vcollab/vcti-python-ywf@5ba5d554bb06c8106d5be70a0a4612a90d6fe2af -
Branch / Tag:
refs/tags/v3.0.1 - Owner: https://github.com/vcollab
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5ba5d554bb06c8106d5be70a0a4612a90d6fe2af -
Trigger Event:
push
-
Statement type:
File details
Details for the file vcti_ywf-3.0.1-py3-none-any.whl.
File metadata
- Download URL: vcti_ywf-3.0.1-py3-none-any.whl
- Upload date:
- Size: 107.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9d3b759f97d5a645993f0a0b8af0ef8700aeceb0efe21ef842b661fc3b9e507
|
|
| MD5 |
0d43ac3be6e1cb6bb90da09c20a9e3ca
|
|
| BLAKE2b-256 |
2a01407cd86e366ad2f55c506910bff484ffa0e880ad73b8e34e7a69b13a1af6
|
Provenance
The following attestation bundles were made for vcti_ywf-3.0.1-py3-none-any.whl:
Publisher:
release.yml on vcollab/vcti-python-ywf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vcti_ywf-3.0.1-py3-none-any.whl -
Subject digest:
a9d3b759f97d5a645993f0a0b8af0ef8700aeceb0efe21ef842b661fc3b9e507 - Sigstore transparency entry: 1626549174
- Sigstore integration time:
-
Permalink:
vcollab/vcti-python-ywf@5ba5d554bb06c8106d5be70a0a4612a90d6fe2af -
Branch / Tag:
refs/tags/v3.0.1 - Owner: https://github.com/vcollab
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5ba5d554bb06c8106d5be70a0a4612a90d6fe2af -
Trigger Event:
push
-
Statement type: