Skip to content

Cached SQL Query Node

Data/DataFusion

Execute a SQL query against a DataFusion session, remembering the result in the app's cache. While a live cached result exists for this node's session, query and parameter values, the query — and any deferred table mounting — is skipped entirely and the cached rows are returned. Cached results do not notice changes to the underlying data; pick a lifetime that matches how fresh the data must be. Write any value that comes from outside the flow as a $placeholder and wire it into the pin that appears — never build the SQL string around it.

df_sql_query_cacheddata
Inputs7
Outputs5
Security exposure8/10
Packagedata

Ratings

Scores range from 0 to 10. Higher values mean more impact, exposure, or operational weight.

SecurityAttack surface and exposure impact.
8/10High
PrivacyPotential sensitivity of processed data.
8/10High
PerformanceRuntime or resource pressure.
9/10High
GovernancePolicy, audit, or compliance impact.
8/10High
ReliabilityOperational stability considerations.
8/10High
CostExternal or compute cost impact.
9/10High

Input Pins

7

Input

Execution
exec_in

Trigger execution

Session

Struct
session

DataFusion session with registered tables

DataFusionSessionDataFusionSession1 fields
cache_keystringrequired

Query

String
query

SQL query to execute (e.g., SELECT * FROM mytable WHERE column > 10). Use $placeholders for values that come from the flow (SELECT * FROM users WHERE id = $user_id) — each one adds an input pin to wire the value into, and each distinct value is cached separately. Placeholders stand for values only; table and column names cannot be parameterized.

Default SELECT * FROM data LIMIT 100

Params

Struct
params

Values for the query's $placeholders, as an object keyed by placeholder name without the $ (e.g. {"customer_id": 42}). Only needed when the query itself comes from a wire — a literal query derives one pin per placeholder instead. Where both supply the same name, the derived pin wins unless it is empty.

Default {}

Scope

String
scope

App shares cached results with everyone who can run this app. User keeps them private to whoever triggered the run.

Default App
AppUser

Namespace

String
namespace

Group name for the cached results. Invalidating this namespace (Invalidate Cache Namespace node) clears them in one call; it also keeps results from unrelated flows apart.

Default datafusion

Lifetime (s)

Integer
ttl_seconds

Seconds until a cached result expires and the query runs again. 0 keeps it until it is deleted.

Default 300

Output Pins

5

Done

Execution
exec_out

Query executed or served from cache

Table

Struct
table

Query results as a CSVTable (columnar format, good for analytics)

CSVTableCSVTable6 fields
namestring | null

Optional name/identifier for this table

titlestring | null

Optional title text found above the table in the source sheet

rangestring | null

Optional A1 range the table was extracted from (e.g. "A3:F42")

headersArray<string>required
itemsstringarray item
rowsArray<Array<Cell>>required
itemsArray<Cell>array item
itemsCellarray item
variant 1nullvariant
variant 2booleanvariant
variant 3integer:int64variant
format int64
variant 4number:doublevariant
format double
variant 5stringvariant
+1 more fields
sourceanyOf (2)
variant 1FlowPathvariant
pathstringrequired
store_refstringrequired
cache_store_refstring | null
variant 2nullvariant

Rows

Struct Array
rows

Query results as array of row structs with Flow-Like-compatible values. Rows derive from the Table representation so cached and fresh runs are identical: date-like strings are normalized to ISO form and unsigned values beyond the signed 64-bit range become strings.

Row Count

Integer
row_count

Number of rows in the result

From Cache

Boolean
from_cache

True when the result was served from the cache and the query never ran

Node Info

Internal name
df_sql_query_cached
Category
Data/DataFusion
Version
2