开源 n8n 替代方案,用于工作流构建 (包含 GUI 和 Docker)
Open-Source n8n Alternative for Workflow Building (GUI and Docker Included)

原始链接: https://github.com/empowerd-cms/nyno

## Nyno 3.0:多语言工作流引擎 Nyno 3.0 是一款开源工作流引擎,旨在利用您已知的语言(Python、PHP、JavaScript 和 Ruby)构建和连接自动化流程。它允许您从这些语言的脚本中创建可重用的命令步骤,并在高性能工作引擎中执行。 工作流使用简单、人类可读的 YAML 文件(.nyno)定义,通过共享上下文路由命令并在步骤之间传递数据。Nyno 能够动态扩展,为每种语言生成多个工作进程(在生产环境中最多可达每个 CPU 核心一个),以提高吞吐量。 安装最简单的方法是通过 Docker/Podman,但也可以直接安装在 Linux 上,前提是仔细管理依赖项(包括 Best.js)。Nyno 旨在通过为基于工作流的应用程序提供灵活且可扩展的后端来简化 AGI 开发。它使用 Best.js 以实现速度,并在设置完成后提供 `http://localhost:9057` 处的 GUI。

## Nyno:一个开源工作流引擎 Nyno是一个新的开源工作流引擎和语言,作为n8n的替代方案。与n8n存在商业用途许可限制不同,Nyno是完全开源的,允许自托管和无限制使用。 Nyno允许用户使用YAML工作流(.nyno文件)构建自动化,并支持多种语言——Python、PHP、JavaScript和Ruby——每种语言都在其自己的专用引擎中运行。用户最初对工作流触发(目前通过TCP)和示例设置的理解存在困惑。 开发者明确了Nyno的目的:提供一个灵活、可扩展的自动化平台,利用熟悉的编程语言。它旨在填补一个空白,为那些寻求真正开源的替代工具(如n8n,可能存在限制性许可)的人们提供选择。
相关文章

原文

Nyno Workflow Example

Nyno 3.0: Open-Source Backend for Workflow-based AGI. Extend with Python, PHP, JS and Ruby. Route with YAML.

🧠 Create New Workflow Steps in languages you love.

🔗 Connect everything with plain YAML text (.nyno).

Nyno is an open-source multi-language workflow engine and language that lets you build, extend, and connect automation in the languages you already know — Python, PHP, JavaScript, and Ruby.

Each programming language runs in its own high-performance worker engine. Command-steps can be called in human-readable YAML Workflows (.nyno files).

Introducing "The Engine" that powers Nyno 3.0

To achieve most requests/per second we're using multi-process worker engines where feasible. Nyno will spawns 2 light-weight workers for each language in dev mode or 3 workers for every language and CPU core in prod mode. This means that if you have 4 CPU cores, it will spawn 12 ready-to-run workers to run workflow steps.


Create New Steps or Use Extensions: Turn Scripts into High-Performing Text Commands

In Nyno, every Python, JavaScript, PHP and Ruby script becomes a reusable command that runs in its own high-performing worker engine. Just export a function (with args and context) and call it in any workflow using plain YAML text.

Example (JavaScript)

// extensions/hello/command.js
export function hello(args, context) {
  const name = args[0] || "World";
context['hello'] = `Hello, ${name}!`;
return 0;
}

Example in Workflow (YAML):

Example in TCP (after saving your flow.json in workflows-enabled/ and restarting Nyno):

tcpman localhost:9024/test_nyno 'c{"apiKey":"changeme"}' 'q{"name":"Alice"}'

Example output

>>> Sending: c{"apiKey":"changeme"}
{"status":"ok","type":"connect"}
>>> Sending: q{"name":"Alice","path":"/test_nyno"}
{"route":"/test_nyno","system":"default","status":"ok","execution_time_seconds":0.019,"execution":[{"input":{"name":"Alice"},"output":"","details":{"error":true,"missing":["i"],"node_id":"1","node_title":"route_/test_nyno","new_context":{"name":"Alice"}}},{"input":{"name":"Alice","O_1":""},"output":"hi node 2!","details":{"command":["echo","hi node 2!"],"bash":true,"stderr":"","exitCode":0,"node_id":"2","node_title":"node_2","new_context":{"name":"Alice","O_1":"","O_2":"hi node 2!"}}},{"input":{"name":"Alice","O_1":"","O_2":"hi node 2!"},"output":"always hi from node 4!","details":{"command":["echo","always hi from node 4!"],"bash":true,"stderr":"","exitCode":0,"node_id":"4","node_title":"node_4","new_context":{"name":"Alice","O_1":"","O_2":"hi node 2!","O_4":"always hi from node 4!"}}}]}


Nyno logo

Install Nyno using Docker/Podman

git clone https://github.com/empowerd-cms/nyno
cd nyno
./build-container.sh "podman" # or use docker

Make sure you to build the container first.

./run-container-prod.sh "podman" # or use docker, GUI at http://localhost:9057

Install Nyno on Linux Host

Note: Nyno is dependent on Best.js which needs to be installed to run Nyno. You will need to install quite a lot of dependencies. Docker/Podman install is recommended. However, for the experts, a bash scripts/check_host.sh script is included to check dependencies quickly.

# install Best.js
git clone https://github.com/empowerd-cms/best.js
cd best.js
npm install # or # bun install
npm link # for "bestjsserver" command
cd ../

# install Nyno
git clone https://github.com/empowerd-cms/nyno
cd nyno
npm install # or # bun install

# Optionally check system status/dependencies (Python, PHP Swoole, Ruby, Node,Postgres) 
bash scripts/check_host.sh

# Execute Nyno
bash run-dev.sh # runs Nyno in dev mode

Describe Image Here

More Examples and Documentation

Example Python extension:

# extensions/hello-py/command.py
def hello_py(args, context):
    name = args[0] if args else "World"
    context["hello-py"] = f"Hello, {name} from Python!"
    return 0

Example PHP extension:

<?php
// extensions/hello-php/command.php
function hello_php($args, &$context) { // & required to modify context
    $name = $args[0] ?? "World";
    $context["hello-php"] = "Hello, $name from PHP!";
    return 0;
}

Example using context to Pass Data Between Steps

export function some_extension(args, context) {
  const result = args[0] || "default value";

  // Save output in context for the next step
  context['MY_RESULT'] = result;

  return 0; // default path
}

Example Workflow output:

{
    "route": "\/test_runners",
    "system": "default",
    "status": "ok",
    "execution_time_seconds": 0.012,
    "execution": [
        {
            "input": {
                "i": "0",
                "name": "Alice"
            },
            "output": "0",
            "details": {
                "command": [
                    "nyno-echo",
                    "0"
                ],
                "context": {
                    "i": "0",
                    "name": "Alice"
                },
                "node_id": "1",
                "node_title": "route_\/test_runners",
                "new_context": {
                    "i": "0",
                    "name": "Alice",
                    "NYNO_ECHO_ARGS": [
                        "0"
                    ]
                }
            }
        },
        {
            "input": {
                "i": "0",
                "name": "Alice",
                "NYNO_ECHO_ARGS": [
                    "0"
                ],
                "O_1": "0"
            },
            "output": "Hello, Alice!",
            "details": {
                "command": [
                    "hello",
                    "Alice"
                ],
                "context": {
                    "i": "0",
                    "name": "Alice",
                    "NYNO_ECHO_ARGS": [
                        "0"
                    ],
                    "O_1": "0"
                },
                "node_id": "2",
                "node_title": "test-js",
                "new_context": {
                    "i": "0",
                    "name": "Alice",
                    "NYNO_ECHO_ARGS": [
                        "0"
                    ],
                    "O_1": "0",
                    "custom_js_var": "js"
                }
            }
        }
    ]
}

Nyno (“Nine-oh”) is open-source & Proudly build with Best.JS - a faster Next.JS alternative.

联系我们 contact @ memedata.com