Skip to content
OpenTrain AIOpenTrain AIOpenTrain AIDocs

Ask OpenTrain

Answers from the documentation, with sources.

What would you like to do with OpenTrain?

AI answers can be mistaken. Check the linked sources. Don’t include private account information.

Open app

DEVELOPER DOCUMENTATION

Apply a Job Instruction Tree

Atomically apply the exact complete page tree approved by preflight.

POST/api/public/v1/instructions/jobs/{jobId}/tree/apply

Applies the exact desired tree approved by tree preflight. Requires instructions:write, employer access, the unchanged preflight request, the exact returned archivedPageIds, its preflightToken, and confirmLive: true.

The request fails on page, checksum, archive-set, or live-tree drift. A successful response returns the canonical page IDs and checksums, exact employer URL, resulting tree checksum, and atomicVisibility: true. Workers do not see an intermediate partially assembled hierarchy.

Use the same idempotency key for an uncertain retry. The response reports when the exact desired state was replayed or had already converged.