How nikilster/clawflows works
1. What this repo is
ClawFlows is a workflow distribution and lifecycle system for OpenClaw. Its core artifact is a plain-text WORKFLOW.md file per workflow, with metadata like name and schedule plus the instructions the agent should follow.
2. Primary storage layout
The repository separates workflows into three tiers:
- workflows/available/community: curated, shipped workflows
- workflows/custom: user-authored workflows
- workflows/enabled: the active set the agent should currently load
This separation is the main architectural boundary between “catalog,” “local edits,” and “runtime activation.”
3. Workflow lifecycle
The lifecycle is: discover a workflow in available or create one in custom, validate it, enable it, and then let the agent execute it either on schedule or on demand. Enabled workflows are meant to be visible to the agent without restarting.
4. CLI is the control plane
The system/cli/clawflows command is the operational entry point. It manages listing, enabling/disabling, creating, editing, opening, validating, running, sharing, backup/restore, updates, agent sync, and uninstall. In architectural terms, the CLI is the control layer that reads and mutates the workflow directories and local state.
5. Agent integration boundary
system/AGENT.md and the sync-agent command indicate a second integration path: the repo updates the agent’s own workflow reference list so OpenClaw can discover enabled workflows. That means ClawFlows is not just a file store; it actively propagates workflow availability into the agent environment.
6. Execution model
Workflows are driven by schedule metadata inside WORKFLOW.md rather than by code in this repo. The system is designed for both scheduled autopilot execution and explicit manual runs via clawflows run <name>. The repo therefore acts as a declarative workflow registry more than a traditional application server.
7. Dashboard subsystem
system/dashboard/server.js plus template.html implement a small local web dashboard. Its role is observational and management-oriented: visualize workflow state, not execute workflows. The .dashboard-state file suggests persisted UI/runtime state for that dashboard.
8. Installation and bootstrap
system/install.sh is the bootstrap path for local setup, wiring the CLI, dashboard, and agent integration into the user’s environment. The README’s curl-to-bash install flow makes this repo effectively a self-installing toolchain rather than a library.
9. Community contribution pipeline
community-submissions is a staging area for contributed workflows, while workflows/available/community is the published catalog. The repo’s docs and submit command imply a review-and-merge workflow where community content is prepared, tested, and then promoted into the shipped set.
10. Tests as the main safety net
The test suite is Bats-based (tests/bats, tests/core, tests/edge_cases, tests/persistence, tests/sync, tests/workflows). It covers install behavior, directory discovery, enable/disable semantics, validation, malformed YAML, broken symlinks, persistence backup/restore, and dashboard behavior. This is important architecturally because the repo depends on filesystem conventions and text parsing, so correctness is enforced through integration-style shell tests rather than a compiled runtime.
11. External dependencies and tooling
The project is shell-first, with a small Node-based dashboard component. The vendored Bats libraries and Git submodule markers show that test tooling is part of the repo’s operational model. Git is also central: workflows are versioned, shareable, and updateable through pulls and submissions.
12. End-to-end data flow
A typical flow is: workflow definition lands in available or custom → CLI validates and enables it → enabled state is synced to the agent → scheduler or user triggers execution → logs and dashboard reflect results → workflows can later be backed up, restored, or updated from the upstream repo. That loop is the core architecture to diagram.
Main entry points: clawflows clawflows · server.js Dashboard server · install.sh Install · WORKFLOW.md WORKFLOW.md
Components 16
Workflow storage
Declarative workflow registry split into catalog, local edits, and active runtime set
- Community catalog · Shipped workflows available for discovery and enablement
workflows/available/community - Custom workflows · User-authored workflow definitions maintained locally
workflows/custom - Enabled set · Workflows currently activated for the agent to load
workflows/enabled - WORKFLOW.md · Plain-text workflow definition with metadata, schedule, and instructions
workflows/available/community/activate-focus-mode/WORKFLOW.md
Control plane
CLI, bootstrap, and agent sync surfaces that manage workflow lifecycle
- clawflows · Primary command entrypoint for listing, validating, enabling, running, syncing, and managing workflows
system/cli/clawflows - Install · Local setup path that wires CLI, dashboard, and agent integration
system/install.sh - Agent spec · Reference surface used to propagate enabled workflows into the agent environment
system/AGENT.md - Scheduler · Schedule-driven execution model documented for workflow runs
system/scheduler.md
Dashboard
Local observability and state for workflow management
- Dashboard server · Local web UI for observing and managing workflow state
system/dashboard/server.js - Dashboard UI · Rendered dashboard view for workflow status and management
system/dashboard/template.html - UI state · Stored dashboard/runtime state
system/.dashboard-state
Community pipeline
Staging and publication path for contributed workflows
- Submissions · Incoming community workflow contributions before publication
community-submissions
Docs
Operator and contributor guidance
Tests
Bats-based integration and edge-case coverage
- Bats suite · Shell-based tests covering install, lifecycle, persistence, sync, and edge cases
tests
Connections 21
- clawflows → Community catalog: discover · Lists and inspects shipped workflows from the catalog
- clawflows → Custom workflows: create/edit · Creates and mutates user-authored workflows
- clawflows → Enabled set: enable/disable · Moves workflows into and out of the active runtime set
- clawflows → WORKFLOW.md: validate/run · Parses workflow definitions and executes selected workflows
- clawflows → Agent spec: sync-agent · Propagates enabled workflow references into the agent environment
- clawflows → Dashboard server: status · Feeds dashboard-oriented management and observability
- Install → clawflows: install · Bootstraps the CLI into the local environment
- Install → Dashboard server: wire up · Sets up local dashboard support
- Install → Agent spec: configure · Initializes agent integration hooks
- Dashboard server → Dashboard UI: render · Serves the dashboard HTML UI
- Dashboard server → UI state: persist · Reads and writes local dashboard state
- Community catalog → WORKFLOW.md: contains · Catalog entries are workflow directories containing a WORKFLOW.md
- Custom workflows → WORKFLOW.md: contains · Custom workflows are also stored as WORKFLOW.md directories
- Enabled set → WORKFLOW.md: links to · Enabled set points at active workflow definitions
- Submissions → Community catalog: promote · Reviewed community submissions are merged into the shipped catalog
- Creating → Submissions: author · Documents how contributors create workflow submissions
- Merging → Submissions: review · Documents the merge path from staging into published workflows
- Updates → clawflows: operate · Documents update and lifecycle operations for the toolchain
- Bats suite → clawflows: verify · Exercises CLI lifecycle and filesystem behavior
- Bats suite → Dashboard server: verify · Covers dashboard behavior and persistence
- Bats suite → Install: verify · Checks installation/bootstrap behavior