Menu Nodes and orchestration

indra CLI

Nodes and orchestration

Run agents on this machine and over SSH, and chain them into workflows.

Agents can run on this machine and on other machines. A node is one such machine; local is always there. The easy way to add one is joining: one command on that machine, no SSH. Machines you already reach over SSH can be listed instead:

[local]
max_parallel = 4                         # agents at once on this machine

[[node]]
name         = "build-box"
ssh          = "ci@build-box.internal"   # host, user@host, or a Host alias from ~/.ssh/config
max_parallel = 2
targets      = ["/srv/api", "/srv/web"]  # codebases on that machine

Each remote node needs indra on its PATH (or set indra = "/path/to/indra"), and ssh <destination> must work without a password prompt (keys or an agent). Then:

$ indra nodes
local          ok    laptop     (macos aarch64, 10 cpus, indra 0.1.0, max 4 agents)  runners: claude
build-box      ok    ci-7       (linux x86_64, 16 cpus, indra 0.1.0, max 2 agents)   runners: claude, codex
gpu-box        DOWN  me@gpu-box  ssh: Could not resolve hostname gpu-box: Name or service not known

In the console, Machines shows each machine, its runners, its capacity and the review runs on its disk (over SSH, or over the link for a machine that dials in). Click a remote run to copy its text files to the hub (<data dir>/fetched/<node>/<run>) and open it like a local one: findings, triage, comparison, memory, publish and post work on the copy, and changes stay in the copy. Run an agent can start an agent on any node. A remote agent streams into the same live view as a local one, with its subagents and tool calls, and Stop stops it on the remote.

Machines that dial in (no SSH)

A machine can join the hub instead of being reached over SSH. On the Machines page, click Add a machine and paste the command it shows on that machine. Nothing else to fill in:

# Linux or macOS: installs indra if needed, then joins
curl -fsSL https://raw.githubusercontent.com/dmdhrumilmistry/indra/main/install.sh | INDRA_JOIN="http://192.168.1.20:7878 ABCDE-FGHJK" sh
# Windows (PowerShell)
$env:INDRA_JOIN="http://192.168.1.20:7878 ABCDE-FGHJK"; irm https://raw.githubusercontent.com/dmdhrumilmistry/indra/main/install.ps1 | iex
# indra already installed
indra join http://192.168.1.20:7878 ABCDE-FGHJK   # optional: --name build-box --target /srv/api

indra join names the machine after its host name (taking name-2 if that is in use), reports its system, CPUs and installed agents, lets agents work in the folder it ran in, and keeps the link running in the background, started again at log-in or boot (a systemd user service on Linux, a launchd agent on macOS, a sign-in entry on Windows; --foreground stays in the terminal). The console shows the machine as soon as it joins. The folders agents work in are changed on its card (Change, with a folder browser that walks the machine's folders over its link); they need not be where indra is installed. On the machine, indra node status says which hub it joined and how its link runs, indra node folders lists or changes the folders agents may use, and indra node leave undoes it all. Remove on its card in the console disconnects it and deletes its key. The step-by-step guide, with troubleshooting, is Adding machines.

Many machines at once: Add many machines makes an enrollment key (valid up to a year, an optional machine limit, revocable; the hub keeps only its SHA-256) with ready-made scripts for Jamf, Intune and Linux. Organization-wide settings come from defaults.toml (under the user's) and managed.toml (enforced) in /Library/Application Support/indra, /etc/indra or C:\ProgramData\indra; a [join] section there lets indra join run with no arguments. See Rolling out with MDM.

Joining works when the console listens on the network (--bind 0.0.0.0:7878) even though its settings are then locked against browser edits: a joining machine adds only its name to indra.toml, never a command. A console started with --read-only or --lock-config refuses joins.

The node runs only runners from its own configuration, in directories that exist on it, exactly as with SSH. Builds without the webrtc feature (cargo install --no-default-features) relay everything over the WebSocket.

Workflows

A workflow is a graph of agent tasks, each on a node, run in dependency order:

[[workflow]]
name = "nightly"
description = "Review the services on the build box and the web app here, then summarise."

[[workflow.task]]
id      = "api"
node    = "build-box"
target  = "/srv/api"
prompt  = "/indra full security review of {target}"
retries = 1                              # one more attempt if it fails

[[workflow.task]]
id     = "web"
node   = "local"                         # the default
target = "../web"                        # local targets are relative to indra.toml
prompt = "/indra full security review of {target}"

[[workflow.task]]
id     = "summary"
target = "."
prompt = "Summarise tonight's reviews and list new critical findings."
needs  = ["api", "web"]                  # runs only if both succeed

Run one from the terminal (cron, CI) or from the console's Workflows page:

$ indra run nightly
17:01:29 workflow 'nightly' started
17:01:29 api                build-box    running  (process #1, attempt 1)
17:01:29 web                local        running  (process #2, attempt 1)
17:14:52 web                local        succeeded
17:21:07 api                build-box    succeeded
17:21:07 summary            local        running  (process #3, attempt 1)
17:23:40 summary            local        succeeded

17:23:40 workflow 'nightly' succeeded

Inputs. A workflow can ask for values when it runs, and its tasks use them as {input.NAME} in their prompt, target, profile or model:

[[workflow]]
name = "triage-pr"

[[workflow.input]]
name     = "pr"
label    = "Pull request"
required = true
pattern  = '[0-9]{1,9}'                  # text inputs may require a form
[[workflow.input]]
name = "target"
kind = "target"                          # one of the harness's targets
[[workflow.input]]
name    = "depth"
kind    = "choice"
options = [{ value = "", label = "auto" }, { value = "--tier=2", label = "standard" }]
[[workflow.input]]
name      = "dry_run"
kind      = "bool"
default   = "true"
when_true = "--dry-run"                  # what {input.dry_run} becomes when ticked
[[workflow.input]]
name = "profile"
kind = "profile"                         # a configured profile, or none

[[workflow.task]]
id      = "review"
target  = "{input.target}"
profile = "{input.profile}"
prompt  = "/sh-pr-review {input.pr} {input.depth} {input.dry_run}"

Kinds are text (the default), choice, bool, target and profile. Each value is checked when the workflow starts: required ones present, text matching its pattern and on one line, choices and targets among their options, profiles configured. An empty input leaves no gap in the prompt.

Built in: with the indra harness, three workflows are always there (a configured workflow of the same name replaces one): pr-review (pull request, checkout, profile, depth, fail-on, deep, dry run; dry run is on by default), security-review (codebase, optional focus such as since:main, profile) and threat-model (codebase, optional since:<ref> or design:<file>, profile). Run any workflow from Runs > Run a workflow or the Workflows page (both ask for its inputs), or from the terminal:

indra run pr-review --input pr=https://github.com/acme/shop/pull/7 --input target=$PWD --input depth=--tier=2
indra run                                # lists the workflows and their inputs (* required)

The graph editor. Workflows > New workflow (or Edit graph on a workflow) opens a canvas: drag tasks, skills, saved tasks and other workflows in from the palette (or select one and press Enter), drag from a step's right edge to another step to make it run after the first, and edit the selected step on the right. Remove a step with its Delete step button, the x on the selected step, or the Delete key (Undo brings it back); remove an arrow by selecting it and pressing Delete. Saving writes the same [[workflow]] TOML, with each step's position, so indra run and the text editor keep working.

Decisions, loops and schedules are drawn in the graph too:

Skills as steps. A step can run one of the harness's skills instead of a free prompt: drag it from Skills in the palette, or write skill = "<name>". For Claude Code it runs as the skill's slash command, /<skill> <prompt>, so prompt holds the skill's arguments (default {target}); other runners are told to use the skill.

[[workflow.task]]
id     = "recon"
skill  = "sh-security-review"
prompt = "{target} stage:recon"          # becomes: /sh-security-review {target} stage:recon

Saved tasks ([[component]] in the file) are tasks kept for reuse: a task, a skill step or a prompt with its profile, runner, node and target, that any workflow can drag in. A step that starts from one overrides any field, and changing the saved task changes every workflow that uses it. The editor's Save for reuse turns a step into one. (A task is one step of one workflow; a saved task is a template for steps. Where a step runs is its node and target, the repository or folder.)

[[component]]
name    = "review"
prompt  = "/indra full security review of {target}"
profile = "worker"
retries = 1

[[workflow.task]]
id        = "api"
component = "review"
node      = "build-box"
target    = "/srv/api"

Shell steps. A step with run runs a command instead of an agent: bash (else sh; PowerShell on Windows), in its target, on any node. It succeeds with exit code 0, and its output is what later steps and conditions see. No value is ever pasted into a command: inputs, the loop item and earlier results arrive as environment variables, so an input cannot change what runs.

[[workflow.task]]
id  = "test"
run = "cargo test 2>&1"
VariableWhat it holds
INDRA_INPUT_<NAME>an input's value (name in upper case)
INDRA_ITEMthe item of a foreach copy
INDRA_OUTPUT_<STEP>, INDRA_EXIT_<STEP>, INDRA_STATUS_<STEP>a finished step's output (last 8000 characters), exit code and state (- becomes _)
INDRA_TARGET, INDRA_NODE, INDRA_WORKFLOW, INDRA_STEPwhere and what is running

A command cannot contain {input.}, {item} or {steps.}; agent prompts can ({steps.test.output} writes an earlier step's result into the prompt). A node refuses shell steps with [local] shell_steps = false in its own indra.toml.

Schedules. schedule runs a workflow by itself while indra serve runs, in that computer's local time: standard cron (minute hour day month weekday), with ranges, lists, steps, names (mon, jan) and @hourly, @daily, @weekly, @monthly. Its inputs take their defaults, so give required ones a default; a run that cannot start is logged.

[[workflow]]
name     = "nightly"
schedule = "0 2 * * 1-5"                 # 02:00 on weekdays

If steps. An If step runs nothing: it checks a condition and answers yes or no. A step after it says which answer it follows with branch; the other side is skipped (without failing the workflow), and a step that both sides lead to runs after the side that ran.

[[workflow.task]]
id    = "passed"
needs = ["test"]
if    = "test.output contains 'test result: ok'"

[[workflow.task]]
id     = "ship"
needs  = ["passed"]
branch = "yes"
run    = "make release"

[[workflow.task]]
id      = "fix"
needs   = ["passed"]
branch  = "no"
profile = "worker"
prompt  = "The tests fail:\n{steps.test.output}\nFix the code."

[[workflow.task]]
id    = "report"
needs = ["ship", "fix"]                  # after whichever side ran
run   = "echo done"

Conditions and failure handling.

[[workflow.task]]
id            = "test"
run           = "cargo test 2>&1"
allow_failure = true                     # a failure here does not fail the workflow

[[workflow.task]]
id      = "fix"
needs   = ["test"]
when    = "test.failed and input.autofix == 'true'"
profile = "worker"
prompt  = "The tests fail:\n{steps.test.output}\nFix the code."

[[workflow.task]]
id    = "tell"
needs = ["fix"]
on    = "failure"                        # only if something it needs failed
run   = "echo \"fix failed: $INDRA_OUTPUT_FIX\" | mail -s ci team@example.com"

[[workflow.task]]
id    = "clean"
needs = ["test", "fix"]
on    = "always"                         # once they finish, however they went
run   = "rm -rf target/tmp"

Stop steps end the workflow early, as a success or a failure. One is usually guarded by a condition; when it is reached, steps that have not started are skipped and running ones are stopped. In the editor it is the Stop block, and the graph is drawn between a Start and an End block (Start leads to the steps that need nothing, the steps nothing needs lead to End).

[[workflow.task]]
id     = "nothing-to-fix"
needs  = ["test"]
when   = "test.succeeded"
stop   = "success"                       # or "failure"
prompt = "Tests pass; nothing to fix."   # shown on the run page

Targets. In indra.toml, a step on this machine without a target runs in the harness's first target (the folder the Terminal page shows); in a repository's workflow file, in that repository. A step on another node needs its target.

Loops.

[[workflow.task]]
id      = "lint"
foreach = ["api", "web", "worker"]       # or "{input.services}": commas or new lines
run     = "make -C services/$INDRA_ITEM lint"

[[workflow.task]]
id       = "make-green"
prompt   = "Run the tests and fix what fails."
until    = "self.output contains 'all tests pass'"
max_runs = 3                             # default 3, at most 20

Create a workflow from a description. Workflows > Create with Claude: describe what it should do and where to save it, and Claude Code builds it with indra's MCP server. It reads the format and this machine's profiles, nodes, repositories and skills, looks at the repository if it needs to (build and test commands), validates the workflow until it is right, and saves it; the page then offers it in the editor. Claude Code runs with only the indra tools and read-only file tools allowed; anything else it asks for waits for your answer on its process page.

indra mcp is that MCP server, for any MCP client. In your own Claude Code:

claude mcp add indra -- indra mcp        # then: "make me a workflow that ..."

Its tools: workflow_guide (the format and what this machine has), list_workflows, get_workflow, validate_workflow (checked exactly as indra serve loads it) and save_workflow (to indra.toml, keeping its comments, or to a repository's .indra/workflows/). It never runs a workflow or a command.

Workflows as code. A workflow can live in the repository it works on, as .indra/workflows/<name>.toml, to be reviewed, committed and shared like any other code. Every console and indra run with that repository as a harness root or target picks it up, and a git pull that changes the files is seen without a restart.

# api/.indra/workflows/triage.toml
[[workflow]]
name = "triage"

[[workflow.task]]
id      = "recon"
skill   = "sh-security-review"
prompt  = "{target} stage:recon"
profile = "planner"                      # a built-in profile, so it works for everyone

[[workflow.task]]
id        = "lint"
component = "lint"                       # a saved task kept in the same file
needs     = ["recon"]

[[component]]
name   = "lint"
prompt = "Run the linters on {target} and fix what they report."

Workflows compose. A task with workflow = "<name>" runs that workflow as one step: its first tasks start after the step's needs, and anything that needs the step waits for its last tasks. Its tasks show up as <step>__<task> in the run. A workflow cannot include itself.

indra run exits 0 only if every task succeeded; Ctrl-C cancels the run and stops its agents. indra run without a name lists the configured workflows.

The Workflows page also has fan-out: one prompt across any set of targets on any nodes, in parallel within each node's capacity. That is the quickest way to review ten repositories spread over three machines.

How remote execution stays safe

Remote nodes need a POSIX shell (Linux, macOS, BSD). local works everywhere.