nyno-file-write-multiple
Use Mistral AI or JSON to write to Multiple files. The nyno-file-write-multiple workflow step is especially useful if you want to create knowledge bases or quickly start new projects.
Example Workflow:
nyno: '7.0'
workflow:
- id: '3'
next: [6]
step: nyno-file-read
args: [/input/prompts/output-json-files.md]
context: {set_context: prev_file}
label: read /input/prompts/output-json-files.md
- id: '6'
next: [4]
step: gui-input-textarea
label: ' Send Message (this opens a popup before the workflow)'
- id: '4'
next: [5]
step: ai-mistral-text
args: ['${prev_file}: ${prev}']
label: Generate Text with Mistral AI
- id: '5'
step: nyno-file-write-multiple
args: ['${prev}']
context: {output_dir: /output/proj1}
label: nyno-file-write-multiple
Nyno compatibility:
- ✅ Online Platform 2.1 (since 17 May '26)
- 📅 Nyno OSS (est. June 2026)
Documentation
nyno-file-write-multiple — Write multiple files from an object structure
Description
- step: nyno-file-write-multiple
args:
- relative/path1.txt: "File content 1"
relative/path2.js: "File content 2"
The nyno-file-write-multiple step writes multiple files at once from an object structure where keys are relative file paths and values are file contents. This is particularly useful for:
- Generating multiple configuration files
- Creating directory structures with content
- Writing multiple output files from a single operation
Usage in a workflow YAML:
workflow:
- step: nyno-file-write-multiple
args:
- config/settings.json: '{"api": "enabled"}'
scripts/init.sh: "#!/bin/bash\necho 'Initializing...'"
Parameters
| Parameter | Type | Description |
|---|---|---|
context.output_dir |
string |
Base directory where files will be written (default: /output). |
context.set_context |
string |
Context variable name to store results (default: prev). |
Return Values
On success (return code 0), stores an object in the specified context variable (default ${prev}):
{
"success": true,
"baseDir": "/output",
"writtenFiles": [
"/output/relative/path1.txt",
"/output/relative/path2.js"
]
}
On failure (return code -1), stores error information in ${prev_error} (or ${[set_context]_error}):
{
"errorMessage": "Error description"
}
Behavior
- Creates parent directories automatically if they don't exist
- Skips files with paths attempting to escape the output directory (paths starting with
..) - Converts all content to strings (objects will be
[object Object]unless stringified first) - Overwrites existing files without warning
- Normalizes path separators across operating systems
Context Options
| Option | Type | Default | Description |
|---|---|---|---|
output_dir |
string | /output |
Base directory for all file operations |
set_context |
string | prev |
Context variable name for results |
Examples
Example #1 — Basic usage with inline object
workflow:
- step: nyno-file-write-multiple
args:
- README.md: "# Project\n\nInitial setup"
config.json: '{"version": 1}'
Example #2 — Using previous step output
workflow:
- step: some-data-generator
context:
set_context: file_data
- step: nyno-file-write-multiple
args:
- '${file_data}'
context:
output_dir: /custom/output
set_context: written_files
Example #3 — Creating directory structure
workflow:
- step: nyno-file-write-multiple
args:
- src/index.js: "console.log('Hello')"
src/utils/helper.js: "export function help() {}"
package.json: '{"name": "my-project"}'
Example #4 — Using with template variables
workflow:
- step: nyno-uuidv4
context:
set_context: unique_id
- step: nyno-file-write-multiple
args:
- temp/${unique_id}/data.txt: "Temporary data"
temp/${unique_id}/meta.json: '{"id": "${unique_id}"}'