/** * Single source of truth for play submit-path size/wait limits. * * Dependency-free leaf shared by the Next.js run route * (`POST /api/v2/plays/run`), the Cloudflare coordinator's workflow retry-state * codec, and the limits documentation generator. These bound what a single * submission may carry inline, the hard ceiling on submitted input, and how * long the API will block for a synchronous result. */ /** * Max size of a CSV/file input that may be inlined into the submit payload * (and the workflow event history). Larger inputs must be staged via * `POST /api/v2/plays/files/stage` and referenced by handle. */ export const MAX_SUBMITTED_INLINE_INPUT_FILE_BYTES = 64 * 1024; /** * Max time the run route will block waiting for a play to finish before * returning a pending handle the caller can poll/stream. */ export const MAX_WAIT_FOR_COMPLETION_MS = 15_000; /** * Submitted input/retry-state at or below this size stays inline in the * coordinator Durable Object. Above it, the params are externalized to a * short-lived play artifact (up to {@link PLAY_SUBMIT_INPUT_MAX_BYTES}). */ export const PLAY_SUBMIT_INPUT_INLINE_MAX_BYTES = 100_000; /** * Absolute ceiling for submitted input/retry-state. A submission larger than * this is rejected with guidance to use staged files or `ctx.csv` inputs. */ export const PLAY_SUBMIT_INPUT_MAX_BYTES = 1024 * 1024;