nyno-file-read

nyno-file-read — Read data from a file in a workflow


Description

- step: nyno-file-read
    args: ['${INPUT_FILE_PATH}']

The nyno-file-read step reads the entire content of a file and returns it for use in later steps.

If the file doesn’t exist or can’t be opened, the step will return a non‑zero exit code and usually set an error in context.

The content returned is typically a string (raw file contents). If the file contains structured data (like JSON), you can parse it in subsequent steps.

Usage in a workflow YAML:

workflow:
  - step: nyno-file-read
    args: ['${INPUT_FILE_PATH}']

Parameters

Parameter Type Description
filePath string Path to the file to read. Can be absolute or relative.

Return Values

This step returns 0 on success.

On success, by convention ${prev} becomes the file's value.

…file contents as string…

On failure (e.g., file not found), the step returns a non‑zero exit code and typically writes an error message into context (e.g., ${prev}.error).


Behavior


Examples

Example #1 — Basic file read

workflow:
  - step: nyno-file-read
    args: ['/tmp/input.txt']

Reads the contents of /tmp/input.txt and stores it in ${prev}.

Example #2 — Use read content in later step

workflow:
  - step: nyno-file-read
    args: ['/app/config.json']
  - step: ai-mistral-text
    args:
      - "Summarize this config: ${prev}"

This reads a JSON config file and passes its contents to another step for processing.


Notes


See Also