This document provides detailed examples of the package structure for components, modules, and workflows.
A component package is a self-contained, reusable component with its own configuration and optional test manifest.
components/
title_uppercase/
component.yaml
kind: component
name: title_uppercase
description: Transforms a title field to uppercase
factory: text_transform
config:
field: title
operation: uppercase
# Optional: standalone execution manifest
run:
manifest:
id: sample-run
data:
title: "hello world"
# Optional: test expectations
test:
expect:
status: success
data:
title: "HELLO WORLD"kind: Must be "component"name: Unique component name (used for registration)description: Human-readable descriptionfactory: Built-in factory name or custom factoryconfig: Configuration passed to the factoryrun.manifest: Optional manifest for standalone executiontest.expect: Optional test expectations
A module package groups multiple components into a reusable workflow module. It can include local components that are only available within this module.
modules/
analyze-document-mod/
module.yaml
components/
local_content_word_count/
component.yaml
kind: module
name: analyze-document-mod
description: Analyzes a document by transforming and counting words
manifest:
id: document-analysis
data:
title: "my first document"
content: "this is example content"
components:
- name: title_uppercase # Global component
scope: global
- name: local_content_word_count # Local component
scope: local
config:
field: content
target_field: word_count
# Optional: test expectations
test:
expect:
status: success
data:
title: "MY FIRST DOCUMENT"
word_count: 4kind: component
name: local_content_word_count
description: Local component for counting words in content field
factory: word_count
config:
field: content
target_field: word_countkind: Must be "module"name: Unique module namedescription: Human-readable descriptionmanifest: Input manifest for module executioncomponents: List of component referencesname: Component name (global or local)scope: "global" (default) or "local"config: Optional component-specific config override
test.expect: Optional test expectations
- Global components: Loaded from workspace
components/directory - Local components: Defined in
modules/<module-name>/components/directory - Local components are prefixed with
@<module-name>/at runtime
A workflow package orchestrates multiple modules into a complete workflow.
workflows/
doc-processor-workflow/
workflow.yaml
kind: workflow
name: doc-processor-workflow
description: Processes documents through multiple analysis modules
modules:
- name: analyze-document-mod
path: analyze-document-mod # Optional: relative or absolute path
- name: another-module
# Optional: test expectations
test:
expect:
status: success
modules:
- id: analyze-document-mod
status: success
data:
title: "MY FIRST DOCUMENT"kind: Must be "workflow"name: Unique workflow namedescription: Human-readable descriptionmodules: List of module package referencesname: Module name (used for lookup)path: Optional path override (defaults toname)
test.expect: Optional test expectationsstatus: Expected workflow statusmodules: Per-module expectations
All package types support testing via the test command:
# Test a component
./workflow-cli test component title_uppercase
# Test a module
./workflow-cli test module analyze-document-mod
# Test a workflow
./workflow-cli test workflow doc-processor-workflowTest expectations support:
- Status validation:
status: successorstatus: failure - Data validation: Partial match on manifest data fields
- Module-level validation: Per-module status and data checks
# Run a standalone component (requires run.manifest)
./workflow-cli run component title_uppercase
# Run a module
./workflow-cli run module analyze-document-mod
# Run a workflow
./workflow-cli run workflow doc-processor-workflow
# Run all workflows in a directory
./workflow-cli run workflow --dir ./workflows/
# Run specific workflows by name
./workflow-cli run workflow --dir ./workflows/ --name doc-processor-workflow# Scaffold a global component
./workflow-cli scaffold component my-component
# Scaffold a module with local components
./workflow-cli scaffold module my-module
# Scaffold a workflow referencing a module
./workflow-cli scaffold workflow my-workflow --module my-module- Component Naming: Use kebab-case for component names
- Local vs Global: Use local components for module-specific logic
- Test Coverage: Add test expectations to all packages
- Documentation: Include descriptions in all package manifests
- Modularity: Keep modules focused on a single responsibility
- Reusability: Extract common components to global scope
Modules can reference other modules by including them in a workflow:
kind: workflow
name: complex-workflow
modules:
- name: preprocessing-module
- name: analysis-module
- name: postprocessing-moduleEach module receives the manifest from the previous module, creating a pipeline.