CATLX — Workflow Engine
This skill owns the execution core of CATLX. Every action — from a file rename to a multi-step research
pipeline — is a workflow: a Directed Acyclic Graph (DAG) of atomic steps. The WFE provides scheduling,
parallel execution, checkpointing, replay, rollback, and recovery as first-class features.
Canonical detail: ../knowledge/references/workflow-engine.md. DSL example:
../workflows/summarize-clipboard.yaml and ../workflows/summarize-clipboard.yaml. Load on demand.
Purpose
Model and run any task as a schedulable, resumable, replayable, and safely undoable DAG of steps.
When to activate
- User asks how CATLX plans/runs a multi-step task, or asks to schedule/define a workflow.
- Designing step dependencies, retries, timeouts, or rollback.
- Debugging a failed/interrupted run or resuming from a checkpoint.
- Defining a workflow in the YAML DSL.
What this skill handles
- DAG execution model — Nodes (steps) + directed Edges (dependencies). A node runs only when all parents
succeed; independent nodes run in parallel up to the workflow-parallelism limit. Each node has a step ID,
module to invoke, input (static or derived from parent outputs), timeout, retry policy.
- Scheduling (four modes) — Immediate (now, synchronous), Deferred (time/cron), Event-Driven (trigger
fires), Background (lowest priority, yields CPU).
- Checkpointing — each step writes a checkpoint to
workflows.db (step ID, completion time, output hash,
duration). Resume from last checkpoint after interruption; high-cost ops always checkpoint.
- Replay — with identical or modified inputs; optionally reuse cached deterministic outputs; primary
debugging tool.
- Rollback — steps declare inverse operations; the rollback log applies inverses in reverse order to
restore pre-workflow state; offered on failure, manual from dashboard.
- Recovery & resilience — step-level retry (default 3 retries, 2s/4s/8s backoff), provider failover,
checkpoint resume, Saga pattern (compensating transactions for distributed workflows), workflow isolation.
- State machines — for complex interactive workflows: named states, transition rules, entry/exit actions,
terminal state. (Voice: Idle → Listening → Processing → Executing → Feedback → Idle.)
- Workflow definition format — YAML DSL in
/workflows/definitions/; see ../workflows/summarize-clipboard.yaml.
Requirements / constraints
- R8 (replay safety): every workflow checkpointed, replayable, rollbackable.
- R2: parallelism limit from the CapabilityMap.
- R5: ExecutionPlan validated by the Permission Router (capability check per step) before execution.
- No cycles in a DAG; all dependencies present; all modules available (validate before run).
Canonical knowledge it reads
../knowledge/references/workflow-engine.md · ../knowledge/references/runtime-lifecycle.md ·
../knowledge/references/data-registries.md · ../knowledge/rules/architectural-rules.md.
Delegation
- Parallelism limit / scheduling by tier → delegate to
catlx-capability-routing
(skill({ name: "catlx-capability-routing" })).
- Steps that call AI → delegate to
catlx-ai-provider (skill({ name: "catlx-ai-provider" })).
- Steps that read/write memory → delegate to
catlx-memory (skill({ name: "catlx-memory" })).
- Steps that act on the desktop / file ops → delegate to
catlx-desktop-control
(skill({ name: "catlx-desktop-control" })).
- Step permission validation → delegate to
catlx-security (skill({ name: "catlx-security" })).
- Container-hosted steps (Saga / distributed) → delegate to
catlx-docker
(skill({ name: "catlx-docker" })).
- Crash resume / checkpoint restore → delegate to
catlx-recovery
(skill({ name: "catlx-recovery" })).
- Telemetry of runs → delegate to
catlx-telemetry (skill({ name: "catlx-telemetry" })).
Edge cases & warnings
- Cycles: a DAG must have no cycles; validate before executing.
- Failure partway: offer rollback; if accepted, apply inverses in reverse order.
- Distributed (Docker) workflows: use Saga compensating transactions for eventual consistency.
- Deterministic replay: only reuse cached output for steps proven deterministic.
- Workflow isolation: a failure in one workflow must not corrupt another.
Component lifecycle policy (reuse → install → adapt → create)
NEVER create a new component as the default. Before building/creating anything (a sub-skill, dependency,
reference, workflow, helper, adapter, or template), check, in order:
- Reuse an existing local component (resolve aliases/equivalent capabilities first) — reuse, don't rebuild.
- Use an already-registered component from the registry.
- Install a suitable existing, trusted, supported component → validate → register → connect to the graph → use.
- Adapt an existing compatible component via a small persistent adapter/wrapper instead of re-creating it.
- Create only as last resort — then make it permanent immediately: stable id, canonical location, register,
add to the capability index + dependency graph, add provenance, use, and allow future reuse.
- Never reorganise/recreate already-generated components (no
Skill X 2 / new / temp variants); extend the
existing one. Never create a second competing knowledge source; connect back to the canonical knowledge/ layer.
Promote any reusable artifact out of /tmp/scratch into the permanent ecosystem.
Full policy: ../knowledge/rules/component-lifecycle.md.
Source / provenance
- Source: PART IX §9.1–9.9 (overview, DAG model, scheduling, checkpointing, replay, rollback, recovery &
resilience, state machines, workflow definition format/DSL example).
- Inferred: none; DSL example preserved exactly in
../workflows/summarize-clipboard.yaml.
1---2name: catlx-workflow-engine3description: CATLX — Workflow Engine4---56# CATLX — Workflow Engine78This skill owns the **execution core** of CATLX. Every action — from a file rename to a multi-step research9pipeline — is a workflow: a **Directed Acyclic Graph (DAG)** of atomic steps. The WFE provides scheduling,10parallel execution, checkpointing, replay, rollback, and recovery as first-class features.1112> Canonical detail: `../knowledge/references/workflow-engine.md`. DSL example:13> `../workflows/summarize-clipboard.yaml` and `../workflows/summarize-clipboard.yaml`. Load on demand.1415---1617## Purpose1819Model and run any task as a schedulable, resumable, replayable, and safely undoable DAG of steps.2021## When to activate2223- User asks how CATLX plans/runs a multi-step task, or asks to schedule/define a workflow.24- Designing step dependencies, retries, timeouts, or rollback.25- Debugging a failed/interrupted run or resuming from a checkpoint.26- Defining a workflow in the YAML DSL.2728## What this skill handles29301. **DAG execution model** — Nodes (steps) + directed Edges (dependencies). A node runs only when all parents31 succeed; independent nodes run in parallel up to the workflow-parallelism limit. Each node has a step ID,32 module to invoke, input (static or derived from parent outputs), timeout, retry policy.332. **Scheduling (four modes)** — Immediate (now, synchronous), Deferred (time/cron), Event-Driven (trigger34 fires), Background (lowest priority, yields CPU).353. **Checkpointing** — each step writes a checkpoint to `workflows.db` (step ID, completion time, output hash,36 duration). Resume from last checkpoint after interruption; high-cost ops always checkpoint.374. **Replay** — with identical or modified inputs; optionally reuse cached deterministic outputs; primary38 debugging tool.395. **Rollback** — steps declare inverse operations; the rollback log applies inverses in reverse order to40 restore pre-workflow state; offered on failure, manual from dashboard.416. **Recovery & resilience** — step-level retry (default 3 retries, 2s/4s/8s backoff), provider failover,42 checkpoint resume, Saga pattern (compensating transactions for distributed workflows), workflow isolation.437. **State machines** — for complex interactive workflows: named states, transition rules, entry/exit actions,44 terminal state. (Voice: Idle → Listening → Processing → Executing → Feedback → Idle.)458. **Workflow definition format** — YAML DSL in `/workflows/definitions/`; see `../workflows/summarize-clipboard.yaml`.4647## Requirements / constraints4849- **R8 (replay safety):** every workflow checkpointed, replayable, rollbackable.50- **R2:** parallelism limit from the CapabilityMap.51- **R5:** ExecutionPlan validated by the Permission Router (capability check per step) before execution.52- No cycles in a DAG; all dependencies present; all modules available (validate before run).5354## Canonical knowledge it reads5556`../knowledge/references/workflow-engine.md` · `../knowledge/references/runtime-lifecycle.md` ·57`../knowledge/references/data-registries.md` · `../knowledge/rules/architectural-rules.md`.5859## Delegation6061- **Parallelism limit / scheduling by tier** → delegate to `catlx-capability-routing`62 (`skill({ name: "catlx-capability-routing" })`).63- **Steps that call AI** → delegate to `catlx-ai-provider` (`skill({ name: "catlx-ai-provider" })`).64- **Steps that read/write memory** → delegate to `catlx-memory` (`skill({ name: "catlx-memory" })`).65- **Steps that act on the desktop / file ops** → delegate to `catlx-desktop-control`66 (`skill({ name: "catlx-desktop-control" })`).67- **Step permission validation** → delegate to `catlx-security` (`skill({ name: "catlx-security" })`).68- **Container-hosted steps (Saga / distributed)** → delegate to `catlx-docker`69 (`skill({ name: "catlx-docker" })`).70- **Crash resume / checkpoint restore** → delegate to `catlx-recovery`71 (`skill({ name: "catlx-recovery" })`).72- **Telemetry of runs** → delegate to `catlx-telemetry` (`skill({ name: "catlx-telemetry" })`).7374## Edge cases & warnings7576- **Cycles:** a DAG must have no cycles; validate before executing.77- **Failure partway:** offer rollback; if accepted, apply inverses in reverse order.78- **Distributed (Docker) workflows:** use Saga compensating transactions for eventual consistency.79- **Deterministic replay:** only reuse cached output for steps proven deterministic.80- **Workflow isolation:** a failure in one workflow must not corrupt another.8182## Component lifecycle policy (reuse → install → adapt → create)8384**NEVER create a new component as the default.** Before building/creating anything (a sub-skill, dependency,85reference, workflow, helper, adapter, or template), check, in order:861. **Reuse** an existing local component (resolve aliases/equivalent capabilities first) — reuse, don't rebuild.872. **Use** an already-registered component from the registry.883. **Install** a suitable existing, trusted, supported component → validate → register → connect to the graph → use.894. **Adapt** an existing compatible component via a small persistent adapter/wrapper instead of re-creating it.905. **Create only as last resort** — then make it permanent immediately: stable id, canonical location, register,91 add to the capability index + dependency graph, add provenance, use, and allow future reuse.926. Never reorganise/recreate already-generated components (no `Skill X 2` / `new` / `temp` variants); extend the93 existing one. Never create a second competing knowledge source; connect back to the canonical `knowledge/` layer.94 Promote any reusable artifact out of `/tmp`/scratch into the permanent ecosystem.9596> Full policy: `../knowledge/rules/component-lifecycle.md`.9798## Source / provenance99100- **Source:** PART IX §9.1–9.9 (overview, DAG model, scheduling, checkpointing, replay, rollback, recovery &101 resilience, state machines, workflow definition format/DSL example).102- **Inferred:** none; DSL example preserved exactly in `../workflows/summarize-clipboard.yaml`.