Workflow Context & Variable Passing

This document explains how workflow steps (nodes) pass data between each other using context variables.


Connecting Nodes

In the GUI workflow builder, nodes are connected visually:

  1. Click a node’s circle connector
  2. Drag it to another node’s circle

Example of Drag it to another node’s circle

Once connected, data automatically flows from the previous node to the next.


The ${prev} Variable (Default)

By default, every step stores its output in ${prev}.

This makes simple, linear workflows easy to build with no extra configuration.


Custom Context Keys (set_context)

Steps also support writing their output to a custom context key instead of ${prev}.

Example:

context:
  set_context: my_last_http_request

This is useful when you need to:


Using ${prev} in the Next Node

When a step runs, its output is stored in ${prev} by default.

For a file node, ${prev} contains the file contents. You can use this directly in the next step’s prompt.


Full Workflow Example

workflow:
  - step: nyno-file-read
    args:
      - /home/user/example.txt

  - step: ai-mistral-text
    args:
      - "Improve my file: ${prev}"
    context:
      MISTRAL_API_KEY: "key"

Result:

${prev} is replaced with the contents of example.txt and sent to the AI model.


Summary