Drafts API
These routes keep a flow’s canvas edits in a draft and put them Live with Publish. Live is what the prediction API, embeds, shared links, MCP, schedules and webhooks run. The draft is what the canvas and its test chat show. How drafts look in the app: Drafts and Publish. History of each Publish and Roll back: History API.
Drafts are on by default. CUTTLELY_DRAFTS=off (also false, 0, or no) turns them off; any other value, or no value, leaves them on. See History settings. With drafts off, every route below except GET refuses with 409 Drafts are off on this server., and the canvas saves straight to Live.
All routes are under /api/v1/flow-drafts. Use a signed-in session for draft edits, publication and checks. New scoped access keys may read granted flow drafts with api:read and the required workspace permission; they cannot write drafts, publish, roll back or invoke test/check routes. Retained legacy keys keep their existing permission-based compatibility below. Access-key route matrix. The flow must be in the caller’s active workspace; any other flow id returns 404. The route lets in a caller with chatflows:* or agentflows:* for that action, and then checks the permission for the flow’s own type. A chatflow, a harness, a pipeline, and a flow with no stored type use chatflows:*. An agentflow and a legacy multi-agent canvas use agentflows:*. An assistant uses assistants:*, and the route gate above still applies, so an assistant-only key is refused before that check. Without the type’s key the route returns 403. With an API key, a harness canvas also needs its name on the key’s harness list for every route here, and a draft that names a harness off that list, anywhere in the canvas, is refused (403). The publish check replays each question for the caller that started it, so a key’s check runs only harnesses on its list.
| Method | Route | Permission |
|---|---|---|
GET |
/:chatflowId |
chatflows:view or agentflows:view |
PUT |
/:chatflowId |
chatflows:update or agentflows:update |
DELETE |
/:chatflowId |
chatflows:update or agentflows:update |
PUT |
/:chatflowId/settings |
chatflows:update or agentflows:update |
POST |
/:chatflowId/publish |
chatflows:update or agentflows:update |
POST |
/:chatflowId/rollback |
chatflows:update or agentflows:update |
GET |
/:chatflowId/check |
chatflows:view or agentflows:view |
GET |
/:chatflowId/check/history |
chatflows:view or agentflows:view |
POST |
/:chatflowId/check |
chatflows:update or agentflows:update |
GET |
/:chatflowId/check/:checkId |
chatflows:view or agentflows:view |
DELETE |
/:chatflowId/check/:checkId |
chatflows:update or agentflows:update |
Kinds on these routes
Section titled “Kinds on these routes”Every route in the table above is registered for any flow id. What it does depends on the stored type.
| Stored type | Kind | Type permission | Draft routes | Check routes |
|---|---|---|---|---|
CHATFLOW, or no type |
Chatflow | chatflows:view on a GET, chatflows:update on a write |
Save a draft | Replay recent questions. There is no Start input. datasetId is accepted. |
AGENTFLOW |
Agentflow | agentflows:view or agentflows:update |
Save a draft | Replay by Start input. See the next table. |
HARNESS |
Harness | chatflows:view or chatflows:update |
Save a draft | Replay recent questions: the full prompts saved for the harness. A canvas whose harness file belongs to another team gets no questions. Another team’s harness is a 404. datasetId is accepted. |
ETL |
Pipeline | chatflows:view or chatflows:update |
Save a draft | No replay. The Publish dialog is a change list only. GET .../check returns unavailable.code type. POST .../check is 409 The check works on chatflows and agentflows. |
MULTIAGENT |
Legacy multi-agent canvas, including a sequential-agent graph | agentflows:view or agentflows:update |
Save a draft | The same refusal as a pipeline. The dialog still shows the box, with that message. |
ASSISTANT |
Assistant | assistants:view or assistants:update, after the route gate |
No drafts. PUT save is 409 This kind of flow saves straight to Live. GET returns "mode": "live" and "reason": "type". |
The same refusal as a pipeline. |
Draft routes are status, save, discard, settings, publish, and rollback. Check routes are GET and POST /:chatflowId/check, GET /:chatflowId/check/history, and GET and DELETE /:chatflowId/check/:checkId. History and a check started with questionIds require chatflows:view or agentflows:view, which is narrower than GET /api/v1/chatmessage/:id (that route also allows update). A key that can update the flow and cannot view it receives 403 on both.
An agentflow check looks at the Start input on Live and on the draft. Both canvases that have a Start node must use the same input. A canvas with no Start node does not block the other side, so a flow that was never published can still be checked.
| Input Type | Stored value | What the check routes replay |
|---|---|---|
| Chat Input | chatInput |
Recent questions. datasetId is accepted. |
| Form Input | formInput |
Recorded form submissions, newest distinct first. datasetId is 400. |
| Webhook Trigger | webhookTrigger |
Recorded webhook calls, newest distinct first. datasetId is 400. |
| Schedule Input | scheduleInput |
Recorded schedule inputs, newest distinct first. A schedule that sent a form is read as a form. datasetId is 400. |
Two different starts, a Start node whose input type is blank, or no Start node on either canvas are not replayed. POST .../check is 409 The check asks questions, so it works on agentflows that start with a chat message. Chatflows and harnesses are not in this table: they have no Start input, and they replay questions.
Which flows have drafts: chatflows, agentflows, harnesses, ETL pipelines, and legacy multi-agent canvases. Assistant flows save straight to Live. A harness draft does not change POST /api/v1/harnesses/:name/runs. The canvas chat and Try it use POST /api/v1/internal-prediction/:id, which runs the draft when one exists and Live otherwise. That route takes a signed-in session only. An API key gets 401 whatever the letter case of the path or a doubled slash in it, and the route refuses a key on its own as well. A Harness card there runs for the signed-in person, checked by role, not for the flow’s API key. Publish, Roll back, and PUT /api/v1/chatflows/:id write Live and update the roster the runs route serves. A pipeline draft does not change POST /api/v1/etl/pipelines/:id/runs or a schedule. Those read the published pipeline. POST /api/v1/etl/pipelines/:id/preview runs the canvas you send, which is the draft on the canvas, and does not write the store. When that preview omits the canvas, it runs the saved draft, or Live when there is no draft. The publish check runs on chatflows, agentflows, and harnesses. A harness accepts datasetId. A pipeline Publish lists the change list and does not run that check.
A draft holds the canvas only: nodes, connections, prompts and node settings. The flow’s name, chatbot and API settings, and starter prompts still save straight to Live through the chatflow routes. PUT /api/v1/chatflows/:id also keeps writing Live, so scripts that update flows keep working. One exception: while a flow has unpublished changes, changing its type (through the chatflow API, Restore, or Roll back Live) returns 409 This flow has unpublished changes. Publish or discard them before changing the flow's type., because the draft is a canvas of the current type. That check is the type write itself, so a draft saved after the read and before the write still blocks it. Publish also checks the type the draft was started on, and refuses a draft of another kind of flow with 409, even with overwriteLiveChanges; discard it to continue. A draft saved before Cuttlely recorded that type (a draft left from an earlier preview release) is refused the same way.
Draft status
Section titled “Draft status”GET /api/v1/flow-drafts/:chatflowId. PUT, DELETE and settings return the same shape; publish and rollback return it as status.
{ "enabled": true, "mode": "draft", "reason": null, "publishInstantly": false, "draft": { "flowData": "{\"nodes\":[…],\"edges\":[…]}", "updatedDate": "2026-10-08T17:02:11.000Z", "updatedBy": "<user id>", "stale": false, "hash": "<sha256 hex of the stored draft>" }, "lastPublished": { "sha": "afc07f3…", "date": "2026-10-08T16:40:00.000Z" }}| Field | Meaning |
|---|---|
enabled |
Drafts are on for this server: CUTTLELY_DRAFTS is not off. |
mode |
draft: canvas edits go to the draft. live: they go straight to Live. |
reason |
Why mode is live: off (drafts are off), type (this kind of flow has no drafts), or publish-instantly. null in draft mode. |
publishInstantly |
The flow’s Publish instantly setting. |
publishGate |
The optional passing-test requirement. enabled is false until a chatflow or agentflow turns it on. datasetId, evaluatorIds and threshold (0 to 100) are the settings. result is the last stored verdict, or null: draftHash, the settings used, passRate, passed, failed, errored, verdict (passed or failed), checkedAt, contentHash, and postProcessHash. contentHash is a hash of the rows that check scored (input, the full expected output, and sequence, ordered by sequence then row id) and of each evaluator’s type and config, taken from the same read that scored them. The expected output in that hash is the whole row output, including characters past the 4,000 the check shows and grades. The stored result has no answers and no row text. postProcessHash is a hash of chatbotConfig.postProcessing at that same time. block is the reason Publish is refused, or null when the gate is off or the latest result still passes for this draft, these settings, this test set, and this post-processing config. A changed row, an added row the check would ask, a changed evaluator config, or a missing dataset or evaluator is 409, and the message says the test set has changed since that check. A changed post-processing config is 409, and the message says the answer post-processing has changed since that check. Save, discard, and this settings route return that same block. |
draft |
The unpublished changes, or null when there are none. updatedBy is null for an API key. stale is true when Live changed after the draft started, for example through the chatflow API. hash is the SHA-256 of the stored draft canvas; send it back as expectedDraftHash when you save. |
lastPublished |
The last Publish or Roll back: the history version it recorded (sha, null when none was recorded) and when. null before the first one. |
Save the draft
Section titled “Save the draft”PUT /api/v1/flow-drafts/:chatflowId with { "flowData": "<canvas JSON string>" }. Optional expectedDraftHash is the draft.hash you loaded, or null when you loaded no draft. Optional overwriteDraftChanges counts only when it is true; any other value is ignored. Live is not touched. Uploaded files in the draft are stored under their own name (draft-<random>-<name>), so a draft never replaces a file Live uses. A canvas identical to Live clears the draft instead.
The save is refused with 409 when the stored draft’s hash differs from expectedDraftHash and it was last saved by someone other than the caller. A retained legacy API key save counts as no user; two API-key saves count as the same saver. No 409 when expectedDraftHash is left out (last save wins, as before), when there is no stored draft, when the stored hash is the one you sent, when the caller saved it last, or with overwriteDraftChanges: true. A refused save writes no draft. The check runs before any uploaded file is stored, so a conflict already present stores no file. It runs again under the lock before the draft is written, and that read is the one that decides, before a canvas equal to Live can clear the draft. The body is { "statusCode": 409, "success": false, "code": "DRAFT_CHANGED", "message": "<name> saved this draft after you opened it. Reload to see their changes, or send overwriteDraftChanges: true to replace them.", "savedBy": { "id": "<user id or null>", "name": "<display name>" }, "savedAt": "<ISO time or null>" }. name is the person’s display name (never the email; an email-shaped or missing name, or a name that cannot be read, shows as User <first 8 characters of the id>), or Someone using an API key. Restoring a version as the draft (POST /api/v1/flow-versions/:chatflowId/:sha/restore) leaves expectedDraftHash out, so this check does not refuse that save.
400 when flowData is missing, not JSON, or has no nodes and edges lists. 400 when expectedDraftHash is neither a string nor null (expectedDraftHash must be a string or null.), which writes nothing and stores no uploaded file, including when overwriteDraftChanges is true. 409 when drafts are off, the flow’s type has no drafts, or Publish instantly is on. 409 when the flow’s type changed after this canvas was loaded (This flow changed to another kind of flow after these edits started, so they can't be saved. Discard them to continue.): the draft is not stored. A settings row created at the same moment keeps its settings. The draft columns are written onto that row, and the response is not a database error. On SQLite those first writes for one flow run one at a time, so each one updates only its own columns and a successful save is still on the row. When that row cannot be read again, the response is 409 That save overlapped another save. Try again.
Discard the draft
Section titled “Discard the draft”DELETE /api/v1/flow-drafts/:chatflowId. Throws the draft away. Live is not touched.
Publish instantly
Section titled “Publish instantly”PUT /api/v1/flow-drafts/:chatflowId/settings with { "publishInstantly": true }. With it on, canvas edits go straight to Live, as before drafts. Turning it on while the flow has unpublished changes returns 409; publish or discard them first. That check is made again at the write, so a draft saved in between is still 409 and nothing is written. 400 when the value is not true or false. Turning it on while the passing test set is on returns 400 Turn off the passing test set before turning on Publish instantly. That check is made again at the write, against the row as it is then. Publish instantly is stored only while the passing test set is still off, and the passing test set is stored only while Publish instantly is still off. If the other one was turned on in the meantime, the response is that same 400 and the row is left as it was. One request can turn Publish instantly off and the passing test set on, or the reverse. The off is written first.
The gate covers Publish of the current draft only. Roll back, Promote, and PUT /api/v1/chatflows/:id can still change Live.
The same route accepts publishGate:
{ "publishGate": { "enabled": true, "datasetId": "<dataset id>", "evaluatorIds": ["<evaluator id>"], "threshold": 100 } }enabled: false turns it off and leaves Publish as it is today. That call needs permission to update the flow and does not need datasets:view or evaluators:view. threshold is a whole number from 0 to 100; omit it and the server uses 100. Turning it on needs datasets:view and evaluators:view as well as permission to update the flow. The dataset and every evaluator are loaded in the flow’s own workspace before anything is stored, the same way a dataset check loads them. 400 when drafts are off (Drafts are off on this server.), when Publish instantly is on (Turn off Publish instantly before requiring a passing test set.), when the flow is not a chatflow or an agentflow, when the agentflow starts with a form, a webhook, or a schedule (A dataset check asks each row as a chat message. This flow starts with a form, so it cannot use a dataset., and the same sentence for a webhook or a schedule), when datasetId or evaluatorIds is missing from the body, or when threshold is not a whole number from 0 to 100. 403 when turning it on and the caller can update the flow but cannot view datasets or evaluators. 404 Dataset <id> not found or Evaluator <id> not found when that id does not exist or belongs to another workspace. A later save that lists only evaluators that still exist replaces the stored list, including when a previously saved id is gone. A dataset with no question the check can ask is 400 This dataset has no questions the check can ask. Nothing is stored in either case, and settings already saved stay as they were. Sending only publishInstantly does not change the gate. The save writes only the settings columns and then re-reads the row, so a draft saved during target validation keeps its canvas and publication fields. The start check is made again at the write, against the flow’s current type and Live canvas and the draft stored then, and a refusal writes nothing. Turning a setting on repeats the conditional write if the first one matches no row, and a 400 leaves the other flag as it is. A gate result is stored only while the gate is still on with the same dataset, evaluators, and pass mark. Saving the same settings again is not a 400 when the other flag is still off, even if the database reports that no row changed. The configuration sends those writes one at a time, so the later dataset choice is the one stored. A response for a caller without datasets:view leaves out the dataset id, including the id on the stored result. A response for a caller without evaluators:view leaves out the evaluator ids, including the ids on the stored result. The enabled flag, the block, the verdict, the pass mark, and the counts stay.
Publish
Section titled “Publish”POST /api/v1/flow-drafts/:chatflowId/publish, optional body { "overwriteLiveChanges": true, "expectedDraftHash": "<draft.hash you loaded>", "overwriteDraftChanges": true }.
Saves the draft as Live through the normal chatflow update, so validation and file handling run as for any save. History gains a version of kind publish, titled Published: <what changed>, with the caller as its author. The draft is then cleared. If someone saved a newer draft while the publish ran, that draft is kept.
When the draft is stale (Live changed after it started), publishing would replace those Live changes, so it is refused with 409 unless the body has "overwriteLiveChanges": true. The save itself only goes through while Live is still the canvas and flow type that check was made against; if either changes during the publish, it returns 409 Live changed while publishing, so nothing was published. Try again.
expectedDraftHash and overwriteDraftChanges follow the same rules as in Save the draft. When the stored draft’s hash differs from expectedDraftHash and someone other than the caller saved it last, the publish is refused with the same 409 DRAFT_CHANGED body as a save, and savedBy.name follows the same rule, so it is never an email. The message is <name> saved this draft after you opened it, so nothing was published. Reload to see their changes, or send overwriteDraftChanges: true to publish their draft. Nothing goes live and history gains no version. No 409 when expectedDraftHash is left out, so a publish that sends no hash works as before. overwriteDraftChanges: true skips only this check: a stale draft still needs overwriteLiveChanges, the passing test set still applies, and an expectedDraftHash that is neither a string nor null is still 400 (expectedDraftHash must be a string or null.). The canvas that goes live is the draft that was compared. A draft saved while the publish runs is kept as the next draft.
{ "chatflow": { "id": "<flow id>", "name": "Bakery helper", "type": "CHATFLOW", "updatedDate": "2026-10-08T17:05:40.000Z", "flowData": "<Live canvas JSON>" }, "version": { "sha": "afc07f3…", "kind": "publish", "published": true, "title": "Published: Changed System Message on Conversation Chain", "…": "…" }, "unchanged": false, "recorded": true, "historyError": null, "status": { "mode": "draft", "draft": null, "…": "…" }}| Field | Meaning |
|---|---|
version |
The new history entry, in the History API list format, or null. |
unchanged |
true when Live already matched the draft. The draft is cleared once the same conditional save confirms Live still matches; history records nothing. |
recorded |
true when the publish was added to history. false when history is off or the history write failed. |
historyError |
Why the history write failed, when known. Otherwise null. Live is updated either way. |
status |
The draft status after publishing. |
| Status | When |
|---|---|
| 403 | No update permission for this type of flow. |
| 409 | Drafts are off on this server., There are no unpublished changes to publish., DRAFT_CHANGED (someone else saved the draft after the expectedDraftHash you sent), a stale draft without overwriteLiveChanges, or the passing test set is on and the latest result is missing, failing, or out of date. That message names the threshold and the last result, for example Publish needs a passing test set at 100%. The last result was 75% and failed. A changed row, an added row, a changed evaluator, or a missing dataset or evaluator uses The test set has changed since that check. A flow with the setting off is unchanged. If an agentflow starts with a form, a webhook, or a schedule after the setting was turned on, the message says the dataset check cannot run and to turn the passing test set off. Publish stays blocked. |
Roll back Live
Section titled “Roll back Live”POST /api/v1/flow-drafts/:chatflowId/rollback with { "sha": "<version id>" }.
Sets Live to that version at once, with its name, type and category, the same way Restore does. History gains a version of kind rollback, titled Rolled back Live to: <title> (<short sha>). An open draft is kept and is not marked stale, because this Live was chosen. While the flow has unpublished changes, a version of another kind of flow is refused with 409; see below.
The response is the Restore response plus status, the draft status afterwards. chatflow.flowData is the canvas that is Live after the roll back. The write lands only while Live is still the canvas that was read; a Live update in between returns 409 Live changed while this was being saved, so nothing was changed. Try again. 400 when sha is not 7 to 40 lowercase hex characters, 404 when the version is not in this flow’s history, 409 when drafts or history are off, 403 without the update permission for the flow’s type and the version’s type.
Publish check
Section titled “Publish check”Before Publish, the check asks a few recent real questions again, once to Live and once to the draft, and returns both answers side by side with the tokens and time each took. It is optional. Publish looks at a result only when the flow requires a passing test set, and then it reads the stored verdict, not these in-memory answers. The server starts a new check only when CUTTLELY_PUBLISH_CHECK is on, which is the default. Turning it off refuses that start with 409, including one that selects questions, and does not change Publish. A check that is already running can still be read and stopped. The setup read includes that check beside the off banner, so the dialog can show it and Stop. The question history list stays available and does not start a replay. Server settings API. How it looks in the Publish dialog: Check recent questions before you publish. The gate: Require a passing test set before you publish.
Each question runs the model twice, so a check costs tokens on the flow’s model account. The server caps each check:
| Limit | Value |
|---|---|
| Questions | count from 1 to the question cap (CUTTLELY_CHECK_COUNT_MAX, 100 by default). 4 in the dialog (CUTTLELY_CHECK_COUNT_DEFAULT, 4 by default). A list sent without count is still at most 10. Each question is at most 2,000 characters. |
| Tokens | CUTTLELY_CHECK_MAX_TOKENS, 100,000 by default. See History settings. |
| Time | CUTTLELY_CHECK_MAX_SECONDS, 180 by default, and 60 seconds by default for any one run (CUTTLELY_CHECK_RUN_TIMEOUT_MS). |
| At a time | Harness checks run one question at a time. Chatflow and agentflow checks use CUTTLELY_CHECK_CONCURRENCY, 1 to 8 (default 2). Each question runs on Live and then on the draft. |
| Checks at once | One per flow, three on the server. |
When a token or time limit is reached, the check stops starting new questions. Questions already started finish, so the token total can go a little past the cap. A question counts only when both Live and the draft answered it. One question failing does not stop the others: that row has an error, and the rest continue. Stop keeps the questions that already finished.
Which questions run when you send count: the most recent ones people asked this flow, newest first. Message time decides the order, and the message id breaks a tie, newest id first. The same wording counts once. Capitals and extra spaces are ignored, and the newest copy is kept. The same count on the same history returns the same questions. It is not a random sample. Questions sent with files are left out. The server reads the newest messages, 200 at a time, until it has the question cap (CUTTLELY_CHECK_COUNT_MAX, 100 by default) or it has read the scan cap (CUTTLELY_CHECK_SCAN_CAP, 2,000 messages by default) or the history ends. If it stops at the scan cap before it has that many different questions, pastTruncated is true: there may be older questions it did not reach. If fewer different questions exist than count, it compares every one it found.
What a check never does:
- It never saves Live or the draft. The canvases run in memory.
- It writes no chat messages, so replays do not show up in chat history, the flow’s usage counts or its memory. Each run starts with empty memory.
- It calls none of the flow’s tracing or analytics providers, and adds no follow-up prompts or speech.
- On an agentflow it writes no execution record. The replay does not resume a previous run and does not load one for state. It ignores any human input sent with the question, and stores no image or file that a model step generates. Choosing the inputs to replay does read execution records (up to the scan cap,
CUTTLELY_CHECK_SCAN_CAP, 2,000 by default), newest update first with the id breaking a tie. - It writes the questions, answers and canvases to no log. Results stay in the server’s memory for
CUTTLELY_CHECK_KEEP_MINUTES(30 minutes by default) and are lost on restart.
The check works on chatflows, agentflows and harnesses with unpublished changes. A chat-started agentflow must start with a chat message (Start input type Chat Input) in Live and in the draft, and the check replays questions. An agentflow whose start is a form, a webhook or a schedule is checked too, when Live and the draft use that same start: the check replays recorded inputs from recent executions instead of questions. A canvas with no Start node does not block the other side, so a flow that was never published can still be checked. Mixed starts, or a Start node with no input type, are refused. Legacy multi-agent and sequential-agent flows are not checked; that refusal stays The check works on chatflows and agentflows. On an agentflow, the tokens counted are the ones each model step reports (LLM and Agent steps); a Condition Agent step reports none. A model evaluator’s tokens count toward the same cap. The grader reads tokenUsage, then estimatedTokenUsage, then usage metadata on the generation. A provider that reports usage in none of those places does not move the token total, so that check is bounded only by the time limit. If a model grade is aborted before every evaluator finishes, tokens already reported still count toward the cap, and the grader does not start another model evaluator. If the grading model cannot be started, text, JSON and numeric scores stay, and each model score is Error with the message The grading model could not be started.
A harness check reads the full user turns saved for that harness, newest first, and applies the same newest-distinct rule and the same caps. A canvas whose harness file belongs to another team gets no questions, and those prompts are not opened. Another team’s harness is a 404, the same response as a missing name. The short preview on a run row is not the question. Secrets are redacted the same way as that preview (sk- and xai- tokens, Bearer values, and Postgres URLs), and the text is then cut at 2,000 characters with no ellipsis added. Distinctness uses that redacted text, so two prompts that share only the first 240 characters stay two questions. The server reads the newest user turns up to the harness turn scan cap (CUTTLELY_HARNESS_TURN_SCAN_CAP, 2,000 by default, at most 5,000). pastTruncated is true when that scan stops before it has the question cap (CUTTLELY_CHECK_COUNT_MAX, 100 by default). Starter questions are offered the same way as on a chatflow. Each question is run on the Live canvas roster and on the draft canvas roster. Both go through the canvas try: its own profile directory and a directory for each specialist, and its own gateway token, removed when the run finishes, when it throws, and when the check is stopped. A directory the runtime still has open is removed on the next start. A saved harness is left in place. The replay writes no chat message, no run-history row, no session turns and no analyst capture for that chat. A published run of the same harness, and a second check, use other chat ids and other profile directories. The tokens for a side are the route, specialist and handoff tokens the run already added together. Cached tokens are part of the prompt count and are not added again. The estimated cost uses those same lines, grouped by model, which is the usage write stored under the harness name. Daily token usage for that replay is the same single write as a canvas try. A specialist with Shell, Browser, Code execution or Files is a risky step and is skipped unless includeRiskySteps is true. SQL tools keep the try profile’s refusal. A saved dataset’s rows are the questions, in the saved order, and they replay on both rosters. Empty rows and rows longer than 2,000 characters are skipped. questions, count, or questionIds sent with datasetId is 400 Send a datasetId on its own. Do not send questions, count, or questionIds with it.
For a form, webhook or schedule start, count selects the newest distinct recorded inputs, up to the question cap (CUTTLELY_CHECK_COUNT_MAX, 100 by default), from this flow’s execution records (newest update first). A form input is the submitted form. A real run stores it as lines of name: value on the Start step (for example loaf: rye then count: 2). Each line is split on the first : , so a value may contain a colon, and the value comes back as a string. A row from this version starts with a marker line, and a backslash in a value is an escape. That marker stays on the stored Start output. The replay, like the original run, sends each node the readable lines, in the stored field order, with a real line break and a single backslash. Two orders of the same fields still count as one input. An older row whose line break leaves a line with no field name is not replayed. An older row has no marker, and a backslash in it stays as typed. A schedule that sends a form is stored and read the same way. A form already stored as an object is used as stored. A webhook input is the body, the query and the headers that change what the flow does. A schedule input is the form that was sent, read the same way as a form start, or the trigger text when the schedule did not send a form, including the single-space text used when the schedule sends no input. Webhook headers that change on every delivery do not count as a different input and are left out of the stored payload: date, user-agent, content-length, forwarded, x-forwarded-*, and any header whose name contains request-id, requestid, trace, signature or timestamp. Key order is ignored. The server reads executions 50 at a time, newest updatedDate first and id descending when the time ties, until it has the question cap (CUTTLELY_CHECK_COUNT_MAX, 100 by default) or it has read the scan cap (CUTTLELY_CHECK_SCAN_CAP, 2,000 executions by default) or the history ends. pastTruncated is true when it stops at that scan cap before it has the question cap. There are no starter questions on this path, and extra questions sent with count are not added. When count is sent and there are no executions to replay, the response is 400 and names how to record one: a form says No past runs exist yet. Submit the form once, then check again., a webhook says No past runs exist yet. Call the webhook once, then check again., and a schedule says No past runs exist yet. Wait for the schedule, or trigger it once, then check again. That is not a refusal of the flow: the setup still returns unavailable: null, replayInputs: true and replaySource set to form, webhook or schedule. Each recorded input includes source (that same word) and date (when the run was stored). The dialog shows both above preview. A check case for that input carries the same source and date. Each stored question is canonical JSON ({"form":...}, {"webhook":...} or {"question":...}). Header and query names that are authorization or cookie, or that contain token, secret, key, password or signature, have the value [REDACTED] in that JSON, in preview, and in the check cases, including when the name is nested (user[password] stored as { "user": { "password" } }, or the same shape inside a header). Arrays are walked the same way. The raw value is not returned. preview is the short line the dialog shows. For a webhook it is the body. When another kept row has the same body, preview also includes the query or the differing header names (sensitive values still [REDACTED]). The webhook stores Authorization as [REDACTED] before the execution is saved, so two calls that differ only by that header are one recorded input and the preview is the body alone. The replay sends the masked input with the same no-persistence behavior as a chat question: a form without a question, a webhook as a webhook call, a schedule as a scheduled call. It writes no chat message and no execution record. A risky step is not run unless includeRiskySteps is true, so the replay makes no outbound call from that step.
Steps that act for real
Section titled “Steps that act for real”Some steps do more than answer: they send a request, write to a database or vector store, run custom code or call an assistant that keeps its own threads. Replaying them could repeat that action, so the check refuses to run a flow that has one, in Live or in the draft, unless the request says to run it anyway. Steps counted as risky:
- Any node outside these groups: Chat Models, LLMs, Embeddings, Prompts, Output Parsers, Text Splitters, Retrievers, Moderation, Document Loaders, Record Manager, Vector Stores, Chains, Agents, Memory, Tools and Utilities. A node the check does not know counts as risky.
- In those groups: Vectara upsert, POST API chain, OpenAPI chain, SQL database chain, Cypher QA chain, OpenAI Assistant, Custom JS Function and If Else Function.
- Memory other than Buffer Memory, Buffer Window Memory, Conversation Summary Memory and Conversation Summary Buffer Memory. Those four read Cuttlely’s own chat history, which a replay starts empty and never writes; other memory keeps turns in its own store.
- Tools other than read-only ones such as Calculator, the web search tools, Requests Get, Web Scraper and retriever or chain tools.
- Utilities other than Set Variable, Get Variable and Sticky Note.
- The flow’s Post-processing code.
On an agentflow, the steps counted as risky:
- Custom Function, HTTP, Execute Flow and Human Input steps, and any agentflow step the check does not know.
- A Tool step, unless its tool is one of the read-only tools above.
- An Agent step with a tool that is not read-only, or with a tool that asks a person to approve it. An Agent with no tools, or only read-only ones, is safe. Its built-in provider tools (web search, code run by the model provider) count as read-only.
- Start, LLM, Agent, Condition, Condition Agent, Retriever, Direct Reply, Loop, Iteration and Sticky Note steps are safe.
Question history
Section titled “Question history”GET /api/v1/flow-drafts/:chatflowId/check/history?cursor=&limit=&q=&source=&from=&to=
Lists user questions stored for this chatflow, or for an agentflow that starts from a chat message. The list stays available when CUTTLELY_PUBLISH_CHECK is off. Starting a check with those questions is still refused. Each distinct question text appears once. Distinct uses the full stored text after trim, and the newest row wins. The list is then ordered by createdDate descending and id descending, and paged over that stream. A form, webhook, or schedule agentflow, and a harness, answer 409 Question history for this flow is not available on this route yet. Recorded inputs and harness turns are not listed here. Any other flow type answers 409 The check works on chatflows and agentflows.
History and questionIds require chatflows:view or agentflows:view, for a session and for a retained legacy API key. New scoped keys cannot use question history or start checks. That view-permission requirement is narrower than GET /api/v1/chatmessage/:id (that route also allows update). A key that can only update the flow, and so can start a check, receives 403. A missing flow, or a flow in another workspace, is the same 404 as the other draft routes.
limit is a whole number from 1 to 100. Omit it and the page size is 50. Anything else is 400 limit must be a whole number from 1 to 100. source is chat or api. Omit it and both are included. Any other value, including embed, shared, and replay, is 400 { "code": "HISTORY_BAD_SOURCE", "message": "source must be chat or api." }. Canvas chat is stored as INTERNAL and listed as chat. An API prediction, an embed, and a shared link are stored as EXTERNAL and listed as api. from and to are UTC calendar dates, YYYY-MM-DD. from includes that day from 00:00:00.000Z. to includes that day through 23:59:59.999Z. A time, a zone, or a day the month does not have is 400 { "code": "HISTORY_BAD_DATE", "message": "from must be a UTC date (YYYY-MM-DD)." } (or to). from after to is 400 from is after to. with the same code. The date filter is applied before the 2,000-row scan. q is a case-insensitive substring of the stored text, at most 200 characters. % and _ are literal characters, not wildcards. A q or cursor that is not text is 400 q must be text. or cursor must be text. A field left as q[0], cursor[0], from[0], or to[0] is the same 400. The search and the page cursor are not written to the log, including a bracketed name (q[], q[0], cursor[], cursor[0]) or a percent-encoded name. The response sends Cache-Control: no-store. One request reads at most 2,000 matching rows, after the source, search, and date filters.
Paging is a keyset on createdDate descending and id descending. Each request reads the newest matching rows again and returns the page strictly older than the cursor. A question saved after the first page does not appear later in that walk. A question deleted before the next page is omitted. The cursor is not a snapshot of the first page. It is signed for this caller, workspace, flow, a hash of q, source, from, and to. Changing the search, the source, or either date makes the old cursor 400.
{ "items": [ { "id": "chat:11111111-1111-4111-8111-111111111111", "text": "Do you have rye loaves today?", "date": "2026-10-08T16:12:03.000Z", "source": "chat", "replayable": true }, { "id": "chat:22222222-2222-4222-8222-222222222222", "text": "See the scan", "date": "2026-10-08T15:00:00.000Z", "source": "api", "replayable": false, "reason": "files" } ], "nextCursor": null}| Field | Meaning |
|---|---|
id |
chat: and the message id. This is the value questionIds accepts for a chatflow. |
text |
The question, cut at 2,000 characters. The cut is only the preview. Distinct still uses the full trimmed text. |
date |
When that message was stored. |
source |
chat or api. Canvas chat is chat. An API prediction, an embed, and a shared link are api. |
replayable |
false when the question was sent with a file, or the stored text is longer than 2,000 characters. A file row has reason files. A long row has reason length. |
nextCursor |
An opaque cursor for the next page, or null when this page is the last one inside the rows that were read. It is signed for this caller, workspace, flow, a hash of q, source, from, and to. The search text is not in the cursor. A forged cursor, or one from another caller, another API key in the same workspace, flow, search, source, or date range, is 400 and is not echoed. |
Assistant, system, and tool rows are not returned. Neither are file bytes, storage paths, or a question from another flow.
Check setup
Section titled “Check setup”GET /api/v1/flow-drafts/:chatflowId/check
{ "unavailable": null, "questions": [{ "text": "Do you have gluten-free bread today?", "date": "2026-10-08T16:12:03.000Z" }], "pastCount": 1, "pastTruncated": false, "riskySteps": [], "limits": { "maxQuestions": 100, "defaultQuestions": 4, "counts": [4, 10, 25, 50, 100], "maxQuestionChars": 2000, "maxTokens": 100000, "maxSeconds": 180, "concurrency": 2 }, "liveEmpty": false, "replayInputs": false, "replaySource": null, "check": null}| Field | Meaning |
|---|---|
unavailable |
Why a check can’t run now, or null. code is off (drafts are off), disabled (the publish check switch is off; the message is The publish check is turned off on this server.), type (not a chatflow, an agentflow or a harness; legacy multi-agent flows stay here, with The check works on chatflows and agentflows.), no-draft (nothing to check) or start (the two versions do not start the same way, or there is no Start input to replay), with a message to show. A form, webhook or schedule start with no past runs is not unavailable. When the code is disabled, questions is empty and publishCheck is false. check is still the check already running, or null when none is. |
questions |
Up to the question cap (CUTTLELY_CHECK_COUNT_MAX, 100 by default) of recent questions people asked this flow, through the API, embeds and shared links or the canvas test chat, newest first and without repeats. Questions sent with files are left out. Then up to 10 of the flow’s starter questions that nobody asked yet, marked "starter": true with an empty date, so a new flow has questions to check. When replayInputs is true, these are recorded inputs instead: canonical JSON, newest first, with no starter rows. Each one has source (form, webhook or schedule) and date (when that run was recorded). |
replayInputs |
true when the check replays recorded form, webhook or schedule inputs. false for chatflows and chat-started agentflows. |
replaySource |
form, webhook or schedule when replayInputs is true. null for a chatflow, a chat-started agentflow, or a harness. The dialog uses it for the empty state. |
pastCount |
How many of questions are past questions, not starter questions. At most the question cap (CUTTLELY_CHECK_COUNT_MAX, 100 by default). When replayInputs is true, how many distinct recorded inputs were found. |
pastTruncated |
true when the scan stopped at the scan cap (CUTTLELY_CHECK_SCAN_CAP, 2,000 messages by default, and the same cap for executions on a form, webhook or schedule start) before it found the question cap (CUTTLELY_CHECK_COUNT_MAX, 100 different past questions or inputs by default). A harness check uses CUTTLELY_HARNESS_TURN_SCAN_CAP (2,000 user turns by default, at most 5,000) for that scan. |
riskySteps |
The steps that act for real, as { "id", "label" }. Empty when there are none. |
limits |
The limits above, as this server has them. maxQuestions is the question cap (CUTTLELY_CHECK_COUNT_MAX, 100 by default). defaultQuestions is CUTTLELY_CHECK_COUNT_DEFAULT (4 by default), which the dialog selects first. counts is the allowed picker counts. With the default cap that is 4, 10, 25, 50, and 100. A lower cap leaves out any of those above it and adds the cap when it is not already listed. A higher cap keeps 4, 10, 25, 50, and 100, and adds the cap. defaultQuestions is included when it is not already a choice. concurrency is the effective limit for this flow. Harnesses always report 1. |
liveEmpty |
true when Live has no cards yet, as with a flow saved only as a draft so far. Its check asks only the draft. |
check |
The flow’s latest check, in the shape below, or null. When the publish check switch is off, a running check is still included, with its id and status, so it can be stopped. A completed, failed, or stopped check is null. |
Start a check
Section titled “Start a check”POST /api/v1/flow-drafts/:chatflowId/check with { "count": 4, "questions": ["…"], "includeRiskySteps": false }.
questionIds picks stored questions instead of count. It is optional. Omit it, or send null, and a request that uses count or a typed questions list is unchanged, so an older client keeps working. An empty questionIds list is not a pick. On a chatflow or a chat-started agentflow, questions then run up to the question cap, and the older limit of 10 does not apply. On a harness, or a form, webhook, or schedule start, an empty list is the same request as omitting questionIds, so those typed questions use that path. An empty list with no questions is 400 on a chatflow. Send 1 to the question cap (CUTTLELY_CHECK_COUNT_MAX, 100 by default) unique ids, in the order they should run, for example { "questionIds": ["chat:11111111-1111-4111-8111-111111111111"], "questions": ["Do you have rye loaves today?"] }. Typed questions are added after those ids. Repeats after that join are dropped. If more than the question cap remain, the response is 400 { "code": "CHECK_QUESTION_CAP", "message": "The check runs at most 100 questions." } when the cap is 100. The number in that message is the cap in effect. Nothing is dropped silently. questionIds and count together are 400 { "code": "CHECK_QUESTION_IDS_EXCLUSIVE", "message": "Send questionIds or count, not both." }. A list that is not ids is 400 CHECK_QUESTION_IDS_SHAPE. A non-empty list longer than the cap is 400 CHECK_QUESTION_IDS_RANGE. An empty list is not that error. An exact repeat, or two ids that are the same chat id apart from letter case, is 400 CHECK_QUESTION_IDS_DUPLICATE. Each id has to belong to this flow and be replayable. A wrong prefix or a chat id that is not an 8-4-4-4-12 uuid (letter case does not matter) is reason invalid. An unknown id, an id from another flow or workspace, and an id that was already deleted are reason not-found. Those three are the same reason, so a caller cannot tell a missing row from a row in another workspace. A question sent with a file is reason files. A stored question longer than 2,000 characters, or an empty one, is reason length. The response is 400 { "code": "CHECK_BAD_QUESTION_IDS", "message": "Position 1 was sent with a file.", "badCount": 1, "errors": [{ "index": 0, "reason": "files" }] }. message names each position and the reason (is not a question id, was not found on this flow, was sent with a file, or is longer than 2,000 characters). It does not include the id or the question text. index is the position in the request. The id is not queried when the shape is wrong, and the id is not in the response. badCount is how many ids failed. The response does not include the question text. Ids are read again when the run starts. An id removed after it was accepted is left out and listed on the check as skipped, with the count and the ids, and without the text. That is the response for a row that disappears while the check is starting. A non-empty questionIds list on a harness, or on a form, webhook, or schedule start, is 409 Choosing questions by id is not available for this flow yet. An empty list is not. The caller still needs update permission, and also chatflows:view or agentflows:view, which is narrower than GET /api/v1/chatmessage/:id (that route also allows update). An update-only key is 403. A missing session is 401. A missing flow, or a flow in another workspace, is 404.
A pipeline runs the same call with cuttlely check. The command sends count 4, polls Read a check until the check finishes, and exits 1 when --fail-on-changed sees a Changed answer. The key needs both permissions for the flow type, because this route needs update and the poll needs view: chatflows:view and chatflows:update, or agentflows:view and agentflows:update. Scored mode sends datasetId, evaluatorIds, and threshold instead of count. It does not compute the verdict. --dataset exits on verdict.result. --gate with a failed verdict exits 1 and does not read the flow again. --gate exits 0 only when that verdict is passed and a second read of the flow still stores this check as passed with an empty block. That read waits at most 30 seconds. Exit 2 means the confirmation read failed: a non-empty block, a different checkId, or a missing passed. That key also needs datasets:view and evaluators:view. The example workflows are examples/ci/cuttlely-check.yml and examples/ci/cuttlely-check-gate.yml.
count is optional. When it is sent, it must be a whole number. A number below 1 counts as 1, and above the question cap (CUTTLELY_CHECK_COUNT_MAX, 100 by default) counts as that cap. The server then chooses that many past questions by the rule above. For a chatflow or a chat-started agentflow, questions, if also sent, are extra questions added after those, still within the question cap altogether, with repeats dropped. For a form, webhook or schedule start, send count on its own. Sending questions as well is refused: the server does not add them and does not return 202. When count is omitted, the request is the older one: questions is required, at most 10, and the server runs that list. That default is unchanged. { "count": 4 } on its own is still that request. Answers 202 with the check, status running. The runs happen in the background, a few questions at a time; read progress with the next route. completed is how many questions both sides have answered, out of total. If the client goes away while the questions, a dataset, or recorded inputs are loading, nothing is started. Closing the optional question check’s dialog stops that check. Run the test set keeps polling until the check leaves running or the server time limit is reached (CUTTLELY_CHECK_MAX_SECONDS, at most 1,800 seconds). That poll is not capped at 200 reads. Closing the Publish dialog stops the polling and does not stop the check.
Two more fields are optional:
| Field | Meaning |
|---|---|
datasetId |
A dataset in this workspace. Its rows, in sequence order, are the questions: row input is the question, row output is the expected answer. At most the question cap (CUTTLELY_CHECK_COUNT_MAX, 100 rows by default). A row with an empty question, or a question longer than 2,000 characters, is skipped. Do not send questions, count, or questionIds with it. The caller also needs datasets:view. A chatflow, a chat-started agentflow, and a harness accept it. A flow that starts with a form, a webhook or a schedule is refused. A row with an empty output is still asked. Text, JSON, and numeric evaluators score that answer. A model evaluator scores Error with message This row needs an expected answer. and the grading model is not called. |
evaluatorIds |
Evaluator ids in this workspace, scored on each answer for Live and for the draft. Repeats are dropped. The caller also needs evaluators:view. Omit it, or send [], for the comparison with no score. |
threshold |
Only with datasetId. A whole number from 0 to 100. Omit it and the server uses 100. The finished check reports verdict for the draft: passed when the draft pass rate is at least this number, otherwise failed. Errored scores count as not passed. A check with no scores is failed. Sending threshold without datasetId is refused. A check without a dataset has verdict null. A harness check can report that verdict. It does not store a pass, and it does not satisfy Publish, because a harness cannot turn the passing test set on. If storing the result fails, the check status is failed and the error is The test set result could not be saved. The stored result is cleared, and Publish is refused. If that clear also fails, the check still ends failed with that same error, the older pass stays stored, and Publish is refused with Publish needs a passing test set at <threshold>%. The test set result could not be saved. That refusal lasts for this server process. A restart drops it, and the older pass can publish again if it still matches the draft and the test set. A check whose dataset, evaluators, or pass mark do not match the passing test set is ignored: the stored pass stays, and a different check’s failure note stays, so Publish stays refused when a matching check failed to store and failed to clear. A clear after a failed store removes the result only while that same result is still stored. A pass another process stored, with a different check id or time, is left in place. A settings save writes only the settings columns and then re-reads the row, so a draft saved during target validation keeps its canvas and publication fields. |
| Status | When |
|---|---|
| 400 | count is not a whole number, questions is not a list of text, a question is empty or longer than 2,000 characters, the list is empty when count is omitted, the list has more than 10 questions when count is omitted (or more than the question cap, CUTTLELY_CHECK_COUNT_MAX, 100 by default, when count is sent for a chatflow, a chat-started agentflow, or a harness), there are no past questions for count and no extra questions, there are no past runs to replay for a form, webhook or schedule start (No past runs exist yet. Submit the form once, then check again., No past runs exist yet. Call the webhook once, then check again., or No past runs exist yet. Wait for the schedule, or trigger it once, then check again.), a form, webhook or schedule start sends questions together with count (Questions are not used for a form, webhook or schedule start. Send count on its own.), includeRiskySteps is not true or false, datasetId is sent with questions, count, or questionIds, datasetId is empty, evaluatorIds is not a list of ids, the dataset has no question the check can ask, the flow starts with a form, a webhook or a schedule and the request sent datasetId, threshold is sent without datasetId, threshold is not a whole number from 0 to 100, a non-empty questionIds list is not ids, repeats an id, or is longer than the question cap (CUTTLELY_CHECK_COUNT_MAX, 100 by default) (CHECK_QUESTION_IDS_SHAPE, CHECK_QUESTION_IDS_DUPLICATE, or CHECK_QUESTION_IDS_RANGE), questionIds is sent with count (CHECK_QUESTION_IDS_EXCLUSIVE), or ids plus typed questions are more than the question cap after repeats are dropped (CHECK_QUESTION_CAP). A bad id uses { "code": "CHECK_BAD_QUESTION_IDS", "message", "badCount", "errors": [{ "index", "reason" }] } with reason invalid, not-found, files, or length. message is safe to show. |
| 403 | The caller can update the flow but does not have datasets:view (when datasetId is sent), evaluators:view (when evaluatorIds lists any id), or chatflows:view or agentflows:view when questionIds is sent. That is narrower than GET /api/v1/chatmessage/:id (that route also allows update). A retained legacy API key is held to the same rule; new scoped keys cannot start checks. |
| 404 | datasetId or an id in evaluatorIds is missing, or it belongs to another workspace. Nothing is started. |
| 409 | The publish check is turned off (The publish check is turned off on this server.), drafts are off, the flow is not a chatflow, an agentflow, or a harness (a pipeline, a legacy multi-agent flow, and an assistant are refused with The check works on chatflows and agentflows.), the two versions do not start the same way, there are no unpublished changes, a check is already running for this flow, or the flow has risky steps and includeRiskySteps is not true. The message names the steps. The risky-step rule is the same for a chat start and for a form, webhook or schedule start. A dataset check on a form, webhook or schedule start is 400, not this 409. |
| 429 | Too many checks are running on this server. Try again in a minute. |
Read a check
Section titled “Read a check”GET /api/v1/flow-drafts/:chatflowId/check/:checkId. 404 That check was not found. Run it again. when the id is not this flow’s latest check, or it has expired. This read still succeeds when CUTTLELY_PUBLISH_CHECK is off.
{ "id": "<check id>", "status": "done", "stopReason": null, "error": null, "startedDate": "2026-10-08T17:10:00.000Z", "finishedDate": "2026-10-08T17:10:05.000Z", "total": 1, "completed": 1, "draftChanged": false, "includeRiskySteps": false, "limits": { "maxQuestions": 100, "defaultQuestions": 4, "counts": [4, 10, 25, 50, 100], "maxQuestionChars": 2000, "maxTokens": 100000, "maxSeconds": 180, "concurrency": 2 }, "liveEmpty": false, "selection": { "requested": 4, "available": 1, "used": 1, "truncated": false }, "cases": [ { "question": "Do you have gluten-free bread today?", "expected": null, "live": { "text": "Yes, we bake it on Tuesdays.", "error": null, "tokens": 44, "ms": 657, "estimatedCostUsd": 0.000018, "price": "known", "unpricedModels": [] }, "draft": { "text": "Yes, every day.", "error": null, "tokens": 45, "ms": 525, "estimatedCostUsd": null, "price": "no price", "unpricedModels": ["custom-bakery"] }, "same": false } ], "summary": { "ran": 1, "same": 0, "changed": 1, "errors": 0, "liveTokens": 44, "draftTokens": 45, "liveMedianMs": 657, "draftMedianMs": 525, "liveEstimatedCostUsd": 0.000018, "draftEstimatedCostUsd": null, "livePrice": "known", "draftPrice": "no price" }}| Field | Meaning |
|---|---|
status |
running, done, stopped (a limit or Stop ended it early) or failed (it could not run; error says so). |
stopReason |
tokens, time or stopped, when status is stopped. Otherwise null. |
completed |
Questions both sides have answered, out of total. With liveEmpty, questions the draft has answered. |
liveEmpty |
true when Live had no cards when the check started. Then only the draft runs: live stays null, same stays null, and summary counts the draft’s answers, with Live tokens 0 and no Live time. |
draftChanged |
true when the draft was saved, published or discarded after the check started, so its answers may be out of date. |
cases |
One per question. expected is the dataset row’s output. An empty string means the row has no expected answer yet, which is how a thumbs-down row is stored until someone writes one. It is null when the question did not come from a dataset. A model score on an empty expected answer is Error and includes message This row needs an expected answer. The grading model is not called. Text, JSON, and numeric scores still run. live and draft are null until that side has run. text is the answer, cut at 4,000 characters, or null with an error when the run failed. tokens is null when the model reported none. estimatedCostUsd is an estimate in US dollars, or null when price is no price or that side did not run. price is known, partial, or no price. A missing price is not zero. When evaluatorIds was sent, each side has scores: { "id", "name", "result" } with result Pass, Fail or Error, in the order of evaluatorIds. An answer that failed to run scores Error, not Fail. A model grade that is only a number is Error. A result of Pass, Fail, or Error, a boolean named pass, passed, or correct, or a grade with exactly one boolean, is used as the score. Numeric evaluators read totalTokens when the check recorded a token total, and apiLatency, llm and chain from the run’s wall-clock time. A prompt-token measure, a completion-token measure, or a total-token measure with no number scores Error, not Fail. That Error counts in the pass rate. A check with no evaluators leaves scores off. A recorded input also has preview, source and date. |
same |
true when both answers match, ignoring case and spacing. false when they differ or either side failed. null until both have run. Answers from a model can vary between runs even with no change. |
selection |
Set when the request sent count. requested is the count after clamping, available is how many distinct past questions were found (at most the question cap, CUTTLELY_CHECK_COUNT_MAX, 100 by default), used is how many of those were included, and truncated means the scan stopped early. null when the request sent a question list and no count, when it sent questionIds, and when it sent datasetId. |
skipped |
Set when the request sent questionIds. { "count", "ids" } for ids that were accepted and then missing when the run read them again. The ids are the typed values. The question text is not included. Absent on every other check, so an older response stays valid. |
summary |
Counts over the questions both sides answered: how many same, changed and with errors, total tokens per side, the middle (median) time per side in milliseconds, and an estimated cost per side. That total groups the answers’ token lines by model and prices each model once. The figure on one answer is priced on its own and can differ from the total by one hundred-millionth of a dollar. livePrice and draftPrice are known, partial, no price, or null when that side did not run. liveEstimatedCostUsd and draftEstimatedCostUsd are estimates in US dollars, or null when that side has no price. When evaluators ran, summary.scores.live and summary.scores.draft add passed, failed, errored and passRate (passed divided by passed + failed + errored, as a percentage from 0 to 100 with one decimal). With an empty Live, only draft is set. Without evaluators, scores is left off. |
verdict |
null unless this was a dataset check and it has finished (status done). Then { "result": "passed" or "failed", "threshold", "passed", "failed", "errored", "passRate" } for the draft. result is passed only when there is at least one score and passed times 100 is at least threshold times passed + failed + errored. Errored scores are in that total, so they are not passed. passRate is that share rounded to one decimal, for display. A rate that rounds to 100.0 still fails a mark of 100 when any score failed or errored. passRate null (no scores) is failed. A running, stopped, or failed check, and any check without a dataset, has verdict null. |
Reading a check does not return 403 when the caller can view the flow but not datasets or evaluators. On a dataset check, that caller gets an empty question and expected null: the row input and the expected output are not in the response. Each score is { "result" } only, with no evaluator id and no name. Pass, Fail, Error and the pass rate stay. A caller with datasets:view and evaluators:view receives the question, the expected answer, and the evaluator id and name. Recent questions and recorded form, webhook and schedule inputs are not dataset rows, so they stay. The same rules apply to the check included in Check setup.
Stop a check
Section titled “Stop a check”DELETE /api/v1/flow-drafts/:chatflowId/check/:checkId. Stops the run in progress and keeps the questions already answered. Returns the check, which reads stopped once the run has ended. Stopping a finished check changes nothing. This still stops a running check when CUTTLELY_PUBLISH_CHECK is off.