@lightdash/common 1.229.0 → 1.230.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { QuerySourceType, type DuckdbSourceQuery, type SemanticLayerSourceQuery, type SqlSourceQuery } from '../../../../types/querySources';
2
+ import { QuerySourceType, type DuckdbSourceQuery, type ExternalSourceQuery, type SemanticLayerSourceQuery, type SqlSourceQuery } from '../../../../types/querySources';
3
3
  export declare const DEFAULT_COMPOSER_QUERY_LIMIT = 500;
4
4
  export declare const DEFAULT_COMPOSER_QUERY_MAX_LIMIT = 5000;
5
- export declare const TOOL_COMPOSER_QUERIES_DESCRIPTION = "Execute a composer query: a pipeline of one or more queries submitted together, where DuckDB queries can join and transform the results of the other queries. Results are stored as a chart artifact that renders the terminal node's results table in the thread.\n\nUse this tool when a single source cannot answer the question \u2014 e.g. joining a semantic layer metric query with raw warehouse SQL, or post-processing prior results with SQL. A pipeline may also be a single node: a lone \"sql\" node is how raw warehouse SQL runs when no standalone runSql tool is available.\n\nHow to build a pipeline:\n- Every query is a node. Name each node with \"nodeId\" (letters, digits, underscores; starting with a letter or underscore).\n- \"semanticLayer\" nodes run a metric query against an explore. Result columns are named by field id \u2014 exactly the dimensions and metrics requested (e.g. metric \"payments_total_revenue\" yields column \"payments_total_revenue\").\n- \"sql\" nodes run raw SQL against the project's data warehouse, in the warehouse's SQL dialect. Result columns are the SELECT output names. SQL execution may require the user to approve the SQL first.\n- \"duckdb\" nodes run DuckDB SQL over other queries' results. Declare which results the SQL reads via \"references\": the shorthand array form lists node ids from this submission, each exposed as a table named by its node id ([\"orders\", \"revenue\"] lets the SQL run SELECT * FROM orders JOIN revenue ...); the map form aliases tables or references stored results by queryUuid ({\"o\": \"orders\", \"prev\": \"<queryUuid>\"}). A referenced table's columns are the upstream result's columns.\n- The \"terminal\" node is the one whose results the artifact shows and whose rows are returned to you. By default it is the unique sink (the one node no other node references); pass \"terminalNodeId\" explicitly when the pipeline has multiple sinks.\n\nResults are reusable across calls:\n- Every call returns a queryUuid per node. Any of them \u2014 not just the terminal one \u2014 can be referenced by a later call via the map form of \"references\".\n- Referencing a queryUuid reads the stored result; the query behind it is NOT re-run. A duckdb-only submission over stored results touches no source and needs no SQL approval, however many times you iterate.\n- This supports step-by-step work: run a source query once, then explore its result with as many follow-up duckdb submissions over the same queryUuid as you need.\n- The artifact shown in the thread always renders your LATEST call's terminal result, so finish with the submission that produces the table the user should see \u2014 referencing earlier queryUuids keeps that final pipeline small.\n\nReturns the terminal node's result columns and a CSV preview of its rows, plus per-node queryUuids.";
5
+ export declare const TOOL_COMPOSER_QUERIES_DESCRIPTION = "Execute a composer query: a pipeline of one or more queries submitted together, where DuckDB queries can join and transform the results of the other queries. Results are stored as a chart artifact that renders the terminal node's results table in the thread.\n\nUse this tool when a single source cannot answer the question \u2014 e.g. joining a semantic layer metric query with an uploaded CSV, joining with raw warehouse SQL, or post-processing prior results with SQL. A pipeline may also be a single node: a lone \"sql\" node is how raw warehouse SQL runs when no standalone runSql tool is available.\n\nHow to build a pipeline:\n- Every query is a node. Name each node with \"nodeId\" (letters, digits, underscores; starting with a letter or underscore).\n- \"semanticLayer\" nodes run a metric query against an explore. Result columns are named by field id \u2014 exactly the dimensions and metrics requested (e.g. metric \"payments_total_revenue\" yields column \"payments_total_revenue\").\n- \"sql\" nodes run raw SQL against the project's data warehouse, in the warehouse's SQL dialect. Result columns are the SELECT output names. SQL execution may require the user to approve the SQL first.\n- \"external\" nodes run DuckDB SQL over durable external tables such as uploaded CSVs and connected Google Sheets. Declare the tables via \"tables\": an array of table names, or a map of {sqlAlias: tableNameOrTableUuid}. Use the exact table name or UUID supplied in the user's attached-table context. Result columns are the SELECT output names. A single external node can read multiple external tables.\n- \"duckdb\" nodes run DuckDB SQL over other queries' results. Declare which results the SQL reads via \"references\": the shorthand array form lists node ids from this submission, each exposed as a table named by its node id ([\"orders\", \"revenue\"] lets the SQL run SELECT * FROM orders JOIN revenue ...); the map form aliases tables or references stored results by queryUuid ({\"o\": \"orders\", \"prev\": \"<queryUuid>\"}). A referenced table's columns are the upstream result's columns.\n- The \"terminal\" node is the one whose results the artifact shows and whose rows are returned to you. By default it is the unique sink (the one node no other node references); pass \"terminalNodeId\" explicitly when the pipeline has multiple sinks.\n\nResults are reusable across calls:\n- Every call returns a queryUuid per node. Any of them \u2014 not just the terminal one \u2014 can be referenced by a later call via the map form of \"references\".\n- Referencing a queryUuid reads the stored result; the query behind it is NOT re-run. A duckdb-only submission over stored results touches no source and needs no SQL approval, however many times you iterate.\n- This supports step-by-step work: run a source query once, then explore its result with as many follow-up duckdb submissions over the same queryUuid as you need.\n- The artifact shown in the thread always renders your LATEST call's terminal result, so finish with the submission that produces the table the user should see \u2014 referencing earlier queryUuids keeps that final pipeline small.\n\nReturns the terminal node's result columns and a CSV preview of its rows, plus per-node queryUuids.";
6
6
  type CreateToolComposerQueriesArgsSchemaOptions = {
7
7
  maxLimit?: number;
8
8
  defaultLimit?: number;
@@ -105,6 +105,24 @@ export declare const createToolComposerQueriesArgsSchema: ({ maxLimit, defaultLi
105
105
  sql: string;
106
106
  references: string[] | Record<string, string>;
107
107
  limit?: number | undefined;
108
+ }>, z.ZodObject<{
109
+ sourceType: z.ZodLiteral<QuerySourceType.EXTERNAL>;
110
+ nodeId: z.ZodString;
111
+ sql: z.ZodString;
112
+ tables: z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodRecord<z.ZodString, z.ZodString>]>;
113
+ limit: z.ZodDefault<z.ZodNumber>;
114
+ }, "strip", z.ZodTypeAny, {
115
+ sourceType: QuerySourceType.EXTERNAL;
116
+ nodeId: string;
117
+ sql: string;
118
+ tables: string[] | Record<string, string>;
119
+ limit: number;
120
+ }, {
121
+ sourceType: QuerySourceType.EXTERNAL;
122
+ nodeId: string;
123
+ sql: string;
124
+ tables: string[] | Record<string, string>;
125
+ limit?: number | undefined;
108
126
  }>]>, "many">;
109
127
  terminalNodeId: z.ZodNullable<z.ZodString>;
110
128
  }, z.UnknownKeysParam, z.ZodTypeAny, {
@@ -137,6 +155,12 @@ export declare const createToolComposerQueriesArgsSchema: ({ maxLimit, defaultLi
137
155
  sql: string;
138
156
  references: string[] | Record<string, string>;
139
157
  limit: number;
158
+ } | {
159
+ sourceType: QuerySourceType.EXTERNAL;
160
+ nodeId: string;
161
+ sql: string;
162
+ tables: string[] | Record<string, string>;
163
+ limit: number;
140
164
  })[];
141
165
  terminalNodeId: string | null;
142
166
  }, {
@@ -169,6 +193,12 @@ export declare const createToolComposerQueriesArgsSchema: ({ maxLimit, defaultLi
169
193
  sql: string;
170
194
  references: string[] | Record<string, string>;
171
195
  limit?: number | undefined;
196
+ } | {
197
+ sourceType: QuerySourceType.EXTERNAL;
198
+ nodeId: string;
199
+ sql: string;
200
+ tables: string[] | Record<string, string>;
201
+ limit?: number | undefined;
172
202
  })[];
173
203
  terminalNodeId: string | null;
174
204
  }>;
@@ -270,6 +300,24 @@ export declare const toolComposerQueriesArgsSchema: z.ZodObject<{
270
300
  sql: string;
271
301
  references: string[] | Record<string, string>;
272
302
  limit?: number | undefined;
303
+ }>, z.ZodObject<{
304
+ sourceType: z.ZodLiteral<QuerySourceType.EXTERNAL>;
305
+ nodeId: z.ZodString;
306
+ sql: z.ZodString;
307
+ tables: z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodRecord<z.ZodString, z.ZodString>]>;
308
+ limit: z.ZodDefault<z.ZodNumber>;
309
+ }, "strip", z.ZodTypeAny, {
310
+ sourceType: QuerySourceType.EXTERNAL;
311
+ nodeId: string;
312
+ sql: string;
313
+ tables: string[] | Record<string, string>;
314
+ limit: number;
315
+ }, {
316
+ sourceType: QuerySourceType.EXTERNAL;
317
+ nodeId: string;
318
+ sql: string;
319
+ tables: string[] | Record<string, string>;
320
+ limit?: number | undefined;
273
321
  }>]>, "many">;
274
322
  terminalNodeId: z.ZodNullable<z.ZodString>;
275
323
  }, z.UnknownKeysParam, z.ZodTypeAny, {
@@ -302,6 +350,12 @@ export declare const toolComposerQueriesArgsSchema: z.ZodObject<{
302
350
  sql: string;
303
351
  references: string[] | Record<string, string>;
304
352
  limit: number;
353
+ } | {
354
+ sourceType: QuerySourceType.EXTERNAL;
355
+ nodeId: string;
356
+ sql: string;
357
+ tables: string[] | Record<string, string>;
358
+ limit: number;
305
359
  })[];
306
360
  terminalNodeId: string | null;
307
361
  }, {
@@ -334,6 +388,12 @@ export declare const toolComposerQueriesArgsSchema: z.ZodObject<{
334
388
  sql: string;
335
389
  references: string[] | Record<string, string>;
336
390
  limit?: number | undefined;
391
+ } | {
392
+ sourceType: QuerySourceType.EXTERNAL;
393
+ nodeId: string;
394
+ sql: string;
395
+ tables: string[] | Record<string, string>;
396
+ limit?: number | undefined;
337
397
  })[];
338
398
  terminalNodeId: string | null;
339
399
  }>;
@@ -343,7 +403,7 @@ export type ToolComposerQueryNode = z.infer<typeof toolComposerQueriesArgsSchema
343
403
  * query source service takes. The explicit return types pin drift at compile
344
404
  * time: if types/querySources.ts changes incompatibly, this stops compiling.
345
405
  */
346
- export declare const toolComposerQueryNodeToSourceQuery: (node: ToolComposerQueryNode) => SemanticLayerSourceQuery | SqlSourceQuery | DuckdbSourceQuery;
406
+ export declare const toolComposerQueryNodeToSourceQuery: (node: ToolComposerQueryNode) => SemanticLayerSourceQuery | SqlSourceQuery | DuckdbSourceQuery | ExternalSourceQuery;
347
407
  export declare const toolComposerQueriesOutputSchema: z.ZodObject<{
348
408
  result: z.ZodString;
349
409
  metadata: z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"toolComposerQueryArgs.d.ts","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolComposerQueryArgs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EACH,eAAe,EACf,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EAC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qB,KAEzB,wBAAwB,GACxB,cAAc,GACd,iBAAiB,GACjB,mBA2CL,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;EAK1C,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CACzC,OAAO,6BAA6B,CACvC,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,+BAA+B,CACzC,CAAC"}
@@ -10,12 +10,13 @@ exports.DEFAULT_COMPOSER_QUERY_LIMIT = 500;
10
10
  exports.DEFAULT_COMPOSER_QUERY_MAX_LIMIT = 5000;
11
11
  exports.TOOL_COMPOSER_QUERIES_DESCRIPTION = `Execute a composer query: a pipeline of one or more queries submitted together, where DuckDB queries can join and transform the results of the other queries. Results are stored as a chart artifact that renders the terminal node's results table in the thread.
12
12
 
13
- Use this tool when a single source cannot answer the question — e.g. joining a semantic layer metric query with raw warehouse SQL, or post-processing prior results with SQL. A pipeline may also be a single node: a lone "sql" node is how raw warehouse SQL runs when no standalone runSql tool is available.
13
+ Use this tool when a single source cannot answer the question — e.g. joining a semantic layer metric query with an uploaded CSV, joining with raw warehouse SQL, or post-processing prior results with SQL. A pipeline may also be a single node: a lone "sql" node is how raw warehouse SQL runs when no standalone runSql tool is available.
14
14
 
15
15
  How to build a pipeline:
16
16
  - Every query is a node. Name each node with "nodeId" (letters, digits, underscores; starting with a letter or underscore).
17
17
  - "semanticLayer" nodes run a metric query against an explore. Result columns are named by field id — exactly the dimensions and metrics requested (e.g. metric "payments_total_revenue" yields column "payments_total_revenue").
18
18
  - "sql" nodes run raw SQL against the project's data warehouse, in the warehouse's SQL dialect. Result columns are the SELECT output names. SQL execution may require the user to approve the SQL first.
19
+ - "external" nodes run DuckDB SQL over durable external tables such as uploaded CSVs and connected Google Sheets. Declare the tables via "tables": an array of table names, or a map of {sqlAlias: tableNameOrTableUuid}. Use the exact table name or UUID supplied in the user's attached-table context. Result columns are the SELECT output names. A single external node can read multiple external tables.
19
20
  - "duckdb" nodes run DuckDB SQL over other queries' results. Declare which results the SQL reads via "references": the shorthand array form lists node ids from this submission, each exposed as a table named by its node id (["orders", "revenue"] lets the SQL run SELECT * FROM orders JOIN revenue ...); the map form aliases tables or references stored results by queryUuid ({"o": "orders", "prev": "<queryUuid>"}). A referenced table's columns are the upstream result's columns.
20
21
  - The "terminal" node is the one whose results the artifact shows and whose rows are returned to you. By default it is the unique sink (the one node no other node references); pass "terminalNodeId" explicitly when the pipeline has multiple sinks.
21
22
 
@@ -89,10 +90,22 @@ const createToolComposerQueriesArgsSchema = ({ maxLimit = exports.DEFAULT_COMPOS
89
90
  .describe('Which query results the SQL reads. Shorthand array of node ids from this submission (each exposed as a table named by its node id), or a map of {tableName: nodeIdOrQueryUuid} for aliasing or reusing stored results from earlier calls without re-running them.'),
90
91
  limit: limitSchema,
91
92
  });
93
+ const externalNodeSchema = zod_1.z.object({
94
+ sourceType: zod_1.z.literal(querySources_1.QuerySourceType.EXTERNAL),
95
+ nodeId: nodeIdSchema,
96
+ sql: zod_1.z
97
+ .string()
98
+ .describe('DuckDB SQL over the declared external source tables. Each table is exposed under its name or map alias.'),
99
+ tables: zod_1.z
100
+ .union([zod_1.z.array(zod_1.z.string()), zod_1.z.record(zod_1.z.string(), zod_1.z.string())])
101
+ .describe('External tables read by this query: an array of table names, or a map of {sqlAlias: tableNameOrTableUuid}. Prefer the table UUID from attached-table context so renames cannot break the query.'),
102
+ limit: limitSchema,
103
+ });
92
104
  const sourceQueryNodeSchema = zod_1.z.discriminatedUnion('sourceType', [
93
105
  semanticLayerNodeSchema,
94
106
  sqlNodeSchema,
95
107
  duckdbNodeSchema,
108
+ externalNodeSchema,
96
109
  ]);
97
110
  return (0, toolSchemaBuilder_1.createToolSchema)()
98
111
  .extend({
@@ -153,6 +166,14 @@ const toolComposerQueryNodeToSourceQuery = (node) => {
153
166
  references: node.references,
154
167
  limit: node.limit,
155
168
  };
169
+ case querySources_1.QuerySourceType.EXTERNAL:
170
+ return {
171
+ sourceType: node.sourceType,
172
+ nodeId: node.nodeId,
173
+ sql: node.sql,
174
+ tables: node.tables,
175
+ limit: node.limit,
176
+ };
156
177
  default:
157
178
  return (0, assertUnreachable_1.default)(node, 'Unknown composer query node');
158
179
  }
@@ -1 +1 @@
1
- {"version":3,"file":"toolComposerQueryArgs.js","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolComposerQueryArgs.ts"],"names":[],"mappings":";;;;AAAA,6BAAwB;AAKxB,iEAKwC;AACxC,oGAAoE;AACpE,4DAAwD;AAE3C,QAAA,4BAA4B,GAAG,GAAG,CAAC;AACnC,QAAA,gCAAgC,GAAG,IAAI,CAAC;AAExC,QAAA,iCAAiC,GAAG;;;;;;;;;;;;;;;;;oGAiBmD,CAAC;AAErG,MAAM,YAAY,GAAG,OAAC;KACjB,MAAM,EAAE;KACR,KAAK,CACF,+BAA+B,EAC/B,oFAAoF,CACvF;KACA,QAAQ,CACL,4IAA4I,CAC/I,CAAC;AAEN,MAAM,0BAA0B,GAAG,OAAC;KAC/B,MAAM,CAAC;IACJ,UAAU,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC/B,iBAAiB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC5C,CAAC;KACD,QAAQ,CACL,8OAA8O,CACjP,CAAC;AAEN,MAAM,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;IACpD,UAAU,EAAE,OAAC;SACR,OAAO,EAAE;SACT,QAAQ,CAAC,yDAAyD,CAAC;CAC3E,CAAC,CAAC;AAOI,MAAM,mCAAmC,GAAG,CAAC,EAChD,QAAQ,GAAG,QAAA,gCAAgC,EAC3C,YAAY,GAAG,Q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AU;gBAC3B,KAAK,EAAE,IAAI,CAAC,KAAK;aACpB,CAAC;QACN,KAAK,8BAAe,CAAC,QAAQ;YACzB,OAAO;gBACH,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,KAAK,EAAE,IAAI,CAAC,KAAK;aACpB,CAAC;QACN;YACI,OAAO,IAAA,2BAAiB,EAAC,IAAI,EAAE,6BAA6B,CAAC,CAAC;IACtE,CAAC;AACL,CAAC,CAAC;AAjDW,QAAA,kCAAkC,GAAlC,kCAAkC,CAiD7C;AAEW,QAAA,+BAA+B,GAAG,OAAC,CAAC,MAAM,CAAC;IACpD,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC;QACf,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;KAC9D,CAAC;CACL,CAAC,CAAC"}
@@ -2498,7 +2498,7 @@
2498
2498
  "openWorldHint": false,
2499
2499
  "readOnlyHint": true
2500
2500
  },
2501
- "description": "Execute a composer query: a pipeline of one or more queries submitted together, where DuckDB queries can join and transform the results of the other queries. Results are stored as a chart artifact that renders the terminal node's results table in the thread.\n\nUse this tool when a single source cannot answer the question — e.g. joining a semantic layer metric query with raw warehouse SQL, or post-processing prior results with SQL. A pipeline may also be a single node: a lone \"sql\" node is how raw warehouse SQL runs when no standalone runSql tool is available.\n\nHow to build a pipeline:\n- Every query is a node. Name each node with \"nodeId\" (letters, digits, underscores; starting with a letter or underscore).\n- \"semanticLayer\" nodes run a metric query against an explore. Result columns are named by field id — exactly the dimensions and metrics requested (e.g. metric \"payments_total_revenue\" yields column \"payments_total_revenue\").\n- \"sql\" nodes run raw SQL against the project's data warehouse, in the warehouse's SQL dialect. Result columns are the SELECT output names. SQL execution may require the user to approve the SQL first.\n- \"duckdb\" nodes run DuckDB SQL over other queries' results. Declare which results the SQL reads via \"references\": the shorthand array form lists node ids from this submission, each exposed as a table named by its node id ([\"orders\", \"revenue\"] lets the SQL run SELECT * FROM orders JOIN revenue ...); the map form aliases tables or references stored results by queryUuid ({\"o\": \"orders\", \"prev\": \"<queryUuid>\"}). A referenced table's columns are the upstream result's columns.\n- The \"terminal\" node is the one whose results the artifact shows and whose rows are returned to you. By default it is the unique sink (the one node no other node references); pass \"terminalNodeId\" explicitly when the pipeline has multiple sinks.\n\nResults are reusable across calls:\n- Every call returns a queryUuid per node. Any of them — not just the terminal one — can be referenced by a later call via the map form of \"references\".\n- Referencing a queryUuid reads the stored result; the query behind it is NOT re-run. A duckdb-only submission over stored results touches no source and needs no SQL approval, however many times you iterate.\n- This supports step-by-step work: run a source query once, then explore its result with as many follow-up duckdb submissions over the same queryUuid as you need.\n- The artifact shown in the thread always renders your LATEST call's terminal result, so finish with the submission that produces the table the user should see — referencing earlier queryUuids keeps that final pipeline small.\n\nReturns the terminal node's result columns and a CSV preview of its rows, plus per-node queryUuids.",
2501
+ "description": "Execute a composer query: a pipeline of one or more queries submitted together, where DuckDB queries can join and transform the results of the other queries. Results are stored as a chart artifact that renders the terminal node's results table in the thread.\n\nUse this tool when a single source cannot answer the question — e.g. joining a semantic layer metric query with an uploaded CSV, joining with raw warehouse SQL, or post-processing prior results with SQL. A pipeline may also be a single node: a lone \"sql\" node is how raw warehouse SQL runs when no standalone runSql tool is available.\n\nHow to build a pipeline:\n- Every query is a node. Name each node with \"nodeId\" (letters, digits, underscores; starting with a letter or underscore).\n- \"semanticLayer\" nodes run a metric query against an explore. Result columns are named by field id — exactly the dimensions and metrics requested (e.g. metric \"payments_total_revenue\" yields column \"payments_total_revenue\").\n- \"sql\" nodes run raw SQL against the project's data warehouse, in the warehouse's SQL dialect. Result columns are the SELECT output names. SQL execution may require the user to approve the SQL first.\n- \"external\" nodes run DuckDB SQL over durable external tables such as uploaded CSVs and connected Google Sheets. Declare the tables via \"tables\": an array of table names, or a map of {sqlAlias: tableNameOrTableUuid}. Use the exact table name or UUID supplied in the user's attached-table context. Result columns are the SELECT output names. A single external node can read multiple external tables.\n- \"duckdb\" nodes run DuckDB SQL over other queries' results. Declare which results the SQL reads via \"references\": the shorthand array form lists node ids from this submission, each exposed as a table named by its node id ([\"orders\", \"revenue\"] lets the SQL run SELECT * FROM orders JOIN revenue ...); the map form aliases tables or references stored results by queryUuid ({\"o\": \"orders\", \"prev\": \"<queryUuid>\"}). A referenced table's columns are the upstream result's columns.\n- The \"terminal\" node is the one whose results the artifact shows and whose rows are returned to you. By default it is the unique sink (the one node no other node references); pass \"terminalNodeId\" explicitly when the pipeline has multiple sinks.\n\nResults are reusable across calls:\n- Every call returns a queryUuid per node. Any of them — not just the terminal one — can be referenced by a later call via the map form of \"references\".\n- Referencing a queryUuid reads the stored result; the query behind it is NOT re-run. A duckdb-only submission over stored results touches no source and needs no SQL approval, however many times you iterate.\n- This supports step-by-step work: run a source query once, then explore its result with as many follow-up duckdb submissions over the same queryUuid as you need.\n- The artifact shown in the thread always renders your LATEST call's terminal result, so finish with the submission that produces the table the user should see — referencing earlier queryUuids keeps that final pipeline small.\n\nReturns the terminal node's result columns and a CSV preview of its rows, plus per-node queryUuids.",
2502
2502
  "inputSchema": {
2503
2503
  "$schema": "http://json-schema.org/draft-07/schema#",
2504
2504
  "additionalProperties": false,
@@ -2661,6 +2661,53 @@
2661
2661
  "references"
2662
2662
  ],
2663
2663
  "type": "object"
2664
+ },
2665
+ {
2666
+ "additionalProperties": false,
2667
+ "properties": {
2668
+ "limit": {
2669
+ "$ref": "#/properties/queries/items/anyOf/0/properties/limit",
2670
+ "default": 500,
2671
+ "description": "Maximum number of rows this node returns. Defaults to 500, max 5000."
2672
+ },
2673
+ "nodeId": {
2674
+ "description": "Names this query so other queries in the same submission can reference its results. Also the DuckDB table name its results are exposed as.",
2675
+ "pattern": "^[a-zA-Z_][a-zA-Z0-9_]{0,62}$",
2676
+ "type": "string"
2677
+ },
2678
+ "sourceType": {
2679
+ "const": "external",
2680
+ "type": "string"
2681
+ },
2682
+ "sql": {
2683
+ "description": "DuckDB SQL over the declared external source tables. Each table is exposed under its name or map alias.",
2684
+ "type": "string"
2685
+ },
2686
+ "tables": {
2687
+ "anyOf": [
2688
+ {
2689
+ "items": {
2690
+ "type": "string"
2691
+ },
2692
+ "type": "array"
2693
+ },
2694
+ {
2695
+ "additionalProperties": {
2696
+ "type": "string"
2697
+ },
2698
+ "type": "object"
2699
+ }
2700
+ ],
2701
+ "description": "External tables read by this query: an array of table names, or a map of {sqlAlias: tableNameOrTableUuid}. Prefer the table UUID from attached-table context so renames cannot break the query."
2702
+ }
2703
+ },
2704
+ "required": [
2705
+ "sourceType",
2706
+ "nodeId",
2707
+ "sql",
2708
+ "tables"
2709
+ ],
2710
+ "type": "object"
2664
2711
  }
2665
2712
  ]
2666
2713
  },