Archon substitutes variables in command files, inline prompts,Documentation 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.
bash: scripts, and script: node bodies before passing content to the AI or executing it. This page covers every variable, where it is available, what it resolves to, and how to use it.
There are three categories of variables: workflow variables (substituted by the workflow engine), positional arguments (substituted by the command handler), and node output references (DAG workflows only).
Workflow variables
These variables are substituted by the workflow executor in all node types:command:, prompt:, bash:, script:, and loop:.
$ARGUMENTS / $USER_MESSAGE
$ARGUMENTS / $USER_MESSAGE
Resolves to: The user’s input message that triggered the workflow.This is the primary way to pass user input through to AI nodes.
$USER_MESSAGE is an alias — both variables resolve to the same value.Available in: All workflow node types (command, prompt, bash, script, loop)Example:$WORKFLOW_ID
$WORKFLOW_ID
Resolves to: Unique UUID for the current workflow run.Available in: All workflow node typesExample:Useful for artifact naming, log correlation, and building run-specific file paths.
$ARTIFACTS_DIR
$ARTIFACTS_DIR
Resolves to: Pre-created external artifacts directory at
~/.archon/workspaces/<owner>/<repo>/artifacts/runs/<id>/.Available in: All workflow node typesThe directory always exists before any node executes. It is stored outside the repository to avoid polluting the working tree.Example:$BASE_BRANCH
$BASE_BRANCH
Resolves to: Base branch for git operations (e.g.,
main or dev).Available in: All workflow node typesResolution order:worktree.baseBranchfrom.archon/config.yaml(if set)- Auto-detected from
git remote show origin(if not set) - Fails immediately if referenced but cannot be resolved
$DOCS_DIR
$DOCS_DIR
Resolves to: Documentation directory path.Available in: All workflow node typesConfigured via
docs.path in .archon/config.yaml. Defaults to docs/ when not set. Unlike $BASE_BRANCH, this variable always has a safe default and never throws.Example:$CONTEXT / $EXTERNAL_CONTEXT / $ISSUE_CONTEXT
$CONTEXT / $EXTERNAL_CONTEXT / $ISSUE_CONTEXT
Resolves to: GitHub issue or PR context, when the workflow is triggered from GitHub.All three names are aliases for the same value. When no issue context is available, they are replaced with an empty string (never the literal
$CONTEXT text).Available in: All workflow node typesAuto-appending behavior: If issue context is present but no context variable appears in the prompt, the context is appended to the end of the prompt automatically. This prevents duplicate context when you explicitly use $CONTEXT.Example:$LOOP_USER_INPUT
$LOOP_USER_INPUT
Resolves to: User feedback provided via
archon workflow approve <id> <text> at an interactive loop gate.Available in: Loop nodes with interactive: trueOnly populated on the first iteration after a resume — empty string on all other iterations (initial run and subsequent iterations).Example:$REJECTION_REASON
$REJECTION_REASON
Resolves to: Reviewer feedback provided via
archon workflow reject <id> --reason <text> at an approval gate.Available in: on_reject prompts on approval nodes only. Empty string everywhere else.Example:$LOOP_PREV_OUTPUT
$LOOP_PREV_OUTPUT
Resolves to: Cleaned output of the previous loop iteration (loop nodes only).Available in: Loop nodesEmpty string on the first iteration (no prior output exists). Particularly useful for
fresh_context: true loops that need to reference what the previous pass produced without carrying the full session history.Example:Positional arguments
These variables are substituted by the command handler when commands are invoked directly (outside workflows). They are processed before workflow variables.| Variable | Resolves to | Notes |
|---|---|---|
$1 | First positional argument | Split by whitespace from the user’s input |
$2 | Second positional argument | |
$3 … $9 | Third through ninth positional arguments | |
$ARGUMENTS | All arguments as a single string | Same variable available in both command and workflow contexts |
\$ | Literal $ character | Escape a dollar sign to prevent substitution |
.archon/commands/analyze.md):
analyze security authentication authorization, this becomes:
Node output references
In DAG workflows, nodes can reference the output of any completed upstream node. These are substituted after workflow variables.| Pattern | Resolves to | Notes |
|---|---|---|
$nodeId.output | Full output string of the referenced node | The node must be declared in depends_on |
$nodeId.output.field | A specific JSON field from the node’s output | Requires the upstream node to use output_format for structured JSON |
Shell quoting behavior
- In
bash:scripts:$nodeId.outputvalues are auto shell-quoted (single-quoted, with embedded'escaped), so the value is always safe to embed in a shell command. - In
script:nodes: Values are embedded as-is (not shell-quoted). Treat substituted values as untrusted input and parse them with language features (e.g.,JSON.parse), not by interpolating into shell syntax.
Example
Substitution order
Variables are substituted in a defined sequence within the workflow engine:- Workflow variables —
$WORKFLOW_ID,$USER_MESSAGE,$ARGUMENTS,$ARTIFACTS_DIR,$BASE_BRANCH,$DOCS_DIR,$LOOP_USER_INPUT,$REJECTION_REASON,$LOOP_PREV_OUTPUT - Context variables —
$CONTEXT,$EXTERNAL_CONTEXT,$ISSUE_CONTEXT - Node output references —
$nodeId.output,$nodeId.output.field
$1 through $9) are substituted separately by the command handler and are only available when commands are invoked directly, not through workflow nodes.
Availability by context
| Variable | Workflow nodes | Direct command invocation | when: conditions |
|---|---|---|---|
$ARGUMENTS / $USER_MESSAGE | Yes | Yes | No |
$1 … $9 | No | Yes | No |
$WORKFLOW_ID | Yes | No | No |
$ARTIFACTS_DIR | Yes | No | No |
$BASE_BRANCH | Yes | No | No |
$DOCS_DIR | Yes | No | No |
$CONTEXT / aliases | Yes | No | No |
$LOOP_USER_INPUT | Yes (loop nodes) | No | No |
$REJECTION_REASON | Yes (on_reject only) | No | No |
$LOOP_PREV_OUTPUT | Yes (loop nodes) | No | No |
$nodeId.output | Yes (DAG nodes) | No | Yes |
$nodeId.output is the only variable available in when: conditions. This lets you use upstream node output to conditionally skip or run downstream nodes.Authentication environment variables
These are standard environment variables read fromprocess.env at startup. They are not workflow-substituted variables — they must be set in your shell environment or .env file before Archon starts.
| Variable | Description |
|---|---|
GH_TOKEN | GitHub personal access token for authenticated clone operations |
GITLAB_TOKEN | GitLab personal or project access token (glpat-*) for authenticated GitLab clones |
GITEA_TOKEN | Gitea API token for authenticated Gitea/Forgejo clones |
Workflow Schema
Complete YAML schema for nodes, loop config, and approval gates.
Authoring Workflows
Practical guide to building and testing your own workflows.
Loop Nodes
How to use $LOOP_PREV_OUTPUT and interactive loop gates.
Approval Nodes
How to use $REJECTION_REASON in on_reject prompts.