Nyno Workflow Example

Founder Note: "Unlike with n8n, you and your clients never have to request a commercial license to run Nyno workflows. This was the main reason I started building Nyno." – MJ

Nyno examples connecting multiple AI nodes


Nyno 5.1: Open-Source Workflow Engines for AI, Advanced Intelligence & Beyond. Extend with Python, PHP, JS and Ruby. Runs in the Browser.


🧠 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 short human-readable YAML Workflows (.nyno files).

nyno: 5.1.0
workflow:
  - step: ai-openai-text
    args: ['My idea: ${PROMPT}', minimal]
    context: {SYSTEM_PROMPT: 'You''re a blog post writer. I will give you an idea, and you basically need to expand upon it, you can also correct me, but just give me the best possible article you can write about it to share my idea. Only output the new article, dont affirm.'}
  - step: ai-openai-text
    args: ['my article: ${prev}', minimal]
    context: {SYSTEM_PROMPT: 'Make my article more heartfelt. Only output the new article, dont affirm.'}

Introducing "The Engine" that powers Nyno

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:

{
  "status": "ok",
  "execution": [
    {
      "node": 2,
      "input": {
        "args": [
          0
        ],
        "context": {}
      },
      "output": {
        "r": 0,
        "c": {
          "LAST_STEP": "nyno-echo",
          "prev": [
            0
          ]
        }
      }
    }
  ],
  "execution_time_seconds": 0.001
}

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