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.

Python3 (multi-process workers engine) PHP8 + Swoole (multi-process workers engine) JavaScript + NodeJS (multi-process workers engine) Ruby (multi-process workers engine)
Python3 PHP8 + Swoole JavaScript + NodeJS Ruby Lang

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):

hello:
    - "${name}"

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

1. Clone the Repo

git clone https://github.com/empowerd-cms/nyno
cd nyno

2. Build the Container

./build-container.sh "podman" # or use docker

3. Run the Container

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.