---
title: "Publish drained execution result and workspace atomically before cleanup"
method: POST
path: "/api/v1/agent/persistent/scheduler/checkpoint_compute"
tags: ["agent", "Persistent agents"]
---

# Publish drained execution result and workspace atomically before cleanup

`POST /api/v1/agent/persistent/scheduler/checkpoint_compute`

## Request

- Base URL: `https://composal.com` (the document declares no server; this is the origin it was published from)
- URL: `https://composal.com/api/v1/agent/persistent/scheduler/checkpoint_compute`
- Auth: HTTP bearer

Private Activity/executor data only. Current Rails/Git authority is required; never put credentials, snapshots or results into Temporal Workflow payloads or heartbeats.

## Request body

- PersistentAgentComputeCheckpointRequest
  - `organization_id` string, required
  - `agent_id` string, required
  - `task_id` string, required
  - `first_execution_run_id` string, required
  - `scope` PersistentAgentWorkerScope, required
    - `task_id` string, required
    - `segment_id` string, required
    - `generation` integer, required
    - `claim_id` string, required
  - `plan_id` string, required
  - `expected_head` string, required
  - `operation_key` string, required
  - `snapshot` PersistentAgentWorkspaceSnapshot, required: Bounded portable snapshot: exact declared file order, at most 512 KiB decoded total and 1 MiB canonical JSON. No image/runtime authority or provider allocation is stored.
    - `schema` 1, required
    - `spec` PersistentAgentWorkspaceSpec, required
      - `task_id` string, required
      - `configuration_commit` string, required
      - `image` string, required: Explicit nonmoving provider image version; the trusted runtime independently verifies the applied image.
      - `setup_digest` string, required
      - `durable_paths` string[], required: Sorted relative regular-file paths; no overlaps, credentials or reserved paths.
    - `files` PersistentAgentWorkspaceFile[], required
      - `path` string, required
      - `mode` 384 | 448, required
      - `size` integer, required
      - `sha256` string, required
      - `content` string, required: Canonical strict base64; decoded bytes must match size and sha256.
  - `result` object, required
    - `text` string, required
    - `truncated` boolean, required
  - `source` PersistentAgentWorkspaceSource, required
    - `sequence` integer, required
    - `sha256` string, nullable, required

## Response `200`

Validated private exchange

- PersistentAgentComputeCheckpointReceipt
  - `scope` PersistentAgentWorkerScope, required
    - `task_id` string, required
    - `segment_id` string, required
    - `generation` integer, required
    - `claim_id` string, required
  - `completion` PersistentAgentComputeResult, required
    - `schema` 1, required
    - `scope` PersistentAgentWorkerScope, required
      - `task_id` string, required
      - `segment_id` string, required
      - `generation` integer, required
      - `claim_id` string, required
    - `plan_id` string, required
    - `seed_digest` string, required
    - `workspace_digest` string, required
    - `result` object, required
      - `text` string, required
      - `truncated` boolean, required
  - `version` string, required

## Other responses

- `401`: Credential unavailable or revoked
- `403`: Current authority unavailable
- `404`: Task unavailable
- `409`: Reconciliation required
- `422`: Invalid request
- `502`: Bad gateway
- `503`: Canonical state temporarily unavailable

---

[API](https://skmtc.dev/composal/apis/vex-api.md) - [All operations](https://skmtc.dev/composal/apis/vex-api/llms.txt) - [OpenAPI document](https://skmtc.dev/composal/apis/vex-api/revisions/74298a24e040?raw)
