Skip to content

History settings

Version history and drafts read these environment variables when the server starts. How to use history: Version history.

After the PostgreSQL storage upgrade, the versions directory holds a local checkout. A replacement can recover the flow history from the application database. Recovery guide.

Variable Default Notes
CUTTLELY_VERSIONS unset, history on off, false, 0, or no turns history off. Case and surrounding spaces do not matter. Any other value leaves it on.
CUTTLELY_DRAFTS unset, drafts on off, false, 0, or no turns drafts off. Case and surrounding spaces do not matter. Other values leave them on.
CUTTLELY_CHECK_MAX_TOKENS 100000 Most tokens one publish check may use, Live and draft together. 1,000 to 2,000,000.
CUTTLELY_CHECK_MAX_SECONDS 180 Most seconds one publish check may run. 10 to 1,800.
CUTTLELY_CHECK_CONCURRENCY 2 Chatflow and agentflow questions per check, 1 to 8 at once. Harness checks always run one at a time.
CUTTLELY_VERSIONS_DIR unset The folder for the history repo. A relative path is resolved from the server’s working directory.
CUTTLELY_DATA_DIR ~/.cuttlely, or as the install sets it With CUTTLELY_VERSIONS_DIR unset, history is $CUTTLELY_DATA_DIR/versions.

History is on unless this variable turns it off. With it off:

  • Saves, restores, and deletes are not recorded.
  • The canvas does not show Version history or Last edited by.
  • GET /api/v1/flow-versions/status returns { "enabled": false }, the version list is empty, reading or comparing a version returns 404, and a restore returns 409 Version history is off on this server. See History API.
  • The history repo on disk is left as it is.

Turn it back on by removing the variable, or by setting any other value, and restarting. Saves made while history was off are not in it.

Where to set it:

Install Set it
Docker Add CUTTLELY_VERSIONS=off to .env next to docker-compose.yml, then docker compose up -d. Compose passes it to the container.
Render Add CUTTLELY_VERSIONS with the value off in the Dashboard.
From source CUTTLELY_VERSIONS=off bash scripts/start-cuttlely.sh, or export it before you start the server.

The server’s Jest setup sets CUTTLELY_VERSIONS=off unless a test sets it, so tests do not write a history repo in your home folder.

Drafts are on unless this variable turns them off. With them on, a chatflow, agentflow, harness, pipeline, or legacy multi-agent canvas saves to a draft. The prediction API, embeds, shared links, schedules, webhooks, a harness’s external runs, and a pipeline’s scheduled runs keep running Live until you select Publish. An assistant still saves straight to Live. See Drafts and Publish and Which canvases get a check. With them off:

  • The canvas saves straight to Live, and Restore puts a version Live at once.
  • The canvas shows no Draft label, Publish button, or Publish instantly setting.
  • GET /api/v1/flow-drafts/:chatflowId returns "enabled": false, and the other draft routes return 409 Drafts are off on this server. See Drafts API.
  • Drafts already saved are kept in the database. Turn drafts back on and they are there to publish or discard.

Each flow can also skip drafts with Publish instantly in its configuration, without changing the server setting.

Where to set it:

Install Set it
Docker Add CUTTLELY_DRAFTS=off to .env next to docker-compose.yml, then docker compose up -d. Compose passes it to the container.
Render Add CUTTLELY_DRAFTS with the value off in the Dashboard.
From source CUTTLELY_DRAFTS=off bash scripts/start-cuttlely.sh, or export it before you start the server.

The publish check replays recent questions against Live and the draft before Publish, so it uses the flow’s model and costs tokens. CUTTLELY_PUBLISH_CHECK turns that check on or off. The default is on, so an install that does not set it behaves as before. The caps are runtime settings: a valid host value wins, then the value saved in Server settings, then the default. They apply on the next check. A restart is not required. The full list, including the question cap and the scan cap, is in Server settings and the Server settings API.

  • CUTTLELY_CHECK_MAX_TOKENS: the most tokens one check may use, counting Live and the draft together. Default 100,000. Whole numbers from 1,000 to 2,000,000.
  • CUTTLELY_CHECK_MAX_SECONDS: the most seconds one check may run. Default 180. Whole numbers from 10 to 1,800.
  • CUTTLELY_CHECK_CONCURRENCY: chatflow and agentflow questions running at the same time. Default 2, from 1 to 8. Harness checks always run one question at a time. Each question still asks Live and then the draft, one after the other. Questions already started finish when a token or time limit is reached, so a check can go a little past the token cap. A model evaluator’s tokens count toward the same cap, including usage a provider reports only as an estimate. A provider that reports usage nowhere does not move this cap. That check is bounded only by the time limit.

A host value that is empty, not a whole number, or outside the range is ignored. The saved value is used when that is in range, and otherwise the default. Saving a value outside the range from Server settings is refused. When a limit is reached, the check stops starting new questions and shows the answers it has. How to run a check: Check recent questions before you publish. Set a host value the same way as CUTTLELY_DRAFTS above, or set it in Server settings.

CUTTLELY_GITHUB_ALLOW_FILE_REMOTES=on lets the GitHub copy accept a local bare repository, file:///absolute/path, instead of a GitHub repository. It is for testing Cuttlely without a GitHub account. Leave it unset on a real server.

For an end-to-end run of the GitHub card without an account, two more settings work only together with that one:

  • CUTTLELY_GITHUB_TEST_ROOT=/absolute/folder makes a repository named owner/name the bare repository /absolute/folder/owner/name.git.
  • CUTTLELY_GITHUB_TEST_API=http://127.0.0.1:PORT sends the repository list and Make a new repository calls to a local stand-in instead of https://api.github.com. The stand-in answers GET /user, GET /user/repos and POST /user/repos.

Both are ignored unless CUTTLELY_GITHUB_ALLOW_FILE_REMOTES=on. Leave all three unset on a real server. A connection made with the stand-in stops, and is never sent to github.com, if these settings are later removed. The stand-in replaces only the github.com API. A custom GitHub host is never sent to the stand-in.

The host is saved with the connection, not as an environment variable. An empty host, or github.com, keeps the public API at https://api.github.com and git at https://github.com/owner/name.git. How the other hosts are turned into API and git addresses is in Which GitHub host.

Before a token is sent to a custom host, Cuttlely resolves the name and refuses a blocked address. Loopback, link-local and metadata addresses are always refused for this token, including when Allow HTTP building blocks to call localhost is on. Private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, fc00::/7) are refused while HTTP_SECURITY_CHECK is unset or any value other than false. HTTP_DENY_LIST still applies. A GitHub Enterprise Server on a private network is not reachable with the default policy. There is no private-host list for version history. Git still does its own DNS lookup after that check. Redirects are disabled, and TLS hostname verification stays on, so a redirect cannot carry the token to another host.

The first of these that applies:

  1. CUTTLELY_VERSIONS_DIR.
  2. $CUTTLELY_DATA_DIR/versions.
  3. ~/.cuttlely/versions.
Install CUTTLELY_DATA_DIR History
Docker (docker-compose.yml) /var/cuttlely /var/cuttlely/versions
Render (render.yaml) /var/cuttlely /var/cuttlely/versions
scripts/start-cuttlely.sh .cuttlely in the repo, unless set .cuttlely/versions in the repo

The repo is created the first time history is used, by a save or by opening history, with a README.md and a first commit, Start version history. The server needs git on its path. The Docker image includes it.

Moving the repo: stop Cuttlely, move the folder, set CUTTLELY_VERSIONS_DIR to the new place, and start Cuttlely. A folder with no repo in it starts a new, empty history on the next save.

The repo layout and commit format are in Version files.

Promotion walks an ordered list of environments. Each one has:

Field Meaning
name What the promote page shows.
branch Where that environment publishes in the shared GitHub repository.
server The identity of the server that fills that place. environment on that server is this value.

The list is not an environment variable. It is saved on each server, with that server’s GitHub connection, in that server’s history repo, by PUT /api/v1/flow-versions/environment. It is not copied to the shared repository. See Label this server.

A non-fast-forward response is retried after the branch is fetched again. When the new tip descends from this server’s latest copy, the next versions are added on top of it. Copying stops for history only when the tip is not a descendant of that recorded copy.

Every server in the chain should keep the same list. The list is not compared by talking to the other servers. Each server that publishes records a fingerprint of its list with the copy. That copy is not finished until the fingerprint is on the shared repository: the publisher brings in any fingerprint already recorded, adds its own, and retries when another server recorded one at the same time. If the fingerprint still cannot be recorded, the copy stays unfinished and tries again. A server that reads offers new versions only when it read a fingerprint and that fingerprint matches its own list. When they differ, reading stops and nothing new is offered to promote, until this server saves the same list. Versions already offered stay. When a fingerprint record exists and this version has none, or the record cannot be read, reading stops the same way and nothing new is offered. A matching dev/prod fingerprint keeps promoting. Reading stops on a different list. For a named list, the server reads the note on the newest copied version reachable below the branch tip, so later GitHub commits may sit above that version; it stops when that newest copied version has no note. Named Connect also requires that reachable commit to be a real version before it accepts the note or saves the connection. A middle server that is waiting for its source’s first real version does not publish to its own branch. The one window that still allows a read with no fingerprint is the saved Dev and Prod pair, when the repository has no fingerprint record at all, because no server has recorded one yet. A named Prod whose record is missing keeps the versions already offered and offers nothing new. A failure to reach the repository is not that window. Saving a longer list while this server still publishes the same branch rewrites that fingerprint on the versions already copied, so the next environment can read them without a new version. Disconnect GitHub before a change that alters what this server reads or copies, then save the full list again. An unreadable list does not publish or read. The card shows The environment list could not be read. Save it again. It asks which row is this server before it saves, and it sends that identity with the full list. The saved pair is dev then prod, both publishing as main. It does not save without a chosen row. Saving it again drops versions that were already offered, clears the stopped message, and can be done without disconnecting. A connection file that cannot be read is a different failure: the sentence is The saved GitHub connection could not be read. Disconnect and connect again., and the card keeps the list. Saving the saved Dev and Prod pair in place of a named list that still parses, when that save would not change what this server reads or copies, is 409 The environment list on this server is still valid, so it was not replaced. and the file is left as it is. On a named list, connect is refused until this server’s environment is chosen, and the card does not count versions as waiting to be copied.

A server that was already labeled Dev or Prod, with no list in that file, loads as dev then prod. Both use the branch main. Dev copies there, and Prod reads it. You do not have to migrate that file. Saving environment as dev or prod with no list keeps writing that older file. Saving a longer list writes environment and environments together, and environment still names this server.

Dev, Staging and Prod:

{
"environment": "staging",
"environments": [
{ "name": "Dev", "branch": "main", "server": "dev" },
{ "name": "Staging", "branch": "staging", "server": "staging" },
{ "name": "Prod", "branch": "prod", "server": "prod" }
]
}

Promotion moves only to the next environment: Dev to Staging, then Staging to Prod. Dev to Prod is refused while Staging is between them. Each hop still runs the behavior check and matches credentials by name. With only Dev and Prod, promotion works as before. How to set this up: Add Staging between Dev and Prod.