Skip to main content
Version: 3.0.0

Run a workflow

This page is how you start a workflow and follow the execution it creates. There are two paths. orca run is the simple one: fire-and-forget a single-group, standalone submission. Multi-group and batched submissions drop down to orca submission submit. Both shapes are explained on Submissions.

orca run​

orca run <workflow> --run-mode <CHECK_RUN|SIM|LIVE> [options]

A run mode is required on every submission. There is no deployment-level fallback and no default. Omitting --run-mode exits 2.

Run modeWhat it means
CHECK_RUNEvery device runs its simulator inside Orca. No orca-client is needed and nothing waits. It works on a copy of the plate record.
SIMEvery device runs its simulator on its orca-client. No hardware moves. Steps wait, sped up.
LIVEEach device runs as its own sim or live setting (orca device mode).

See Run modes.

One run mode at a time. A run in a different mode from a run that is still going is refused with other_run_mode_active, and the refusal names the run to wait on. A check run starts only while no other run is running. Two LIVE runs together are fine, and so are two SIM runs.

A SIM or LIVE run brings up every device and transporter before it is accepted. If one is not ready the run is refused with devices_not_ready, naming each device and why.

Quick patterns​

# Fire-and-forget
orca run smc_assay --run-mode CHECK_RUN

# Block until terminal, give up after 2 minutes
orca run smc_assay --run-mode CHECK_RUN --wait --timeout 120

# Pass workflow variables
orca run smc_assay --run-mode SIM --vars plate_count=2,reagent_batch=L7

# Load a saved profile
orca run smc_assay --run-mode LIVE --profile high_throughput

# Simulate at ten times real speed, to watch the run unfold
orca run smc_assay --run-mode SIM --sim-speedup 10

Flags​

FlagRequired?Effect
--run-modeyesCHECK_RUN / SIM / LIVE. No default.
--waitnoBlock until the execution is terminal (completed / partial_completed / failed / aborted).
--timeout <s>with --waitSeconds before the CLI gives up. Default 300. The execution keeps running; the timeout only stops the CLI waiting. Exit 50.
--poll <s>with --waitPolling interval. Default 0.5.
--vars KEY=VAL,KEY2=VAL2noPer-submission variable overrides. See typing below.
--profile <name>noThe name of a saved deployment profile. Its values load into the run before any thread starts. orca profiles manages them.
--sim-speedup <n>noHow many times faster than real time a SIM run goes, 0.1 to 1000. 1 is real time, 10 is ten times faster. Omit it for the daemon's default, which is 100 unless ORCA_SIM_SPEEDUP is set. A LIVE run and a check run refuse it with sim_speedup_not_applicable. See Simulated speed.

| --reason | no | Written on the submission's audit row. Every submission writes one. |

--vars values are typed best-effort, in this order: true or false (case-insensitive) becomes a bool, then an integer parse, then a float parse, and anything left over stays a string. So plate_count=2 is an int, dry_run=TRUE is a bool, and reagent_batch=L7 is a string. An entry with no = exits 2.

Output​

$ orca run smc_assay --run-mode CHECK_RUN
submitted execution 7a3f1c0e (smc_assay)

With --wait the CLI polls until terminal, then prints a key-value summary:

execution 7a3f1c0e
workflow: smc_assay
status: completed
error:

The --json shapes differ between the two paths. Without --wait you get the submit response: execution_id, run_mode, group_count, batch_mode, submitted_at, sim_speedup and unsettled. With --wait you get the execution detail from the final poll, the same shape orca execution detail returns.

--wait exits 1 when the execution reaches a terminal state that is not completed, so a failed run is a failed command.

--wait and an error-paused thread​

An action error whose failure policy is PAUSE parks the labware thread and waits for an operator. The execution never reaches a terminal state on its own, so a naive poll would burn the whole timeout.

--wait detects this and fails fast with exit 31, naming the thread, the device call it was inside, the error, and the recovery command:

error: execution 7a3f1c0e has an error-paused thread 22b9d1a4 (sample_plate)
while running device call 'shake': device did not respond.
Recover with `orca execution thread recover <exec-id> <thread-id>
<retry|retry-action|continue|abort-action|abort-method|abort-thread>`.

See Recover from errors for what each recovery decision does, and Failure policies for what makes a thread pause in the first place.

Pitfalls​

  • --wait --timeout 60 is not a kill switch. It abandons the CLI's poll loop; the execution keeps running. To actually stop one, use execution stop.
  • --run-mode LIVE does not make a device live. Each device runs as its own setting, and a new device is sim. Check with orca device list and switch with orca device mode <name> LIVE.
  • --profile takes a name, not a path. Save the profile first with orca profiles create.
  • --vars is per-submission. It overrides defaults declared on the workflow's variables. To set a default for every future submission, use var set-global. The resolution order is on Variables.

orca submission submit: multi-group and batched​

run is single-group and STANDALONE. For anything richer, use submission submit. What a labware group and a batch mode do to labware sharing is on Submissions.

# Multi-group: N samples per submission, each in its own group
orca submission submit smc_assay --run-mode CHECK_RUN \
--groups-file groups.json

# Batched: join an in-flight accepting execution of the same workflow
orca submission submit smc_assay --run-mode SIM \
--groups-file groups.json --batch-mode JOIN_EXISTING

The workflow name is a positional argument, not --workflow. The group spec is a plain path via --groups-file, or inline JSON via --groups-json; there is no @file syntax. The content is a single group object or a JSON array of them.

FlagEffect
<workflow> (positional)The registered @orca.workflow template name.
--run-modeSame as run. Required.
--groups-file <path>Multi-group spec file: one group object or a list of them.
--groups-json <json>The same spec inline as a JSON string. Mutually exclusive with --groups-file.
--batch-mode STANDALONE|JOIN_EXISTINGDefault STANDALONE. Any other value exits 2.
--vars KEY=VAL,...Submission-scope variable overrides. Same typing rules as run.
--operator-id <id>Optional operator id recorded on the submission.
--profile <name>The name of a saved deployment profile, loaded into the run. Same as run.
--sim-speedup <n>Simulated speed-up, same as run. A submission that joins a run goes at that run's speed; change it with execution sim-speedup.

| --reason | Optional. Written on the submission's audit row, same as run. |

A group looks like this:

{
"id": "batch-1",
"members": [
{"thread_template_name": "sample_plate", "acquisition": {"kind": "pool"}},
{"thread_template_name": "tip_rack",
"acquisition": {"kind": "location", "source_location": "stack_1"}},
{"thread_template_name": "index_plate",
"acquisition": {"kind": "barcode", "barcode": "IDX-7"}}
]
}

An acquisition is pool (a new labware), location (the labware standing at source_location) or barcode (the registered labware with that barcode). A barcode acquisition on a partner thread names the labware that must serve this group's steps. See Submissions.

Submitting with zero groups is the same one-shot path orca run takes.

Confirmation​

submission submit prompts before it submits, unlike orca run:

Submit workflow 'smc_assay' with 2 group(s), batch_mode=STANDALONE? [y/N]:

Pass --force (--yes, -y) to skip it. Declining exits 40, and so does a non-TTY stdin with no --force.

What it prints on acceptance​

submission 4c1e77a2 accepted (execution=7a3f1c0e, groups=2)
3 thing(s) nobody has settled. Nothing is blocked; settle what this run depends on:
tip_rack_1: nothing has ever said what 'tip_rack_1' holds, which is not the same as empty
settle with: set-tip-state
ml_star: what 'ml_star' is carrying was known, then nobody was watching
settle with: confirm-mounted-tips
assay_plate_2: an action that has not finished did things to what 'assay_plate_2'
holds, and the record only hears about them when the action ends; settle the
action (retry, continue, or abort) rather than confirming or restating this

The unsettled list prints here because this is the moment somebody is looking. Nothing in it blocks the submission. The same list is available any time from orca state unsettled. See State.

Each line names the subject and why the record cannot answer for it. The second line is the verb that settles it, and which verb it names is the useful part:

  • confirm-* means the record is still the best value there is, and you are agreeing with it after a look. A rack that merely went unwatched gets confirm-tip-state, not a demand that you retype ninety-six positions the record already has right.
  • set-* means there is nothing worth agreeing with. Three cases produce it: nobody ever said, an aborted action threw away work so the record is short by an amount nothing can state, or the record holds nothing the confirm verb could back.
  • No second line at all means no verb answers, as on assay_plate_2 above. An unfinished action is holding operations: confirming would freeze a number that is behind, and stating one is worse, because the action's own operations get folded on top when it ends. Settle the action instead, with retry, continue or abort. See Recover from errors.

In --json, each row also carries subject_id. Labware verbs take a labware id and two live instances can share a name, so act on the id rather than re-looking-up the name.

List and detail​

orca submission list                           # all submissions on this runtime
orca submission list --execution <exec-id> # one execution's submissions
orca submission detail <submission-id> # one submission

list prints id, execution, workflow, group count, status, batch mode and submission time. detail adds the operator id and the deployment profile. Both id arguments accept a prefix of 4 or more characters.

Pitfalls​

  • JOIN_EXISTING with nothing live starts a fresh execution. It is not an error. The join only happens when an execution of the same workflow is already accepting; otherwise the submission boots its own.
  • JOIN_EXISTING is refused against an execution that is draining or stopping, and the refusal tells you to resubmit as STANDALONE or wait for the current one to terminate.
  • JOIN_EXISTING is refused against a paused execution. A pause gates new work, and queuing behind it would hide the submission. Resume first.
  • One execution carries one run mode. Joining an execution submitted under a different --run-mode is refused rather than mixing dispatch routes inside one run.
  • Groups are independent within a submission. Each group gets its own thread spawns. Groups whose labware templates declare SHARED_ACROSS_GROUPS converge on shared physical labware, so read the template flags before assuming isolation. See Submissions.

Run one method in isolation​

To exercise a single method without its surrounding workflow (testing, recovery rehearsal), use method execute:

orca method execute <workflow> <method> \
--labware-start '{"sample_plate": "stack_1"}' \
--labware-end '{"sample_plate": "stack_2"}' \
--run-mode CHECK_RUN [--vars '{"plate_count": 2}'] [--profile <name>] \
[--hook <event> ... | --no-hooks]

The workflow and method names are positional. --labware-start and --labware-end are required JSON objects mapping labware name to location name. --run-mode is required, with the same modes as run. Note that method execute --vars takes a JSON object, not the KEY=VAL form the other two verbs take. --profile applies a saved deployment profile, as on run.

The run fires the workflow's wf.on(event, handler) handlers, so the method behaves as it does inside the workflow. Choose which with the event name:

  • No flag: every handler.
  • --no-hooks: none.
  • --hook ACTION.COMPLETED --hook CUSTOM.read_done.EMITTED: only the handlers for those events.

An event the workflow has no handler for is refused, and the error lists the events it does have. Over REST the same choice is the event_hooks field of POST /api/method-executions: omitted, [], or a list of event names.

Track an execution​

Once submitted, these read-only verbs follow its progress. Mid-flight inspection goes further: where every plate is, what is in it, and who is holding which device.

orca execution list                                    # all executions
orca execution detail <id> # full snapshot
orca execution threads <id> # thread roll-up
orca execution thread detail <id> <thread-id> # one thread, all fields

execution list takes no filters. It lists every execution known to the loaded system as id, workflow, status, paused and error. Narrow it yourself with --json | jq if the count is large.

execution detail <id> prints workflow, status, paused, error and the three thread counts (total, active, completed). Every id argument accepts a prefix of 4 or more characters, and execution ids also accept last.

execution threads <id> prints id, name, status, completed-method count and the current method for each thread in the execution.

execution thread detail <id> <thread-id> prints the per-thread snapshot: name, status, current location, current method, current action, completed methods, and the pause fields (pause_reason, last_error, pause_message, pause_site, honoured_decisions, paused_device_command).

Status vocabulary​

Both list and detail report the same value, and it comes from one of two vocabularies depending on where the row was read from.

While the runtime owns the execution, the status is its phase:

PhaseMeaning
acceptingLive, and open to further JOIN_EXISTING submissions.
drainingclose was called. No new submissions; running threads finish.
stoppingA confirmed stop is unwinding the execution. Non-terminal; it becomes aborted once the task fully unwinds.
completedEvery thread terminal, no crash and no abort.
partial_completedThe operator aborted some threads and at least one completed.
failedA thread crashed with an unhandled error.
abortedTerminal via a confirmed stop, via unload, or when every thread was aborted.

An execution rehydrated from a terminal database row reports the flatter task state instead: running, completed, partial_completed, failed or aborted.

Pause is a latch, not a status​

A pause never changes the status. A paused execution stays accepting or draining, so the status column alone reads as if the stop never landed. That is what the separate paused column is for:

id        workflow   status     paused                          error
7a3f1c0e smc_assay accepting paused (operator), abort armed

paused (operator) means an operator set the latch; paused (system) means the runtime paused itself. abort armed means a second confirmed stop would abort the execution.

Error-paused threads are separate again. execution detail prints a block per error-paused thread under the summary, carrying the last error, the pause message, the action it stopped in, the pause site, the recovery decisions that site will honour, the device call it was inside, and the ready-to-run execution thread recover command line.

Stopping and closing​

orca execution close <id> moves an execution from accepting to draining: no new JOIN_EXISTING submissions, live threads run to completion. It prompts unless you pass --force. Standalone submissions for the same workflow still boot a fresh execution afterwards.

orca execution stop <id> is a two-call confirmed abort. The first call pauses the execution and arms the abort, and is undone by orca execution resume. A second call with --confirm performs the abort. It is documented in full on Operator interventions.

Pitfalls​

  • list returns every execution, terminal ones included, with no server-side filters. Pipe --json through jq to narrow by status.
  • thread detail returns only the per-thread snapshot. Variables and reservations live on the parent; use execution detail <id> for those.

See also​