← 返回 Skills 市场
Workflow Engine
作者
yuyonghao-123
· GitHub ↗
· v0.1.0
· MIT-0
187
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install yuyonghao-workflow-engine
功能描述
DAG-based workflow engine supporting sequential, conditional, and parallel tasks with checkpoint persistence and event-driven execution.
使用说明 (SKILL.md)
Workflow Engine - OpenClaw 工作流编排引擎
版本: 0.1.0
功能: DAG 执行器 + 条件分支 + 并行执行
功能特性
- DAG 编排: 有向无环图工作流定义
- 顺序执行: 简单的线性任务链
- 条件分支: 支持 if/else 条件判断
- 并行执行: 支持并行任务执行
- 状态持久化: 检查点机制支持断点续执行
- 事件驱动: 完整的事件系统
安装
cd skills/workflow-engine
npm install
快速开始
import { WorkflowEngine } from './src/workflow-engine.js';
// 创建工作流引擎
const engine = new WorkflowEngine({
checkpointDir: './checkpoints',
enableCheckpoint: true,
maxConcurrency: 10
});
// 创建顺序工作流
const dag = engine.createSequentialWorkflow('My Workflow', [
{
name: 'Step 1',
execute: async (context) => {
console.log('Executing step 1');
context.data = { value: 42 };
return { success: true };
}
},
{
name: 'Step 2',
execute: async (context) => {
console.log('Executing step 2');
console.log('Data from step 1:', context.data);
return { success: true };
}
}
]);
// 执行工作流
const result = await engine.execute(dag.id, {});
console.log('Workflow completed:', result.status);
API 参考
WorkflowEngine
构造函数
new WorkflowEngine(config)
参数:
config.checkpointDir- 检查点目录(默认:'./checkpoints')config.enableCheckpoint- 启用检查点(默认:true)config.maxConcurrency- 最大并发数(默认:10)
createSequentialWorkflow(name, tasks)
创建顺序工作流
const dag = engine.createSequentialWorkflow('Test', [
{ name: 'Task 1', execute: async () => {} },
{ name: 'Task 2', execute: async () => {} }
]);
execute(workflowId, context)
执行工作流
const result = await engine.execute('workflow-id', {
input: 'data'
});
// 返回: { executionId, status, context, results, duration }
WorkflowDAG
addNode(config)
添加节点
dag.addNode({
id: 'task1',
type: 'task', // 'task' | 'condition' | 'parallel' | 'start' | 'end'
name: 'Task 1',
execute: async (context) => { return { result: 'done' }; },
retry: { count: 3, delay: 1000 },
timeout: 30000
});
addEdge(fromId, toId)
添加边(依赖关系)
dag.addEdge('start', 'task1');
dag.addEdge('task1', 'task2');
topologicalSort()
拓扑排序
const order = dag.topologicalSort();
// 返回: ['start', 'task1', 'task2', 'end']
WorkflowNode
节点类型
start- 开始节点end- 结束节点task- 任务节点condition- 条件节点parallel- 并行节点
节点配置
{
id: 'unique-id',
type: 'task',
name: 'Task Name',
description: 'Task description',
execute: async (context) => { /* 执行逻辑 */ },
retry: { count: 3, delay: 1000 },
timeout: 30000,
metadata: {}
}
示例
条件分支
import WorkflowDAG, { WorkflowNode } from './src/dag.js';
const dag = new WorkflowDAG({ name: 'Conditional' });
dag.addNode({ id: 'start', type: 'start' });
dag.addNode({
id: 'check',
type: 'condition',
condition: (ctx) => ctx.value > 10,
branches: { 'true': 'high', 'false': 'low' }
});
dag.addNode({
id: 'high',
type: 'task',
execute: async () => console.log('High value')
});
dag.addNode({
id: 'low',
type: 'task',
execute: async () => console.log('Low value')
});
dag.addEdge('start', 'check');
dag.addEdge('check', 'high');
dag.addEdge('check', 'low');
并行执行
dag.addNode({ id: 'start', type: 'start' });
dag.addNode({
id: 'parallel',
type: 'parallel',
parallelTasks: ['taskA', 'taskB', 'taskC']
});
dag.addNode({ id: 'taskA', type: 'task', execute: async () => {} });
dag.addNode({ id: 'taskB', type: 'task', execute: async () => {} });
dag.addNode({ id: 'taskC', type: 'task', execute: async () => {} });
dag.addNode({ id: 'merge', type: 'task', execute: async () => {} });
dag.addEdge('start', 'parallel');
dag.addEdge('parallel', 'taskA');
dag.addEdge('parallel', 'taskB');
dag.addEdge('parallel', 'taskC');
dag.addEdge('taskA', 'merge');
dag.addEdge('taskB', 'merge');
dag.addEdge('taskC', 'merge');
事件
engine.on('execution-started', (e) => {
console.log('Started:', e.executionId);
});
engine.on('execution-completed', (e) => {
console.log('Completed:', e.executionId, e.state.status);
});
engine.on('node-started', (e) => {
console.log('Node started:', e.nodeId);
});
engine.on('node-completed', (e) => {
console.log('Node completed:', e.nodeId);
});
测试
npm test
License
MIT
安全使用建议
This skill appears coherent with its stated purpose, but review these points before installing: (1) It will run Node code (task 'execute' functions) you register — those functions run with the same privileges as the Node process, so do not run untrusted workflows. (2) It writes checkpoint files to the configured checkpointDir (default './checkpoints'); ensure that path is acceptable and not pointed at sensitive locations. (3) Package.json has no dependencies, but you should still run npm install and inspect package files locally in an isolated environment first. (4) If you plan to import workflows from others, audit the task code for filesystem, network, or process access. (5) For increased safety, run examples/tests in a sandbox or container and avoid running on production hosts until you’re comfortable with behavior.
功能分析
Type: OpenClaw Skill
Name: yuyonghao-workflow-engine
Version: 0.1.0
The skill bundle provides a legitimate Directed Acyclic Graph (DAG) workflow engine for OpenClaw. The code in src/dag.js, src/executor.js, and src/workflow-engine.js implements standard workflow orchestration features such as sequential/parallel execution, condition branching, retries, and state persistence via checkpoints. No evidence of data exfiltration, malicious command execution, or prompt injection was found; the file system access is restricted to managing workflow state in a local checkpoint directory.
能力评估
Purpose & Capability
Name/description match the included source and examples. The repo provides a DAG implementation, executor, engine API, examples, tests, and checkpoint files — all expected for a workflow engine. No unrelated environment variables, binaries, or external service credentials are requested.
Instruction Scope
SKILL.md and examples instruct running npm and importing the local source; runtime behavior stays within the stated domain. Important: the engine executes task functions you provide (node.execute / parallel tasks), which run arbitrary JavaScript in the host Node process. The engine also reads/writes checkpoint files (default './checkpoints'). Users should be aware that tasks can access the filesystem and process environment at the same privilege level as the Node process.
Install Mechanism
No install spec in registry; SKILL.md suggests running 'npm install' but package.json lists no external dependencies. No downloads from untrusted URLs or extract operations are present. Running npm in this package is low-risk, but standard precautions apply (review package.json — it has no dependencies).
Credentials
The skill requests no environment variables, credentials, or config paths. Its file I/O is limited to a checkpoint directory (configurable), which aligns with its stated persistence feature.
Persistence & Privilege
always:false and no system-wide modifications are requested. The engine persists execution state to disk (checkpoint files in checkpointDir). This persistence is expected for checkpoint/resume semantics but means the skill will write files to the host filesystem where it runs.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install yuyonghao-workflow-engine - 安装完成后,直接呼叫该 Skill 的名称或使用
/yuyonghao-workflow-engine触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Initial public release of Workflow Engine (OpenClaw 工作流编排引擎):
- Provides a DAG-based workflow execution engine with if/else branching and parallel task execution.
- Supports node types: start, end, task, condition, and parallel.
- Includes checkpointing for workflow state persistence and supports resuming execution.
- Features an event-driven system for workflow and node lifecycle events.
- Offers a simple API for defining, executing, and managing workflows, including sequential, conditional, and parallel flows.
- Includes examples and instructions for installation and testing.
元数据
常见问题
Workflow Engine 是什么?
DAG-based workflow engine supporting sequential, conditional, and parallel tasks with checkpoint persistence and event-driven execution. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 187 次。
如何安装 Workflow Engine?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install yuyonghao-workflow-engine」即可一键安装,无需额外配置。
Workflow Engine 是免费的吗?
是的,Workflow Engine 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Workflow Engine 支持哪些平台?
Workflow Engine 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Workflow Engine?
由 yuyonghao-123(@yuyonghao-123)开发并维护,当前版本 v0.1.0。
推荐 Skills