01 / THE RESULT
A command and a visible result
The flow keeps the CI contract deliberately small. shell.run owns the command, timeout, working directory, and failure policy. output.preview exposes stdout as the terminal result.
failOnNonZeroExit is enabled. A failed test command fails the Knodr run, so the CI step receives a non-zero exit code.02 / BUILD IN THE UI
Create the flow from two nodes
- 01Create and save the flow
Choose File → New, then save the file as
flows/ci-tests.knodrflowinside your repository. - 02Add Run Shell Command
Search the palette for Run Shell Command. Set the command and arguments from the table below.
- 03Add Preview
Add a Preview node, then connect
Run tests.stdouttoTest output.value. - 04Add the repository variable
Open Project → Configuration and create
REPO_DIRwith the default value..
commanddotnetProgram to executeargstest↵--configuration↵ReleaseOne argument token per lineworkingDirectory{{var.REPO_DIR}}Overridable repository pathtimeoutSeconds900Stop a hung test runfailOnNonZeroExittruePropagate test failureThe shell node executes the program directly. Enter each argument as a separate line; do not wrap the whole command in shell syntax.
03 / VALIDATE & RUN
Check the graph before execution
Commit the .knodrflow with the rest of the repository. It is readable JSON, so changes to commands, parameters, and connections remain reviewable.
$ knodr validate .\flows\ci-tests.knodrflow ✓ Flow is valid $ knodr run .\flows\ci-tests.knodrflow ` --var REPO_DIR="$PWD" ` --timeout 15m
validate checks the graph structure without running the command. The runtime --var replaces the saved . only for this invocation.
04 / SELF-HOSTED CI
Run the flow as one CI step
The runner needs Knodr and the .NET SDK on PATH. This example targets a self-hosted Windows runner, where you control those installed tools.
name: Tests
on:
pull_request:
push:
branches: [main]
jobs:
flow:
runs-on: [self-hosted, windows]
steps:
- uses: actions/checkout@v4
- name: Validate Knodr flow
shell: powershell
run: knodr validate .\flows\ci-tests.knodrflow
- name: Run tests through Knodr
shell: powershell
run: >-
knodr run .\flows\ci-tests.knodrflow
--var REPO_DIR="$env:GITHUB_WORKSPACE"
--timeout 15m
--var. Map a protected CI secret to KNODR_CREDENTIAL_<NAME> and reference that credential name from the flow.05 / ADAPT THE PATTERN
Change the command, keep the contract
Replace dotnet and its arguments with npm test, cargo test, a linter, a build, or your own checked-in script. Keep the explicit working directory, timeout, and non-zero failure behavior.