Script nodes let you run TypeScript, JavaScript, or Python code as part of an Archon workflow DAG without invoking any AI. The script runs via theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/coleam00/Archon/llms.txt
Use this file to discover all available pages before exploring further.
bun or uv runtime, stdout is captured as the node’s output, and the result flows downstream as $nodeId.output. Use script nodes for deterministic work that needs a real programming language: parsing JSON, transforming data between AI nodes, calling typed HTTP clients, or computing values that a shell one-liner would mangle.
If a plain shell command is sufficient, use a bash: node instead.
Quick start
- Inline TypeScript (bun)
- Inline Python (uv)
- Named script from .archon/scripts/
How it works
Variable substitution
$ARGUMENTS, $WORKFLOW_ID, $ARTIFACTS_DIR, $BASE_BRANCH, $DOCS_DIR, and upstream $nodeId.output references are substituted into the script text before execution.Inline vs named detection
If the
script value contains a newline or any shell metacharacter, it’s treated as inline code. Otherwise it’s treated as a named script reference resolved from .archon/scripts/ or ~/.archon/scripts/.Runtime dispatch
runtime: bun+ inline →bun --no-env-file -e '<code>'runtime: bun+ named →bun --no-env-file run <path>runtime: uv+ inline →uv run [--with dep ...] python -c '<code>'runtime: uv+ named →uv run [--with dep ...] <path>
YAML schema
Fields
| Field | Type | Required | Description |
|---|---|---|---|
script | string | Yes | Inline code, or the basename (no extension) of a file in .archon/scripts/ or ~/.archon/scripts/ |
runtime | 'bun' | 'uv' | Yes | Which runtime executes the script. Must match the file extension for named scripts |
deps | string[] | No | Python packages to install for this run. uv only — ignored with a warning for bun |
timeout | number (ms) | No | Hard kill after this many milliseconds. Default: 120000 (2 min) |
id, depends_on, when, trigger_rule, retry) all work. AI-specific fields (model, provider, output_format, allowed_tools, etc.) are accepted by the parser but emit a loader warning and are ignored at runtime—no AI is invoked.
Inline vs named scripts
The executor decides from thescript string itself. A value is treated as inline code if it contains a newline or any shell metacharacter; otherwise it’s a named script lookup.
Metacharacters that trigger inline mode: space, ; ( ) { } & | < > $ ` " '
| Mode | Examples |
|---|---|
| Inline | Multi-line blocks, any snippet with a space, "const x = 1; console.log(x)" |
| Named | fetch-pages, analyze_metrics, triage-fmt — bare identifiers with no whitespace or shell syntax |
Named script resolution
Named scripts are discovered from, in precedence order:<repoRoot>/.archon/scripts/— repo-local~/.archon/scripts/— home-scoped (shared across every repo)
.archon/scripts/triage/foo.ts resolves as foo). Deeper nesting is ignored. On a same-name collision the repo-local entry wins.
Extension ↔ runtime mapping
| Extension | Runtime |
|---|---|
.ts, .js | bun |
.py | uv |
runtime: declared on the node must match the file’s extension—the validator rejects runtime: uv pointing at a .ts file, and vice versa.
Dependencies (uv only)
deps is a pass-through to uv run --with <dep>, which installs packages into a per-run ephemeral environment:
- Any PEP 508 specifier works:
pkg==1.2.3,pkg>=2,<3 bunauto-installs imported packages on first run, sodepswithruntime: bunemits a warning—remove the field or switch touvfor explicit dependency management- Each run is isolated; there is no persistent
requirements.txtor lockfile
Output and data flow
stdout (trimmed) becomes $nodeId.output. Print JSON if you want downstream nodes to access structured fields:
Variable substitution in scripts
Variables are substituted into thescript text as raw strings, without shell quoting—unlike bash: nodes, where $nodeId.output values are auto-quoted. Treat substituted values as untrusted input and parse them with language features.
For named scripts, variables are not passed automatically—read them from the environment (process.env.USER_MESSAGE, os.environ['USER_MESSAGE']) or accept via stdin. For inline scripts, substituted variables are literally embedded into the code string at execution time.
Environment and isolation
Script subprocesses receiveprocess.env merged with any codebase-scoped env vars configured via the Web UI (Settings → Projects → Env Vars) or the env: block in .archon/config.yaml—the same injection surface used by Claude, Codex, and bash nodes.
Target repo .env isolation: The Bun subprocess is invoked with --no-env-file, so variables in the target repo’s .env do not leak into the script. Archon-managed env (from ~/.archon/.env and <repo>/.archon/.env) passes through normally. uv-launched Python subprocesses do not auto-load .env at all.
User-controlled variables like
$USER_MESSAGE and $ARGUMENTS are passed to bash: nodes as environment variables—not inline-substituted—to prevent shell injection. Script nodes receive these values the same way via process.env.Validation
archon validate workflows <name> checks script nodes for:
- Script file exists — for named scripts, the basename must exist in
.archon/scripts/or~/.archon/scripts/with a matching extension - Runtime available on PATH —
bunoruvmust be installed:- Install bun:
curl -fsSL https://bun.sh/install | bash - Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
- Install bun:
depswithruntime: bun— warns thatdepsis a no-op under bun
which bun / which uv once and memoizes the result.
Patterns
Transform AI output between nodes
Use a script node as a deterministic adapter between two AI nodes:Reusable helper in ~/.archon/scripts/
A triage formatter you want available in every repo lives at ~/.archon/scripts/triage-fmt.ts:
~/.archon/scripts/triage-fmt.ts
Python with scientific dependencies
Fetch GitHub data with typed client
What does NOT work
AI-only features
AI-only features
hooks, mcp, skills, allowed_tools, denied_tools, agents, model, provider, output_format, effort, thinking, maxBudgetUsd, systemPrompt, fallbackModel, betas, and sandbox are all ignored at runtime. The loader emits a warning listing the ignored fields.Interactive prompts
Interactive prompts
Scripts run headlessly. Any
stdin read will see EOF immediately.Other runtimes
Other runtimes
Only
bun and uv are supported. Other runtime values are rejected at parse time.Cooperative cancellation
Cooperative cancellation
Script subprocesses are killed on workflow cancel, but there is no cooperative cancellation signal. Design scripts to complete quickly or fail fast. Use
timeout: to cap execution time.Related pages
Authoring Workflows
Full workflow reference including bash nodes and all node types.
Global Workflows
Place scripts in
~/.archon/scripts/ for use across every repo.Variable Reference
Complete variable substitution rules including
$nodeId.output.CLI Reference
archon validate workflows to check script node configuration.