Run Command / Script

desktop · N018 · starter-package 7.0.1

Run an installed executable or script runner directly on the computer without invoking a command shell.

Inputs

  • Fire: optional execution signal for chaining Start or another action into this block.
  • Operation: an installed executable name (for example node) or its full path. Shell command lines are not accepted.
  • Arguments: a JSON record or Record connector. Put positional arguments in the args list; other keys become --key value arguments. A true value creates a flag and false omits it.
  • Working directory: an existing relative or absolute folder accessible to the current user.
  • Environment: optional non-secret text overrides. Nodestly preserves the device’s search path and blocks overrides for credentials, loaders, user profiles, temporary folders, Git, and SSH.
  • Timeout: a whole number from 10 through 300000 milliseconds and never beyond the current workflow deadline.
  • Non-zero exit: stop the workflow by default, or return the non-zero result when explicitly selected.

Execution and outputs

The package starts the executable with Node's process API and shell: false, so shell expansion, pipes, redirects, and command chaining are never interpreted. Installing and enabling the add-on is the trust action for this documented behavior; Run does not ask for a separate per-block execution decision.

A completed process returns Succeeded, Exit code, UTF-8 Standard output, UTF-8 Standard error, Duration in milliseconds, and Fire. Each text stream has a limit of 32 KiB, with a combined limit of 48 KiB. Exceeding either limit stops the run.

Sharing a command with another user

Save the tools and project files your command needs in Command prerequisites. Use commas or line breaks between entries. The setting travels with the workflow and accepts up to 32 entries.

EntryWhere Nodestly checksWhat the recipient can do if it is missing
ffmpegThe current user's PATH for an executable with that name.Approve the Windows Package Manager installation or install the tool manually and add it to PATH.
npm:pdf-lib or npm:@scope/packageThe package's package.json under node_modules in the working directory or one of its parents.Approve setup for the listed project working folder, or install the required version beforehand.
file:scripts/report.jsA regular file at the specified path relative to Working directory.Provide the file at that location or connect the correct project folder. Paths can include spaces and ../.

For a Node.js reporting script, enter node in Executable or script runner, set Arguments to {"args":["scripts/report.js"]} and choose the project's root as Working directory. Enter file:scripts/report.js, npm:pdf-lib in Command prerequisites. Include a program such as ffmpeg if the script calls it.

Before the workflow starts, Nodestly checks prerequisites whose location it knows, including a local runner set directly or wired from Text Value. When a connection chooses the working directory during execution, file and package checks use that connected folder immediately before the command starts. A missing-prerequisite message names the entries to fix.

The review lists each missing prerequisite and the project folder it affects. After approval, Nodestly links the installed npm package into that project's node_modules. Installation scripts stay disabled and the existing manifest and lockfile are preserved. Install packages that need a native build in the project beforehand.

Existing Node.js commands

A direct Node command also works with an empty Command prerequisites field. For node scripts/report.cjs, Nodestly checks the entry file and reads literal imports from the project. For example, require('@scope/reports/pdf') identifies the package @scope/reports. Inline node -e and node -p, literal ESM imports, re-exports and immediate literal import() calls are supported. Relative imports lead to local files. Built-in modules such as node:fs come with Node.

Nodestly checks the nearest project manifest and lockfile, including those above a nested working folder. The review shows the compatible locked registry version or declared range. With no known version, approval installs the latest published version. Supply private registry, file, URL and Git dependencies using the project's own installation instructions. If choosing a missing script reveals another package, Nodestly asks separately before installing it.

Declare helpers used by shell commands, computed imports, conditional code and functions. Automatic source inspection covers local JavaScript up to 128 KiB per file and 32 files per command. A dynamically connected Arguments or Working directory is checked once the producing block supplies its value.

For a missing file: inside the project, choose a local copy supplied by the creator. Nodestly copies it to the reviewed path and preserves any existing file. Supply files outside the project at their expected locations yourself. Use an existing, writable project working directory when requesting setup. Share your helper files with the recipient alongside the workflow.

On Windows, the review can install FFmpeg, ffprobe and ffplay for the current user with Windows Package Manager (Gyan.FFmpeg). Other executables require their publisher's installer. Interactive runs can request setup once a calculated working folder is known. For scheduled runs, complete setup in a manual run first.

Error handling

Missing executables, inaccessible working folders, timeout, cancellation, excessive output, signal termination, and unexpected spawn failures are reported separately. A non-zero exit stops the workflow when Stop workflow is selected, or is returned normally with Succeeded = false when Return result is selected. Correct the setting named by the error and run the workflow again.

Exact settings reference

These are the saved settings and defaults. If a value is connected to the matching input, that connected value is used.

IDSettingControlDefaultBounds/options
operationOperationtextEmpty text—
requiredProgramsCommand prerequisitestextareaEmpty text—
argumentsJsonargumentsJsontextarea{}—
workingDirectoryWorking directorytext.—
environmentJsonenvironmentJsontextarea{}—
timeoutMsTimeout (ms)number30000—
failOnNonzerofailOnNonzerotoggletrueoptions: Stop workflow (true), Return result (false)

Connector data types

The type below is the data type that actually travels through the connection. Any additional validation is described separately in this block guide.

DirectionConnectorTypeRequired
Inputoperation — Operationtextno
Inputarguments — Argumentsrecordno
InputworkingDirectory — Working directorytextno
Inputenvironment — Environmentrecordno
InputtimeoutMs — Timeout (ms)numberno
Outputsucceeded — Succeededbooleanon success
OutputexitCode — Exit codenumberon success
Outputstdout — Standard outputtexton success
Outputstderr — Standard errortexton success
OutputdurationMs — Duration (ms)numberon success

Python projects

Set Executable to the installed python, python3 or a versioned name such as python3.12. Choose the project folder as Working directory. With {"args":["scripts/report.py"]}, Nodestly reads scripts/requirements.txt if present. To choose another requirements file inside that project, add a Command prerequisites entry such as file:config/requirements-report.txt. Its filename starts with requirements and ends with .txt.

A line such as pypdf==5.9.0 names a distribution and its exact version. Nodestly checks installed distribution metadata on disk before starting the script. If the selected environment already satisfies the pins, the command uses that environment. If a version is missing, the approval lists the complete pinned set to prepare. After approval, pip installs compatible wheels and their wheel dependencies under .nodestly-python in the project folder. The actual command receives that folder on its Python search path. Each project has its own packages.

Use a prepared environment for editable installs, URLs, version ranges and conditional rules. Nodestly identifies lines that need manual preparation and allows the command to use its existing environment. The Windows py launcher, python -m and other invocation forms also use the existing environment. If pip cannot find a compatible wheel, prepare the selected interpreter yourself or choose a version that supplies a wheel.