---
title: "Persist in-flight coordinator state (internal)"
method: PUT
path: "/appModeling/run/{application_id}/inflight"
tags: ["AppModeling"]
---

# Persist in-flight coordinator state (internal)

`PUT /appModeling/run/{application_id}/inflight`

Writes the active inner session ID, last executeAppModeling messages, and batch cursor
so a pod restart can resume. Called internally by the TypeScript
persistAppModelingInFlightState handler.

## Path parameters

- `application_id` string, required

## Query parameters

- `workspaceId` string, required

## Request body

- AppModelingInFlightStateInternalRequest — Request body to persist in-flight coordinator state.
  - `active_inner_session_id` string, required — The inner AMA session ID currently being driven.
  - `last_inner_messages` object[] — The new_messages returned by the most recent executeAppModeling turn.
  - `batch_cursor` integer, required — Current batch cursor.
  - `last_kg_row_count` integer — The kg_row_count observed after the most recent executeAppModeling turn.
  - `stall_reinvoke_count` integer — Consecutive re-invocations so far with no net-new KG rows for this inner session.
  - `test_invariant_ids` string[] — Test invariant IDs of the batch being processed, persisted so a resumed coordinator pod can mark the batch complete instead of re-dequeuing/re-modeling it.

## Response `200`

In-flight state persisted

- AppModelingInFlightStateInternalResponse — Response from the internal persist in-flight state endpoint.
  - `ok` boolean, required — Always true on success.

## 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)
