ArkRun

ArkRun is an immutable execution record for one ArkTeam pipeline trigger — step outputs, token usage, timestamps, and final result.

API: arkonis.dev/v1alpha1 Kind: ArkRun Short name: aorun Scope: Namespaced

ArkRun is an immutable record of one pipeline execution. Each time an ArkTeam pipeline is triggered — via ark trigger, an ArkEvent, or the dashboard — a new ArkRun is created automatically.

The ArkTeam defines what to run; the ArkRun records what happened: which steps ran, what each agent produced, how many tokens were consumed, and whether the run succeeded or failed.


What ArkRun contains

  • A snapshot of the ArkTeam spec at trigger time — stable even if the team is later updated.
  • The resolved input for this run (team defaults merged with trigger overrides).
  • Per-step execution state: phase, task ID, raw output, timestamps, token usage.
  • The final output once the pipeline succeeds.
  • Total token usage across all steps.

ArkRun.spec is written once and never mutated. spec.teamGeneration records which team spec was in effect.


Listing runs

# All runs in a namespace
kubectl get arkrun -n my-org

# Runs for a specific team
kubectl get arkrun -n my-org -l arkonis.dev/team=blog-pipeline

# NAME                           TEAM            PHASE       TOKENS   STARTED   AGE
# blog-pipeline-run-a1b2c3      blog-pipeline   Succeeded   6160     5m        5m
# blog-pipeline-run-d4e5f6      blog-pipeline   Failed      1204     1h        1h

Find the most recent run via the team status:

kubectl get arkteam blog-pipeline -n my-org \
  -o jsonpath='{.status.lastRunName}'

Inspecting a run

kubectl describe arkrun blog-pipeline-run-a1b2c3 -n my-org

Key fields in status:

status:
  phase: Succeeded
  startTime: "2026-03-17T10:00:00Z"
  completionTime: "2026-03-17T10:00:45Z"
  output: "Transformers use self-attention mechanisms to..."
  steps:
    - name: researcher
      phase: Succeeded
      taskID: "1710000001-0"
      output: "Research findings: ..."
      tokenUsage:
        inputTokens: 320
        outputTokens: 1240
        totalTokens: 1560
    - name: writer
      phase: Succeeded
      taskID: "1710000013-0"
      output: "Transformers use self-attention..."
      tokenUsage:
        inputTokens: 1240
        outputTokens: 3360
        totalTokens: 4600
  totalTokenUsage:
    inputTokens: 1560
    outputTokens: 4600
    totalTokens: 6160

Run phases

PhaseMeaning
PendingRun created; waiting for the controller to start executing steps.
RunningOne or more steps are in progress.
SucceededAll steps completed. status.output is populated.
FailedA step failed, budget was exceeded, or the run timed out.

Retrying

Use ark trigger to create a new run. The old run is preserved.

# Same input
ark trigger blog-pipeline -n my-org

# Different input
ark trigger blog-pipeline -n my-org --input '{"topic": "attention mechanisms"}'

To retry only the failed steps of an existing run (preserving succeeded steps):

ark retry blog-pipeline -n my-org

Spec reference

spec

spec is a snapshot written at trigger time and never mutated.

FieldTypeDescription
teamRefstringName of the parent ArkTeam.
teamGenerationint64ArkTeam.metadata.generation at trigger time.
inputmap[string]stringResolved input: team spec.input defaults merged with per-trigger overrides.
pipeline[]PipelineStepSnapshot of ArkTeam.spec.pipeline at trigger time.
roles[]RoleSpecSnapshot of ArkTeam.spec.roles at trigger time.
outputstringGo template expression for the final result.
timeoutSecondsintMaximum wall-clock seconds. Zero means no timeout.
maxTokensint64Total token budget across all steps. Zero means no limit.

status

FieldTypeDescription
phasestringPending | Running | Succeeded | Failed
steps[]StepStatusPer-step execution state.
outputstringResolved final output once phase is Succeeded.
startTimeTimeWhen the run began executing.
completionTimeTimeWhen the run reached a terminal phase.
totalTokenUsageTokenUsageSum of token usage across all steps.
observedGenerationint64.metadata.generation this status reflects.
conditions[]ConditionStandard conditions.

status.steps[]

FieldTypeDescription
namestringRole name matching spec.pipeline[].role.
phasestringPending | Running | Succeeded | Failed | Skipped
taskIDstringRedis Streams message ID. Use with ark trace to look up the OTel trace.
outputstringRaw text output from the agent.
outputJSONstringParsed JSON output when the step has outputSchema.
startTimeTimeWhen the step task was submitted to the queue.
completionTimeTimeWhen the step reached a terminal phase.
messagestringHuman-readable detail for failures.
iterationsintNumber of loop iterations completed (for steps with loop).
tokenUsageTokenUsageToken usage for this step.

TokenUsage fields

FieldTypeDescription
inputTokensint64Prompt tokens consumed.
outputTokensint64Completion tokens produced.
totalTokensint64inputTokens + outputTokens.

Printer columns

ColumnJSONPath
Team.spec.teamRef
Phase.status.phase
Tokens.status.totalTokenUsage.totalTokens
Started.status.startTime

Run history and cleanup

Retention is controlled on the parent ArkTeam:

Team fieldDefaultEffect
spec.successfulRunsHistoryLimit10Keep last N successful runs.
spec.failedRunsHistoryLimit3Keep last N failed runs.
spec.runRetainForunsetDelete runs older than this duration.

See also