---
title: "Get coordinator run state (internal)"
method: GET
path: "/appModeling/run/{application_id}/state"
tags: ["AppModeling"]
---

# Get coordinator run state (internal)

`GET /appModeling/run/{application_id}/state`

Returns the coordinator run state for the given application. Called internally by the
TypeScript getAppModelingRunState handler to delegate coordinator bookkeeping to the
Java service layer.

## Path parameters

- `application_id` string, required

## Query parameters

- `workspaceId` string, required

## Response `200`

Current coordinator run state

- AppModelingRunState — Coordinator run state for an app modeling run.
  - `run_status` 'IDLE' | 'RUNNING' | 'COMPLETED' | 'ERROR', required — Lifecycle status of an app modeling run.
  - `frontier_exhausted` boolean, required — Whether every item in the work frontier has been attempted.
  - `batches_processed` integer, required — Number of batches that have been marked complete.
  - `active_inner_session_id` string — The inner AMA session ID currently being driven, if any.
  - `resume_state` AppModelingResumeState — Persisted in-flight state for resuming a coordinator pod after restart.
    - `active_inner_session_id` string, required — The inner AMA session ID being driven.
    - `last_inner_messages` AgentSessionMessage[] — The new_messages returned by the most recent executeAppModeling turn.
      - union
        - BaseMessage
          - `id` string, required — The id of the message
          - `message_index` integer — The index of the message in the session (used for ordering)
          - `timestamp` integer, required — The timestamp of the message in epoch milliseconds
          - `metadata` object — The metadata of the message
          - `parts` MessagePart[], required
            - union
              - …
          - `role` 'user' | 'model' | 'tool_output' | 'special', required
        - BaseMessage
          - `id` string, required — The id of the message
          - `message_index` integer — The index of the message in the session (used for ordering)
          - `timestamp` integer, required — The timestamp of the message in epoch milliseconds
          - `metadata` object — The metadata of the message
          - `parts` MessagePart[], required
            - union
              - …
          - `role` 'user' | 'model' | 'tool_output' | 'special', required
        - BaseMessage
          - `id` string, required — The id of the message
          - `message_index` integer — The index of the message in the session (used for ordering)
          - `timestamp` integer, required — The timestamp of the message in epoch milliseconds
          - `metadata` object — The metadata of the message
          - `parts` MessagePart[], required
            - union
              - …
          - `role` 'user' | 'model' | 'tool_output' | 'special', required
        - BaseMessage
          - `id` string, required — The id of the message
          - `message_index` integer — The index of the message in the session (used for ordering)
          - `timestamp` integer, required — The timestamp of the message in epoch milliseconds
          - `metadata` object — The metadata of the message
          - `parts` MessagePart[], required
            - union
              - …
          - `role` 'user' | 'model' | 'tool_output' | 'special', required
    - `batch_cursor` integer, required — Index into the current batch, for ordered resume.
    - `last_kg_row_count` integer — The kg_row_count observed after the most recent executeAppModeling turn. Persisted so a pod restart resumes stall detection from where it left off instead of resetting the no-progress counter to zero.
    - `stall_reinvoke_count` integer — Number of consecutive executeAppModeling re-invocations that produced no net-new KG rows for this inner session. Persisted alongside last_kg_row_count so it survives a pod restart mid-batch.
    - `test_invariant_ids` string[] — Test invariant IDs of the batch being processed. Persisted so a resumed coordinator pod can call markBatchComplete for the batch instead of re-dequeuing and re-modeling it (which would otherwise loop, never marking the batch's tests ATTEMPTED).
  - `kg_row_count` integer — Current count of this app's active KG rows (nodes + edges + external refs). A read-only progress signal: the coordinator compares this value across executeAppModeling re-invocations to detect a stalled inner session (see AppModelingResumeState.last_kg_row_count). Counts only — never inspects what was written.
  - `budget_capped` boolean — True if this run completed by hitting the MAX_BATCHES budget ceiling with the work frontier not yet exhausted (a truncated run), false otherwise. Surfaced from the persisted run_metrics so a bound-out is observable and not mistaken for a full drain.

## Other responses

- `400` — Invalid or missing parameter
- `401` — User not authenticated
- `404` — Coordinator row not found for this application
- `default` — Unknown error

---

[API](https://skmtc.net/mabl/apis/mabl-api.md) · [All operations](https://skmtc.net/mabl/apis/mabl-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mabl/mabl-api/revisions/d0fc0114da66/schema)
