Databases

Delete from Database

Removes the rows that match your conditions. Rows that don't match are left exactly as they were.

action.database_delete
DATABASEDelete from Database

At a glance

Takes
Any payload — its variables feed the conditions
Emits
rowsAffected
Good for
Retention rules and cleanup jobs

Set it up

Say which rows with the where-builder, and they go. This is the node behind every retention rule: a nightly Schedule into a Delete whose only condition is created_at older than (days) 30 keeps a table at a month, forever.

The inspector for Delete from Database: a table and the conditions that pick the rows.
The inspector for Delete from Database: a table and the conditions that pick the rows.

Configure

FieldDefaultWhat it does
Database—Which database to write to. The picker fills in the id.
Table—The table to delete from. It must already exist.
Where—Conditions, each a column, an operator, and usually a value.
MatchAll of the conditionsAll (AND) or Any (OR).
No conditions — reach EVERY rowOffThe deliberate opt-in for emptying the table.
Match capitalisation exactlyOffOff means equals, contains and friends ignore case.

The where-builder offers the same eighteen operators as Find in Database. Two of them read a date column against a window of time — older than (days) and within last (days) — and their value is a count of days, never a date. created_at works out of the box; a column of your own works too as long as it holds an ISO-8601 stamp, because both sides go through SQLite's date parser rather than being compared as text.

Output

Every key is available downstream as {{key}}.

KeyTypeValue
rowsAffectedNumberHow many rows were removed. 0 is a normal answer — it means the conditions matched nothing

Example: prune a clipping by id

Input supplies the row id. Delete from Database removes the row where id equals {{text}}. Log reports the count.

Three nodes: name a row, remove it, see the count.
Three nodes: name a row, remove it, see the count.

Paste this into the Flow Builder to get the same flow:

Take a row id from an Input trigger, delete that row from the clips table in Clipboard History, and log how many rows were removed.

Good to know

A database has no Trash. Deleted rows are gone. This node is always badged destructive.

No conditions means the node refuses to run. A blank condition list would empty the table, so it stops rather than guessing. Turn on No conditions — reach EVERY row if that really is what you want.

A window that isn't a positive number of days stops the run. last week, 30 days, 0 and a missing variable are all refused rather than turned into some other window — the same rule every condition follows, for the same reason.

A value that isn't a date simply never matches. Point older than (days) at a column of names and it selects no rows, in either direction. Anything more particular than "N days" belongs in Run SQL.