Project databases¶
Every project can have databases of its own, provisioned and run by Crios. They are the database of the app a session builds, and the same databases serve the project's workflows and agents: a row the app writes is a row a workflow can read, and a workflow's records sit next to the app's data. This page covers what a project's databases are, how they appear as connections, and how a workflow uses them.
What a project database is¶
- Its own database and login. Each project gets its own database and a login that reaches the project's databases and nothing else. Depending on the installation, project databases live on a shared project-database server, or on database instances Crios runs for that one project. Either way they are kept apart from the database Crios keeps its own records in, so nothing bound to a project database can see another project's data or Crios's.
- Postgres by default. A project keeps exactly one relational engine. New apps store data on PostgreSQL unless someone picks MySQL, where the installation offers it, in a session's Data view (Start on MySQL) before the first data lands. Data is a view of the session's App tab, or of Activity when the session has no app. A MySQL project's database works in Database read and Database write steps with Engine set to MySQL; Data Table and the Postgres trigger need PostgreSQL.
- Created on first use. A build session provisions the database when the app needs one, you can create it from a node's connection picker, and a workflow drafted in a session gets one when its database steps need it (see Creating one from a node). Nobody has to set it up in advance.
- Persistent. The data survives the session that created it.
- One or several. Besides its default database, a project can hold named databases.
The project's Storage page, under More in its tab strip, lists its databases with their engine, size and tier: Live app for the published app's, Build sandbox for a development copy. Only the project's owners and editors see that page.
Not every deployment runs project databases. Where one does not, creating one from a node answers This deployment runs no project databases — connect your own Postgres instead., and you bind a Postgres server of your own as an ordinary connection.
The connections Crios creates¶
Every project database comes with a connection Crios creates for it. They are listed on the project's Connectors page like any other connection, and they are what a workflow binds. Crios manages their settings: you can rename one, but not change its settings or delete it.
| Connection | What it reaches |
|---|---|
Project database |
The published app's database; where there is no development copy, the one database the build and the app share |
Project database (sandbox) |
The development copy a build session writes, on deployments that keep one |
Project database: <name> |
A named database, with (sandbox) at the end for its development copy |
App database (BYO) |
Your own server, after you made it the app database |
Where the deployment offers them, a project can also have a key-value store
and a document store, which get Project key-value store and
Project document store connections the same way.
In a node's connection picker these come first, in the Project databases group, each badged with what it is: published app, development copy, named store or your own server. A named database's development copy is badged development copy, like the default one's.
More than one database¶
A project is not limited to one relational database. Besides its default
database it can hold named databases, such as an analytics database
beside the app's main data. The build session creates one when the app
needs it, and you can ask the agent for one by name.
- Names. 1 to 32 characters: lowercase letters, digits,
-and_, starting with a letter or a digit. Capitals are folded to lowercase, anddefaultmeans the default database. - Same engine, same login. A named database lives beside the default one, on the project's relational engine (PostgreSQL or MySQL) and under the same login. Key-value and document stores hold one store each and have no named databases.
- Empty at first. A named database starts empty: nothing is copied into it when it is created. Like the default one, it is persistent from the moment it exists.
- Its own variable. The app reaches the default database through
DATABASE_URLand a named one throughDATABASE_URL_<NAME>: the name in capitals, with-turned into_.analyticsisDATABASE_URL_ANALYTICS,event-logisDATABASE_URL_EVENT_LOG. The published app gets the same variables. Because of that folding, two names that differ only in-versus_(event-logandevent_log) cannot both exist: the second one is refused. - Its own connections. Each named database gets a
Project database: <name>connection, plusProject database: <name> (sandbox)for its development copy where there is one. - Published with the app. Where the project has development copies, the published app gets its own copy of every named database; see The development copy and the published app.
A named database cannot be added while a server of your own is the app database. Named databases are not in the Data view's download yet, which covers the default database; see Moving a project out of Crios.
The development copy and the published app¶
On deployments that keep a development copy, a project has two copies of each of its databases:
- the development copy, which a build session writes while it builds and
tests the app (
Project database (sandbox)); - the published app's database, which the published app writes
(
Project database).
The first publish fills the published app's database with a copy of
the development copy: every table and row, demo data included. If that
database does not exist yet, the publish creates it as the copy. It can
also exist already, because an agent's memory, Create Crios project
database in the workflow editor, or a workflow drafted in a session made
it; the first publish then copies
the development data in beside what is there, as long as none of the
build's tables exist in it yet. If any of them do, nothing is copied,
because a workflow may have been filling that table: the app publishes
with the database as it is. To copy the development data over it anyway,
call POST /api/v1/sessions/{id}/data/project-database/promote with
{"overwrite": true} (see the API reference). Named databases get their copy the
same way, at the first publish, or at the next publish for a named
database added after that. Later publishes never copy again, so the data
the published app writes is kept. The copy never holds up a publish: if
it fails, the app is published anyway, without the development data.
Key-value and document stores are not copied; the published app's start
empty.
It also works the other way round: when a build session creates the development copy of the default database while the published app's database already exists, the development copy starts as a copy of the published app's data.
A development copy goes to sleep when nothing uses it: after an hour without use, once none of the project's sessions is still open. It wakes on its next use, such as a session reaching for it or a workflow step bound to it; in the meantime the Data view shows it as waking. The published app's database never sleeps.
Other deployments keep one copy of each database: the build session and the published app use the same database, and nothing is copied when you publish. The session's agent is told so. It seeds demo data once, removes it only when you ask, and once the app is live keeps its migrations additive: it adds tables and columns, and never drops or renames what the running app reads. Depending on the deployment, such a database can also go to sleep after a while without use (an hour by default, two hours on app.crios.ai), once none of the project's sessions is still open, but only while the project has no published app, no workflows, no enabled collector and no managed data store.
Binding a workflow node to the development copy is allowed, and the picker says what it means: Development copy — a build session writes here. Production writes go to the published app's database. When the project already has a published database, the same line offers to switch to it: Switch to Project database.
Using a project database in a workflow¶
The nodes that talk to a database — Database read, Database write, Data Table, Postgres trigger and Memory — bind a connection like any other node, and that connection decides which database they use. There is no separate switch for "the project's database": bind the project database's connection. Workflows saved before 2026-09-21 that relied on such a switch show a setup item instead; see Finishing setup.
When a required slot has exactly one candidate, it binds itself. A Memory node considers only databases Crios provisioned, so a project with one project database and any number of other Postgres connections still binds the project database. A named database counts as a candidate too, so once a project has one, a slot may have several candidates and waits for you to pick. A workflow Crios generates for you never binds a named database on its own; which one a workflow uses is your choice.
Creating one from a node¶
When a node's Postgres slot has no project database to offer, the picker
shows Create Crios project database. Clicking it provisions the
project's database — the published app's copy, on Postgres — and binds the
slot to its new Project database connection: Creating the project
database…, then Project database is ready and bound. It needs editor
access to the project and permission to add connections.
A workflow drafted in a session's chat gets its database without that
click. When the draft's database steps have nothing to bind, because the
project has no database and no connection that could serve them, Crios
creates the project's database, connects those steps to its
Project database connection, and says so with the draft. The tables the
draft's SQL uses are created when the draft is saved; a table that already
exists is left as it is. A project that already has a database or a
suitable connection keeps it: Crios does not add a second database beside
one a person chose. In a project that has never had a coding, review or
publishing session, a session's draft whose SQL uses tables the project's
database lacks adds them the same way when it is saved. Once the project
has had one, even one that built nothing, the draft adds none: Crios
counts the project as having an app, whose own migrations make that
database's tables. A workflow you build or generate in the workflow
editor does neither: there, the button above is how a database gets made.
Memory tables¶
A Memory node, and an agent's own memory,
keep their rows in tables of their own. In a database Crios provisioned they
are memory_kv, memory_log and memory_schema. In any other database —
your own server, or a connection someone added — the same tables are named
with a crios_wf_ prefix (crios_wf_memory_kv and so on), so they cannot
collide with the app's tables.
The first run creates the tables. The Memory node's Storage card shows where its rows go and whether the tables exist, and Create memory tables creates them ahead of the first run. That needs a connection whose login may create tables in the database.
Making your own server the app database¶
You can make an existing Postgres or MySQL server the app's database instead of the one Crios manages, from a session of the project:
- Open a session of the project and its Data view.
- Add the server as a connection, if it is not there yet.
- Open the connection's ⋮ menu and choose Use as app database, then confirm with Use it.
Crios checks that it can reach the server before recording anything, and
refuses a host that is local or internal (loopback, link-local addresses or
Crios's own database servers), judging a host name by the addresses it
resolves to. From then on every session and published app of the project uses that server as
its database, and it appears on the Connectors page as the
App database (BYO) connection. The Data view shows External app
database; Revert to managed switches the project back to the
Crios-managed database. Neither step changes any data: the managed
database keeps what it had while your server was bound, and reverting does
not touch your server.
Both steps take manage access to the project: the project owner, or an organization owner or admin. Without it, the Data view offers neither Use as app database nor Revert to managed.
Workflows that bind App database (BYO) read and write your server
directly. Managed data stores created while a Postgres
server of yours is the app database are created on that server.
Emptying a database¶
To clear a database out, for example to drop demo data before launch, wipe it from a session of the project:
- Open the session's Data view and the ⋮ menu of the store's row: Database (Database (sandbox) on installations that keep a development copy), Database: name for a named database, or Key-value store.
- Under Wipe, choose the copy to empty: Sandbox data or Published data. A store without a row of its own is wiped from the Database row's menu, where its items name it: Sandbox key-value store, Published document store and so on. The document store never has a row. Only a store that is ready can be wiped; until then its item is greyed out.
- Confirm with Wipe data. The confirmation names the store, with (sandbox) after the development copy's name: Wipe Database (sandbox)? empties the development copy, and Wipe Database? the published app's database.
Wiping deletes every table and all the data in that one database, and it cannot be undone. The database itself, its login and its connection stay, so everything bound to it keeps working, against an empty database.
- Sandbox data is a development copy. After you wipe it, the session's agent is asked to re-run the app's migrations, which re-creates the app's tables, empty.
- Published data is the published app's database: its production data, or, where there is no development copy, the one database the build and the app share. The published app re-creates its tables from its migrations on its next deploy.
Wiping the development copy takes editor access to the project, and wiping the published app's database manage access: the project owner, or an organization owner or admin. Without manage access the menu leaves Published data out. A session's agent cannot wipe a database. Crios never wipes a server of your own that you made the app database: empty it with your own tools. While it is bound, the project's default database cannot be wiped either.
Related pages¶
- Connectors & connections — how connections are made and bound.
- Managed data stores — fixed-shape tables in the project database, and the Database read and Database write nodes.
- Agents — where an agent's memory lives.
- Workflow memory — the Memory node and its rows.