Storage & database
Nodes that persist data between runs or query a database.
Database
What: Query or update a database. Supports SQL (PostgreSQL, MySQL, SQLite) and NoSQL (MongoDB).
Inputs: Any (parameters for the query).
Outputs: Query results (array of rows for SELECT, affected-row count for INSERT/UPDATE/DELETE, document(s) for NoSQL).
Configuration:
| Field | Notes |
|---|---|
| Credential | DB connection credential (host, port, user, password, database) |
| Operation | select, insert, update, delete, or raw query |
| Table / collection | For non-raw operations |
| Filter / where | Conditions |
| Data | For insert / update |
| Raw query | For full SQL or aggregation pipelines |
| Parameters | Bind parameters for raw queries, always use these instead of string interpolation to prevent injection |
Example (SELECT):
Operation: select
Table: orders
Where:
status: pending
customerId: {{ $trigger.body.customerId }}
Limit: 50Example (raw SQL):
SELECT id, total
FROM orders
WHERE created_at > $1 AND status = $2
ORDER BY total DESC
LIMIT 100With parameters: [{{ $node["LastSync"].json.timestamp }}, "paid"].
Tips:
- Use the raw query mode for joins, aggregations, and window functions; the form-style operations don't cover those.
- SQL injection is prevented when you use parameters. String-interpolating user data into a query is unsafe, never do it.
Set (variables)
What: Store a value in workflow-scoped state. The value is available to all downstream nodes via $workflow.variables.<name>, and persists for the duration of this run.
Inputs: A value (anything).
Outputs: The same value (so the node is transparent in the chain).
Configuration:
| Field | Notes |
|---|---|
| Name | Variable key |
| Value | Expression or literal |
| Scope | run (this execution only, default) or workflow (persisted across runs, admin-enabled feature) |
Use case:
- Store an intermediate value early in the workflow that you reference many times later, instead of long expressions.
- For
workflowscope: implement counters, last-sync timestamps, dedupe sets.
Example:
Name: lastSyncedAt
Value: {{ $node["Fetch latest"].json.timestamp }}
Scope: workflowLater nodes:
{{ $workflow.variables.lastSyncedAt }}Cache Storage
What: In-memory or persistent cache with TTL.
Inputs: Key and (optionally) value.
Outputs: Cached value (on get) or success status (on set / delete).
Configuration:
| Field | Notes |
|---|---|
| Backend | memory (per-worker), redis (workspace-wide; admin-configured) |
| Operation | get, set, delete, exists, increment |
| Key | Cache key |
| Value | For set |
| TTL | Seconds (defaults to backend default) |
Use cases:
- Cache an expensive HTTP call (rate-limited APIs, slow legacy systems).
- Deduplicate webhook deliveries, set a key when you see an event, skip if already set.
- Coordinate between concurrent runs of the same workflow.
Example (dedupe):
Operation: exists
Key: webhook:{{ $trigger.body.id }}Connect the result to an If node, true means we've seen this event already, skip the rest of the workflow.
Tips & gotchas
- Database credentials are sensitive. Use credential scope wisely, restrict to workspace or organisation level, not personal.
- Cache TTL is approximate. The cache may evict earlier under memory pressure. Don't rely on it for correctness, only for performance.
Setvariables aren't a substitute for a real DB. They're great for transient state inside a run; less great for "remember this forever."- NoSQL
whereclauses are more limited than SQL; for complex MongoDB queries, use the raw mode with the MongoDB aggregation pipeline syntax.
Related
- Expressions →
$workflow.variables - Connector catalog, DB-specific connectors (Postgres, MySQL, MongoDB) layered on the generic Database node
Found something out of date? This page lives in the Flero docs content set.