Generate Your Own Nyno Workflow Extensions

Generate Your Own Nyno Workflow Extensions (Markdown Version):


Nyno Extension Rules (Simple)

1. Basic Rules

2. Dynamic Output Key

3. Return Values

4. Context Usage

5. Syntax

6. Examples

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;
}

JS 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
}