Skip to Content
Asset Model

Asset Model

LightFlow assets are versioned Rust files. The invariant is simple: metadata and definition live together.

Why Not Sidecar JSON

Sidecar files create synchronization problems. A single Rust asset file can be copied, deleted, reviewed, and modified by an agent without chasing a registry.

Directories

Project assets:

lightflow/models/*.rs lightflow/nodes/*.rs lightflow/compositions/*.rs lightflow/workflows/*.rs

Built-ins:

src/builtins/nodes/*.rs src/builtins/compositions/*.rs src/builtins/workflows/*.rs

Metadata

pub const META: AssetMeta = AssetMeta { id: "workflow.text_plan", title: "Text Plan", kind: AssetKind::Workflow, description: "Drafts a concise plan from a text prompt through CortexFS.", stability: Stability::Draft, };

The declared kind must match the directory being scanned.

Workflow Definition

pub fn define() -> WorkflowDef { workflow(META.id) .input_schema("schemas/text_plan.input.json") .output_schema("schemas/text_plan.output.json") .required_model("llm.planner") .api_step("draft", "node.llm_prompt", "openai.chat") .openai_chat_input("llm.planner", "prompt") }

The parser only supports a narrow builder chain so LightFlow can extract definitions without executing arbitrary Rust code.

Last updated on
MIT OR Apache-2.0 Licensed.