Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

feat(baserow): add AI actions and output schemas (#15797)

Kishan Parmar4301695b91de
diff --git a/packages/pieces/community/baserow/package.json b/packages/pieces/community/baserow/package.json
index bab3016eeed..32b4e05b8e7 100644
--- a/packages/pieces/community/baserow/package.json
+++ b/packages/pieces/community/baserow/package.json
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-baserow",
- "version": "0.10.0",
+ "version": "0.11.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"scripts": {
diff --git a/packages/pieces/community/baserow/src/index.ts b/packages/pieces/community/baserow/src/index.ts
index 8613e1ba451..7987f6cedd7 100644
--- a/packages/pieces/community/baserow/src/index.ts
+++ b/packages/pieces/community/baserow/src/index.ts
@@ -16,6 +16,38 @@ import { batchUpdateRowsAction } from './lib/actions/batch-update-rows';
import { batchDeleteRowsAction } from './lib/actions/batch-delete-rows';
import { upsertRowAction } from './lib/actions/upsert-row';
import { uploadFileAction } from './lib/actions/upload-file';
+import { createRowAiAction } from './lib/actions/create-row-ai';
+import { getRowAiAction } from './lib/actions/get-row-ai';
+import { listRowsAiAction } from './lib/actions/list-rows-ai';
+import { findRowAiAction } from './lib/actions/find-row-ai';
+import { updateRowAiAction } from './lib/actions/update-row-ai';
+import { upsertRowAiAction } from './lib/actions/upsert-row-ai';
+import { deleteRowAiAction } from './lib/actions/delete-row-ai';
+import { batchCreateRowsAiAction } from './lib/actions/batch-create-rows-ai';
+import { batchUpdateRowsAiAction } from './lib/actions/batch-update-rows-ai';
+import { batchDeleteRowsAiAction } from './lib/actions/batch-delete-rows-ai';
+import { aggregateFieldAiAction } from './lib/actions/aggregate-field-ai';
+import { listWorkspacesAction } from './lib/actions/list-workspaces';
+import { listDatabasesAction } from './lib/actions/list-databases';
+import { listTablesAction } from './lib/actions/list-tables';
+import { getTableAction } from './lib/actions/get-table';
+import { getTableFieldsAction } from './lib/actions/get-table-fields';
+import { listViewsAction } from './lib/actions/list-views';
+import { listRowNamesAction } from './lib/actions/list-row-names';
+import { getFieldUniqueValuesAction } from './lib/actions/get-field-unique-values';
+import { listWorkspaceUsersAction } from './lib/actions/list-workspace-users';
+import { searchWorkspaceAction } from './lib/actions/search-workspace';
+import { createDatabaseAction } from './lib/actions/create-database';
+import { createTableAction } from './lib/actions/create-table';
+import { updateTableAction } from './lib/actions/update-table';
+import { deleteTableAction } from './lib/actions/delete-table';
+import { createFieldAction } from './lib/actions/create-field';
+import { updateFieldAction } from './lib/actions/update-field';
+import { deleteFieldAction } from './lib/actions/delete-field';
+import { createViewAction } from './lib/actions/create-view';
+import { getRowHistoryAction } from './lib/actions/get-row-history';
+import { exportTableAction } from './lib/actions/export-table';
+import { getExportJobAction } from './lib/actions/get-export-job';
import { rowCreatedTrigger } from './lib/triggers/row-created';
import { rowUpdatedTrigger } from './lib/triggers/row-updated';
import { rowDeletedTrigger } from './lib/triggers/row-deleted';
@@ -45,7 +77,7 @@ export const baserow = createPiece({
displayName: 'Baserow',
description: 'Open-source online database tool, alternative to Airtable',
auth: baserowAuth,
- minimumSupportedRelease: '0.30.0',
+ minimumSupportedRelease: '0.88.2',
logoUrl: 'https://cdn.activepieces.com/pieces/baserow.png',
categories: [PieceCategory.PRODUCTIVITY],
authors: ["kishanprmr", "MoShizzle", "abuaboud", 'bst1n', 'sanket-a11y', 'onyedikachi-david'],
@@ -63,6 +95,38 @@ export const baserow = createPiece({
batchDeleteRowsAction,
aggregateFieldAction,
uploadFileAction,
+ createRowAiAction,
+ getRowAiAction,
+ listRowsAiAction,
+ findRowAiAction,
+ updateRowAiAction,
+ upsertRowAiAction,
+ deleteRowAiAction,
+ batchCreateRowsAiAction,
+ batchUpdateRowsAiAction,
+ batchDeleteRowsAiAction,
+ aggregateFieldAiAction,
+ listWorkspacesAction,
+ listDatabasesAction,
+ listTablesAction,
+ getTableAction,
+ getTableFieldsAction,
+ listViewsAction,
+ listRowNamesAction,
+ getFieldUniqueValuesAction,
+ listWorkspaceUsersAction,
+ searchWorkspaceAction,
+ createDatabaseAction,
+ createTableAction,
+ updateTableAction,
+ deleteTableAction,
+ createFieldAction,
+ updateFieldAction,
+ deleteFieldAction,
+ createViewAction,
+ getRowHistoryAction,
+ exportTableAction,
+ getExportJobAction,
createCustomApiCallAction({
baseUrl: (auth) => {
if (!auth) {
diff --git a/packages/pieces/community/baserow/src/lib/actions/aggregate-field-ai.ts b/packages/pieces/community/baserow/src/lib/actions/aggregate-field-ai.ts
new file mode 100644
index 00000000000..4edbaeee5fb
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/aggregate-field-ai.ts
@@ -0,0 +1,61 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { aggregateFieldAiOutputSchema } from '../output-schemas';
+
+export const aggregateFieldAiAction = createAction({
+ name: 'baserow_aggregate_field_ai',
+ classification: 'READ',
+ outputSchema: aggregateFieldAiOutputSchema,
+ displayName: 'Aggregate Field',
+ description: 'Computes an aggregate over one field in a grid view.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Computes one aggregate (sum, average, min, max, median, std dev, variance, decile, distribution, or empty/non-empty/unique counts) over a field across all rows visible in a Baserow grid view. Use for totals and metrics instead of paging through rows. Numeric aggregations need a number field. Requires an Email & Password connection. Read-only and idempotent.',
+ idempotent: true,
+ },
+ auth: baserowAuth,
+ props: {
+ view_id: Property.Number({
+ displayName: 'Grid View ID',
+ description: 'ID of a grid view on the table. Resolve with List Views.',
+ required: true,
+ }),
+ field_id: baserowAiProps.fieldIdProp(),
+ aggregation_type: Property.StaticDropdown({
+ displayName: 'Aggregation Type',
+ description: 'The calculation to run.',
+ required: true,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Sum', value: 'sum' },
+ { label: 'Average', value: 'average' },
+ { label: 'Min', value: 'min' },
+ { label: 'Max', value: 'max' },
+ { label: 'Median', value: 'median' },
+ { label: 'Standard deviation', value: 'std_dev' },
+ { label: 'Variance', value: 'variance' },
+ { label: 'Decile', value: 'decile' },
+ { label: 'Distribution', value: 'distribution' },
+ { label: 'Count', value: 'count' },
+ { label: 'Count (empty)', value: 'empty_count' },
+ { label: 'Count (non-empty)', value: 'not_empty_count' },
+ { label: 'Count (unique values)', value: 'unique_count' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { view_id, field_id, aggregation_type } = context.propsValue;
+ baserowAiHelpers.assertJwt({ auth: context.auth, actionName: 'Aggregate Field' });
+ const client = await makeClient(context.auth);
+ const response = await baserowAiHelpers.execute(() =>
+ client.aggregateField(view_id, field_id, aggregation_type)
+ );
+ return { aggregation_type, value: response.value };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/aggregate-field.ts b/packages/pieces/community/baserow/src/lib/actions/aggregate-field.ts
index 2d2bbaede43..d2525a88826 100644
--- a/packages/pieces/community/baserow/src/lib/actions/aggregate-field.ts
+++ b/packages/pieces/community/baserow/src/lib/actions/aggregate-field.ts
@@ -5,14 +5,16 @@ import {
} from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { baserowCommon, makeClient } from '../common';
+import { aggregateFieldOutputSchema } from '../output-schemas';
export const aggregateFieldAction = createAction({
name: 'baserow_aggregate_field',
classification: 'READ',
+ outputSchema: aggregateFieldOutputSchema,
displayName: 'Aggregate Field',
description:
'Calculates an aggregation (sum, average, min, max, count, etc.) over all values of a field in a grid view.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Computes a single aggregate value (sum, average, min, max, median, std dev, variance, or empty/non-empty/unique counts) over one field across all rows of a Baserow grid view. Use for roll-up metrics over a whole view rather than fetching rows yourself; numeric aggregations require a number field. Requires a grid view ID and a field ID. Read-only and idempotent.',
diff --git a/packages/pieces/community/baserow/src/lib/actions/batch-create-rows-ai.ts b/packages/pieces/community/baserow/src/lib/actions/batch-create-rows-ai.ts
new file mode 100644
index 00000000000..5a8698e0100
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/batch-create-rows-ai.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { batchRowsOutputSchema } from '../output-schemas';
+
+export const batchCreateRowsAiAction = createAction({
+ name: 'baserow_batch_create_rows_ai',
+ classification: 'WRITE',
+ outputSchema: batchRowsOutputSchema,
+ displayName: 'Batch Create Rows',
+ description: 'Creates up to 200 rows in one request.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Creates up to 200 new rows in a Baserow table in a single request from a JSON array of field-name-to-value objects. Use for bulk inserts instead of repeated Create Row calls; split larger sets into chunks of 200. Not idempotent — re-running appends the rows again.',
+ idempotent: false,
+ },
+ auth: baserowAuth,
+ props: {
+ table_id: baserowAiProps.tableIdProp(),
+ rows: Property.Json({
+ displayName: 'Rows',
+ description:
+ 'JSON array of row objects keyed by field name, e.g. [{"Name": "A"}, {"Name": "B"}]. Maximum 200. Value formats match Create Row.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { table_id, rows } = context.propsValue;
+ const items = baserowAiHelpers.toRecordArray({
+ value: rows,
+ propName: 'Rows',
+ max: baserowAiHelpers.BATCH_LIMIT,
+ });
+ const client = await makeClient(context.auth);
+ const response = await baserowAiHelpers.execute(() => client.batchCreateRows(table_id, items));
+ return { count: response.items.length, rows: response.items };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/batch-create-rows.ts b/packages/pieces/community/baserow/src/lib/actions/batch-create-rows.ts
index fd9dbdd44a4..ae450fa2f5d 100644
--- a/packages/pieces/community/baserow/src/lib/actions/batch-create-rows.ts
+++ b/packages/pieces/community/baserow/src/lib/actions/batch-create-rows.ts
@@ -1,14 +1,16 @@
import { Property, createAction } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { baserowCommon, makeClient } from '../common';
+import { batchRowsOutputSchema } from '../output-schemas';
export const batchCreateRowsAction = createAction({
name: 'baserow_batch_create_rows',
classification: 'WRITE',
+ outputSchema: batchRowsOutputSchema,
displayName: 'Batch Create Rows',
description:
'Creates multiple rows in a single request. Accepts up to 200 rows.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Creates many new rows in a Baserow table in one request from a JSON array of row objects (field names as keys), up to 200 rows per call. Use for bulk inserts instead of repeated Create Row calls. Not idempotent — each call appends another set of rows, so it can produce duplicates if re-run.',
diff --git a/packages/pieces/community/baserow/src/lib/actions/batch-delete-rows-ai.ts b/packages/pieces/community/baserow/src/lib/actions/batch-delete-rows-ai.ts
new file mode 100644
index 00000000000..a081b52ca91
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/batch-delete-rows-ai.ts
@@ -0,0 +1,40 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { batchDeleteRowsAiOutputSchema } from '../output-schemas';
+
+export const batchDeleteRowsAiAction = createAction({
+ name: 'baserow_batch_delete_rows_ai',
+ classification: 'DESTRUCTIVE',
+ outputSchema: batchDeleteRowsAiOutputSchema,
+ displayName: 'Batch Delete Rows',
+ description: 'Deletes up to 200 rows in one request.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Deletes up to 200 rows from a Baserow table by row ID in one request; the rows move to the Baserow trash and can be restored there. Use instead of repeated Delete Row calls. Does not fire row-deleted webhooks. Not idempotent — a repeat call fails for IDs that are already gone.',
+ idempotent: false,
+ },
+ auth: baserowAuth,
+ props: {
+ table_id: baserowAiProps.tableIdProp(),
+ row_ids: Property.Array({
+ displayName: 'Row IDs',
+ description: 'Numeric IDs of the rows to delete. Maximum 200.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { table_id, row_ids } = context.propsValue;
+ const ids = baserowAiHelpers.toIdArray({
+ value: row_ids,
+ propName: 'Row IDs',
+ max: baserowAiHelpers.BATCH_LIMIT,
+ });
+ const client = await makeClient(context.auth);
+ await baserowAiHelpers.execute(() => client.batchDeleteRows(table_id, ids));
+ return { deleted: true, count: ids.length, row_ids: ids };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/batch-delete-rows.ts b/packages/pieces/community/baserow/src/lib/actions/batch-delete-rows.ts
index 5b8792ff154..286159c523f 100644
--- a/packages/pieces/community/baserow/src/lib/actions/batch-delete-rows.ts
+++ b/packages/pieces/community/baserow/src/lib/actions/batch-delete-rows.ts
@@ -1,14 +1,16 @@
import { Property, createAction } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { baserowCommon, makeClient } from '../common';
+import { batchDeleteRowsOutputSchema } from '../output-schemas';
export const batchDeleteRowsAction = createAction({
name: 'baserow_batch_delete_rows',
classification: 'DESTRUCTIVE',
+ outputSchema: batchDeleteRowsOutputSchema,
displayName: 'Batch Delete Rows',
description:
'Deletes multiple rows in a single request. Accepts up to 200 row IDs.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Permanently deletes many Baserow rows in one request from a list of numeric row IDs, up to 200 per call. Use for bulk removal of known rows; for a single row use Delete Row. Destructive — verify the IDs first (List Rows or Find Row can supply them). Not idempotent against changing data once the rows are removed.',
diff --git a/packages/pieces/community/baserow/src/lib/actions/batch-update-rows-ai.ts b/packages/pieces/community/baserow/src/lib/actions/batch-update-rows-ai.ts
new file mode 100644
index 00000000000..f22ec8010d5
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/batch-update-rows-ai.ts
@@ -0,0 +1,45 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { batchRowsOutputSchema } from '../output-schemas';
+
+export const batchUpdateRowsAiAction = createAction({
+ name: 'baserow_batch_update_rows_ai',
+ classification: 'WRITE',
+ outputSchema: batchRowsOutputSchema,
+ displayName: 'Batch Update Rows',
+ description: 'Updates up to 200 rows in one request.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Updates up to 200 existing Baserow rows in one request; each object needs the row "id" plus only the fields to change, and omitted fields are left as they are. Use for bulk edits instead of repeated Update Row calls. Idempotent — repeating the same values converges on the same state.',
+ idempotent: true,
+ },
+ auth: baserowAuth,
+ props: {
+ table_id: baserowAiProps.tableIdProp(),
+ rows: Property.Json({
+ displayName: 'Rows',
+ description:
+ 'JSON array of objects, each with the numeric row "id" and the field names to change, e.g. [{"id": 1, "Status": "Done"}]. Maximum 200.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { table_id, rows } = context.propsValue;
+ const items = baserowAiHelpers.toRecordArray({
+ value: rows,
+ propName: 'Rows',
+ max: baserowAiHelpers.BATCH_LIMIT,
+ });
+ const missingId = items.findIndex((item) => !Number.isInteger(Number(item['id'])));
+ if (missingId !== -1) {
+ throw new Error(`Rows[${missingId}] is missing a numeric "id".`);
+ }
+ const client = await makeClient(context.auth);
+ const response = await baserowAiHelpers.execute(() => client.batchUpdateRows(table_id, items));
+ return { count: response.items.length, rows: response.items };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/batch-update-rows.ts b/packages/pieces/community/baserow/src/lib/actions/batch-update-rows.ts
index c18b8c4e3da..9d77b0fb196 100644
--- a/packages/pieces/community/baserow/src/lib/actions/batch-update-rows.ts
+++ b/packages/pieces/community/baserow/src/lib/actions/batch-update-rows.ts
@@ -1,14 +1,16 @@
import { Property, createAction } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { baserowCommon, makeClient } from '../common';
+import { batchRowsOutputSchema } from '../output-schemas';
export const batchUpdateRowsAction = createAction({
name: 'baserow_batch_update_rows',
classification: 'WRITE',
+ outputSchema: batchRowsOutputSchema,
displayName: 'Batch Update Rows',
description:
'Updates multiple rows in a single request. Each row must include an "id" field. Accepts up to 200 rows.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Updates many existing Baserow rows in one request from a JSON array, up to 200 rows per call. Every object must carry an "id" identifying the row plus the fields to change. Use for bulk edits to known rows instead of repeated Update Row calls. Idempotent: re-sending the same id/field values converges those rows to the same state.',
diff --git a/packages/pieces/community/baserow/src/lib/actions/clean-row.ts b/packages/pieces/community/baserow/src/lib/actions/clean-row.ts
index e0b92455a66..fc8bd2520fc 100644
--- a/packages/pieces/community/baserow/src/lib/actions/clean-row.ts
+++ b/packages/pieces/community/baserow/src/lib/actions/clean-row.ts
@@ -1,14 +1,16 @@
import { createAction } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { baserowCommon, formatFieldValues, makeClient } from '../common';
+import { rowOutputSchema } from '../output-schemas';
export const cleanRowAction = createAction({
name: 'baserow_clean_row',
classification: 'DESTRUCTIVE',
+ outputSchema: rowOutputSchema,
displayName: 'Clean Row',
description:
'Sets all fields in a row to empty/null. To update only specific fields, use Update Row instead.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Clears the supplied fields on one existing Baserow row (identified by row ID) to empty/null, including blank values that Update Row would skip. Use specifically to wipe field contents rather than set new values; to change only some fields to new values use Update Row. Idempotent: re-clearing the same row leaves it in the same empty state.',
diff --git a/packages/pieces/community/baserow/src/lib/actions/create-database.ts b/packages/pieces/community/baserow/src/lib/actions/create-database.ts
new file mode 100644
index 00000000000..014a854f3b4
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/create-database.ts
@@ -0,0 +1,38 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { createDatabaseOutputSchema } from '../output-schemas';
+
+export const createDatabaseAction = createAction({
+ name: 'baserow_create_database',
+ classification: 'WRITE',
+ outputSchema: createDatabaseOutputSchema,
+ displayName: 'Create Database',
+ description: 'Creates an empty database in a workspace.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Creates a new, empty Baserow database in a workspace and returns its ID. Follow with Create Table to add tables. Requires an Email & Password connection. Not idempotent — each call creates another database.',
+ idempotent: false,
+ },
+ auth: baserowAuth,
+ props: {
+ workspace_id: baserowAiProps.workspaceIdProp(),
+ name: Property.ShortText({
+ displayName: 'Name',
+ description: 'Name of the new database (max 160 characters).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { workspace_id, name } = context.propsValue;
+ baserowAiHelpers.assertJwt({ auth: context.auth, actionName: 'Create Database' });
+ const client = await makeClient(context.auth);
+ const database = await baserowAiHelpers.execute(() =>
+ client.createDatabase({ workspaceId: workspace_id, name })
+ );
+ return { id: database['id'], name: database['name'], workspace: database['workspace'] };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/create-field.ts b/packages/pieces/community/baserow/src/lib/actions/create-field.ts
new file mode 100644
index 00000000000..c560f33e77e
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/create-field.ts
@@ -0,0 +1,50 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { fieldOutputSchema } from '../output-schemas';
+
+export const createFieldAction = createAction({
+ name: 'baserow_create_field',
+ classification: 'WRITE',
+ outputSchema: fieldOutputSchema,
+ displayName: 'Create Field',
+ description: 'Adds a field (column) to a table.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Adds a new field to a Baserow table with a given name and type, plus optional type-specific settings (select options, number decimals, linked table, formula). Use Get Table Fields first to avoid duplicate names. Requires an Email & Password connection — Database Tokens cannot create fields. Not idempotent — a repeat call fails on the duplicate name.',
+ idempotent: false,
+ },
+ auth: baserowAuth,
+ props: {
+ table_id: baserowAiProps.tableIdProp(),
+ name: Property.ShortText({
+ displayName: 'Name',
+ description: 'Name of the new field. Must be unique in the table.',
+ required: true,
+ }),
+ type: Property.ShortText({
+ displayName: 'Type',
+ description:
+ 'Baserow field type, e.g. text, long_text, number, boolean, date, email, url, phone_number, rating, single_select, multiple_select, link_row, file, formula, duration, autonumber.',
+ required: true,
+ }),
+ options: Property.Json({
+ displayName: 'Type Options',
+ description:
+ 'Optional JSON object of type-specific settings, e.g. {"number_decimal_places": 2}, {"select_options": [{"value": "Open", "color": "blue"}]}, {"link_row_table_id": 12}, {"formula": "field(\'Price\') * 2"}, {"date_include_time": true}.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { table_id, name, type, options } = context.propsValue;
+ baserowAiHelpers.assertJwt({ auth: context.auth, actionName: 'Create Field' });
+ const extra = options ? baserowAiHelpers.toRecord({ value: options, propName: 'Type Options' }) : {};
+ const client = await makeClient(context.auth);
+ return await baserowAiHelpers.execute(() =>
+ client.createField({ tableId: table_id, body: { ...extra, name, type } })
+ );
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/create-row-ai.ts b/packages/pieces/community/baserow/src/lib/actions/create-row-ai.ts
new file mode 100644
index 00000000000..524c9c6e09d
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/create-row-ai.ts
@@ -0,0 +1,56 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { ensureSelectOptionsExist, makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { rowOutputSchema } from '../output-schemas';
+
+export const createRowAiAction = createAction({
+ name: 'baserow_create_row_ai',
+ classification: 'WRITE',
+ outputSchema: rowOutputSchema,
+ displayName: 'Create Row',
+ description: 'Creates a new row in a table from a JSON map of field values.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Creates one new row in a Baserow table from a JSON object of field name to value. Call Get Table Fields first to learn field names and types; for many rows use Batch Create Rows, and to avoid duplicates by a key field use Upsert Row. Not idempotent — each call inserts another row.',
+ idempotent: false,
+ },
+ auth: baserowAuth,
+ props: {
+ table_id: baserowAiProps.tableIdProp(),
+ fields: Property.Json({
+ displayName: 'Fields',
+ description:
+ 'JSON object mapping field names to values, e.g. {"Name": "Acme", "Status": "Active"}. Single select takes the option name or ID; multiple select, link-to-table and collaborator fields take arrays (link rows accept row IDs or primary field values; collaborators take [{"id": 1}]). File fields take [{"name": "<file name from Upload File>"}].',
+ required: true,
+ }),
+ create_missing_select_options: Property.Checkbox({
+ displayName: 'Create Missing Select Options',
+ description:
+ 'Adds single/multiple select values that do not exist yet as new options before writing. Requires an Email & Password connection.',
+ required: false,
+ defaultValue: false,
+ }),
+ },
+ async run(context) {
+ const { table_id, fields, create_missing_select_options } = context.propsValue;
+ baserowAiHelpers.assertSelectOptionsAllowed({
+ auth: context.auth,
+ createMissingSelectOptions: create_missing_select_options,
+ });
+ const payload = baserowAiHelpers.toRecord({ value: fields, propName: 'Fields' });
+ const client = await makeClient(context.auth);
+ return await baserowAiHelpers.execute(async () => {
+ if (create_missing_select_options) {
+ await ensureSelectOptionsExist({
+ fields: await client.listTableFields(table_id),
+ payload,
+ client,
+ });
+ }
+ return await client.createRow(table_id, payload);
+ });
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/create-row.ts b/packages/pieces/community/baserow/src/lib/actions/create-row.ts
index d7c8b8bf175..214f6052b56 100644
--- a/packages/pieces/community/baserow/src/lib/actions/create-row.ts
+++ b/packages/pieces/community/baserow/src/lib/actions/create-row.ts
@@ -6,13 +6,15 @@ import {
formatFieldValues,
makeClient,
} from '../common';
+import { rowOutputSchema } from '../output-schemas';
export const createRowAction = createAction({
name: 'baserow_create_row',
classification: 'WRITE',
+ outputSchema: rowOutputSchema,
displayName: 'Create Row',
description: 'Creates a new row in a table.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Creates one new row in a chosen Baserow table, setting field values by field name. Use to add a single record; for many rows at once use Batch Create Rows, and to avoid duplicates by a key field use Upsert Row. Not idempotent — each call inserts another row. Optionally auto-creates missing single/multi-select options referenced in the payload.',
diff --git a/packages/pieces/community/baserow/src/lib/actions/create-table.ts b/packages/pieces/community/baserow/src/lib/actions/create-table.ts
new file mode 100644
index 00000000000..d05d2daeb38
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/create-table.ts
@@ -0,0 +1,67 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { createTableOutputSchema } from '../output-schemas';
+
+export const createTableAction = createAction({
+ name: 'baserow_create_table',
+ classification: 'WRITE',
+ outputSchema: createTableOutputSchema,
+ displayName: 'Create Table',
+ description: 'Creates a table in a database, optionally seeded with rows.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Creates a new table in a Baserow database. Pass Data as rows of cell values; with First Row Is Header the first row becomes the field names and all fields are created as text. Without Data the table gets a single "Name" field and no rows. Add typed fields afterwards with Create Field. Requires an Email & Password connection. Not idempotent — each call creates another table.',
+ idempotent: false,
+ },
+ auth: baserowAuth,
+ props: {
+ database_id: Property.Number({
+ displayName: 'Database ID',
+ description: 'The database to create the table in. Resolve with List Databases.',
+ required: true,
+ }),
+ name: Property.ShortText({
+ displayName: 'Name',
+ description: 'Name of the new table.',
+ required: true,
+ }),
+ data: Property.Json({
+ displayName: 'Data',
+ description:
+ 'Optional JSON array of rows, each an array of cell values, e.g. [["Name", "Email"], ["Ada", "[email protected]"]].',
+ required: false,
+ }),
+ first_row_header: Property.Checkbox({
+ displayName: 'First Row Is Header',
+ description: 'Use the first row of Data as the field names.',
+ required: false,
+ defaultValue: true,
+ }),
+ },
+ async run(context) {
+ const { database_id, name, data, first_row_header } = context.propsValue;
+ baserowAiHelpers.assertJwt({ auth: context.auth, actionName: 'Create Table' });
+ const rows = data === undefined || data === null ? [['Name']] : toRows({ value: data });
+ const firstRowHeader = data === undefined || data === null ? true : first_row_header ?? true;
+ const client = await makeClient(context.auth);
+ const table = await baserowAiHelpers.execute(() =>
+ client.createTable({ databaseId: database_id, name, data: rows, firstRowHeader })
+ );
+ return { id: table['id'], name: table['name'], database_id: table['database_id'] };
+ },
+});
+
+function toRows({ value }: { value: unknown }): unknown[][] {
+ if (!Array.isArray(value) || value.length === 0) {
+ throw new Error('Data must be a non-empty JSON array of rows.');
+ }
+ return value.map((row, index) => {
+ if (!Array.isArray(row)) {
+ throw new Error(`Data[${index}] must be an array of cell values.`);
+ }
+ return row;
+ });
+}
diff --git a/packages/pieces/community/baserow/src/lib/actions/create-view.ts b/packages/pieces/community/baserow/src/lib/actions/create-view.ts
new file mode 100644
index 00000000000..b27254e85be
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/create-view.ts
@@ -0,0 +1,52 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { createViewOutputSchema } from '../output-schemas';
+
+export const createViewAction = createAction({
+ name: 'baserow_create_view',
+ classification: 'WRITE',
+ outputSchema: createViewOutputSchema,
+ displayName: 'Create View',
+ description: 'Creates a grid, gallery or form view on a table.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Creates a new grid, gallery or form view on a Baserow table and returns its ID. Use when a separate saved view is needed, for example a grid view to aggregate over. Requires an Email & Password connection. Not idempotent — each call creates another view.',
+ idempotent: false,
+ },
+ auth: baserowAuth,
+ props: {
+ table_id: baserowAiProps.tableIdProp(),
+ name: Property.ShortText({
+ displayName: 'Name',
+ description: 'Name of the new view.',
+ required: true,
+ }),
+ type: Property.StaticDropdown({
+ displayName: 'Type',
+ description: 'The kind of view to create.',
+ required: true,
+ defaultValue: 'grid',
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Grid', value: 'grid' },
+ { label: 'Gallery', value: 'gallery' },
+ { label: 'Form', value: 'form' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const { table_id, name, type } = context.propsValue;
+ baserowAiHelpers.assertJwt({ auth: context.auth, actionName: 'Create View' });
+ const client = await makeClient(context.auth);
+ const view = await baserowAiHelpers.execute(() =>
+ client.createView({ tableId: table_id, name, type })
+ );
+ return { id: view['id'], name: view['name'], type: view['type'], table_id };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/delete-field.ts b/packages/pieces/community/baserow/src/lib/actions/delete-field.ts
new file mode 100644
index 00000000000..00312777169
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/delete-field.ts
@@ -0,0 +1,31 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { deleteFieldOutputSchema } from '../output-schemas';
+
+export const deleteFieldAction = createAction({
+ name: 'baserow_delete_field',
+ classification: 'DESTRUCTIVE',
+ outputSchema: deleteFieldOutputSchema,
+ displayName: 'Delete Field',
+ description: 'Deletes a field and its data from a table.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Deletes a Baserow field and every value stored in it; the field moves to the Baserow trash and can be restored there. The primary field cannot be deleted. Requires an Email & Password connection. Not idempotent — a repeat call fails because the field is gone.',
+ idempotent: false,
+ },
+ auth: baserowAuth,
+ props: {
+ field_id: baserowAiProps.fieldIdProp(),
+ },
+ async run(context) {
+ const { field_id } = context.propsValue;
+ baserowAiHelpers.assertJwt({ auth: context.auth, actionName: 'Delete Field' });
+ const client = await makeClient(context.auth);
+ const response = await baserowAiHelpers.execute(() => client.deleteField({ fieldId: field_id }));
+ return { deleted: true, field_id, related_fields: response['related_fields'] ?? [] };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/delete-row-ai.ts b/packages/pieces/community/baserow/src/lib/actions/delete-row-ai.ts
new file mode 100644
index 00000000000..aea0d185d32
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/delete-row-ai.ts
@@ -0,0 +1,31 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { deleteRowAiOutputSchema } from '../output-schemas';
+
+export const deleteRowAiAction = createAction({
+ name: 'baserow_delete_row_ai',
+ classification: 'DESTRUCTIVE',
+ outputSchema: deleteRowAiOutputSchema,
+ displayName: 'Delete Row',
+ description: 'Deletes a row by its ID.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Deletes one row from a Baserow table by numeric row ID; the row moves to the Baserow trash and can be restored there. For many rows use Batch Delete Rows. Confirm the ID first with Find Row or Get Row. Not idempotent — a repeat call fails because the row is gone.',
+ idempotent: false,
+ },
+ auth: baserowAuth,
+ props: {
+ table_id: baserowAiProps.tableIdProp(),
+ row_id: baserowAiProps.rowIdProp(),
+ },
+ async run(context) {
+ const { table_id, row_id } = context.propsValue;
+ const client = await makeClient(context.auth);
+ await baserowAiHelpers.execute(() => client.deleteRow(table_id, row_id));
+ return { deleted: true, table_id, row_id };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/delete-row.ts b/packages/pieces/community/baserow/src/lib/actions/delete-row.ts
index 8b72fc5f692..5e7a0784cc6 100644
--- a/packages/pieces/community/baserow/src/lib/actions/delete-row.ts
+++ b/packages/pieces/community/baserow/src/lib/actions/delete-row.ts
@@ -1,13 +1,15 @@
import { createAction } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { baserowCommon, makeClient } from '../common';
+import { deleteRowOutputSchema } from '../output-schemas';
export const deleteRowAction = createAction({
name: 'baserow_delete_row',
classification: 'DESTRUCTIVE',
+ outputSchema: deleteRowOutputSchema,
displayName: 'Delete Row',
description: 'Deletes an existing row.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Permanently deletes one row from a Baserow table by its numeric row ID. Use to remove a single known record; for multiple rows use Batch Delete Rows. Destructive — confirm the row ID first (resolve via Find Row or List Rows if unknown). Not idempotent against changing data: once the row is gone a repeat call targets a no-longer-existing ID.',
diff --git a/packages/pieces/community/baserow/src/lib/actions/delete-table.ts b/packages/pieces/community/baserow/src/lib/actions/delete-table.ts
new file mode 100644
index 00000000000..8a433e20286
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/delete-table.ts
@@ -0,0 +1,31 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { deleteTableOutputSchema } from '../output-schemas';
+
+export const deleteTableAction = createAction({
+ name: 'baserow_delete_table',
+ classification: 'DESTRUCTIVE',
+ outputSchema: deleteTableOutputSchema,
+ displayName: 'Delete Table',
+ description: 'Deletes a table and all its rows.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Deletes a Baserow table together with all its fields, views and rows; it moves to the Baserow trash and can be restored there until the trash is emptied. Confirm the table with Get Table first. Requires an Email & Password connection. Not idempotent — a repeat call fails because the table is gone.',
+ idempotent: false,
+ },
+ auth: baserowAuth,
+ props: {
+ table_id: baserowAiProps.tableIdProp(),
+ },
+ async run(context) {
+ const { table_id } = context.propsValue;
+ baserowAiHelpers.assertJwt({ auth: context.auth, actionName: 'Delete Table' });
+ const client = await makeClient(context.auth);
+ await baserowAiHelpers.execute(() => client.deleteTable({ tableId: table_id }));
+ return { deleted: true, table_id };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/export-table.ts b/packages/pieces/community/baserow/src/lib/actions/export-table.ts
new file mode 100644
index 00000000000..b08ca2526c8
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/export-table.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { exportTableOutputSchema } from '../output-schemas';
+
+export const exportTableAction = createAction({
+ name: 'baserow_export_table',
+ classification: 'WRITE',
+ outputSchema: exportTableOutputSchema,
+ displayName: 'Export Table',
+ description: 'Starts a CSV export of a table or view.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Starts an asynchronous export of a Baserow table (or one of its views) to CSV and returns the export job ID. The file is not ready yet — call Get Export Job with the job ID until its state is "finished" to get the download URL. Requires an Email & Password connection. Not idempotent — each call starts a new export job.',
+ idempotent: false,
+ },
+ auth: baserowAuth,
+ props: {
+ table_id: baserowAiProps.tableIdProp(),
+ view_id: Property.Number({
+ displayName: 'View ID',
+ description: 'Export only the rows and fields visible in this view. Leave empty for the whole table.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { table_id, view_id } = context.propsValue;
+ baserowAiHelpers.assertJwt({ auth: context.auth, actionName: 'Export Table' });
+ const client = await makeClient(context.auth);
+ const job = await baserowAiHelpers.execute(() =>
+ client.exportTable({
+ tableId: table_id,
+ body: { exporter_type: 'csv', ...(view_id ? { view_id } : {}) },
+ })
+ );
+ return { job_id: job['id'], state: job['state'] };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/find-row-ai.ts b/packages/pieces/community/baserow/src/lib/actions/find-row-ai.ts
new file mode 100644
index 00000000000..f1494a5fb1a
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/find-row-ai.ts
@@ -0,0 +1,51 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { findRowAiOutputSchema } from '../output-schemas';
+
+export const findRowAiAction = createAction({
+ name: 'baserow_find_row_ai',
+ classification: 'SEARCH',
+ outputSchema: findRowAiOutputSchema,
+ displayName: 'Find Row',
+ description: 'Finds the first row whose field equals a value.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns the first row in a Baserow table whose named field exactly equals a value, plus the total match count. Use to resolve a row ID from a known key such as an email or external ID; for partial-text or multi-condition queries use List Rows. Read-only and idempotent.',
+ idempotent: true,
+ },
+ auth: baserowAuth,
+ props: {
+ table_id: baserowAiProps.tableIdProp(),
+ field_name: Property.ShortText({
+ displayName: 'Field Name',
+ description: 'Exact name of the field to match on. Resolve with Get Table Fields.',
+ required: true,
+ }),
+ value: Property.ShortText({
+ displayName: 'Value',
+ description: 'The value the field must equal.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { table_id, field_name, value } = context.propsValue;
+ const client = await makeClient(context.auth);
+ const response = await baserowAiHelpers.execute(async () => {
+ const field = await baserowAiHelpers.resolveField({
+ client,
+ tableId: table_id,
+ fieldName: field_name,
+ });
+ return await client.queryRows({
+ tableId: table_id,
+ query: { size: '1', [`filter__field_${field.id}__equal`]: value },
+ });
+ });
+ const row = response.results[0] ?? null;
+ return { found: row !== null, count: response.count, row };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/find-row.ts b/packages/pieces/community/baserow/src/lib/actions/find-row.ts
index 233a88408cf..790a1133424 100644
--- a/packages/pieces/community/baserow/src/lib/actions/find-row.ts
+++ b/packages/pieces/community/baserow/src/lib/actions/find-row.ts
@@ -6,14 +6,16 @@ import {
import { baserowAuth } from '../auth';
import { baserowCommon, makeClient } from '../common';
import { BaserowFieldType } from '../common/constants';
+import { findRowOutputSchema } from '../output-schemas';
export const findRowAction = createAction({
name: 'baserow_find_row',
classification: 'SEARCH',
+ outputSchema: findRowOutputSchema,
displayName: 'Find Row',
description:
'Finds a row by matching a field value. Returns the first match.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Looks up the first row in a Baserow table whose chosen field exactly equals a given value. Use to resolve a row from a known field value (e.g. an email or external key) when you do not have its row ID; for ID lookups use Get Row, and for multi-condition or partial-text queries use List Rows. The match field must be a filterable type (link, multi-select, file, formula/lookup, and date-type fields are excluded). Read-only and idempotent.',
diff --git a/packages/pieces/community/baserow/src/lib/actions/get-export-job.ts b/packages/pieces/community/baserow/src/lib/actions/get-export-job.ts
new file mode 100644
index 00000000000..4c300f4387a
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/get-export-job.ts
@@ -0,0 +1,40 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { getExportJobOutputSchema } from '../output-schemas';
+
+export const getExportJobAction = createAction({
+ name: 'baserow_get_export_job',
+ classification: 'READ',
+ outputSchema: getExportJobOutputSchema,
+ displayName: 'Get Export Job',
+ description: 'Gets the state and download URL of an export job.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns the state (pending, exporting, finished, failed, cancelled), progress and — once finished — the download URL of a Baserow export job started by Export Table. Call again later while the state is pending or exporting; it does not wait. Requires an Email & Password connection. Read-only and idempotent.',
+ idempotent: true,
+ },
+ auth: baserowAuth,
+ props: {
+ job_id: Property.Number({
+ displayName: 'Job ID',
+ description: 'The job ID returned by Export Table.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { job_id } = context.propsValue;
+ baserowAiHelpers.assertJwt({ auth: context.auth, actionName: 'Get Export Job' });
+ const client = await makeClient(context.auth);
+ const job = await baserowAiHelpers.execute(() => client.getExportJob({ jobId: job_id }));
+ return {
+ job_id: job['id'],
+ state: job['state'],
+ progress_percentage: job['progress_percentage'],
+ file_name: job['exported_file_name'],
+ url: job['state'] === 'finished' ? job['url'] : null,
+ };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/get-field-unique-values.ts b/packages/pieces/community/baserow/src/lib/actions/get-field-unique-values.ts
new file mode 100644
index 00000000000..36f1654d73c
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/get-field-unique-values.ts
@@ -0,0 +1,48 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { getFieldUniqueValuesOutputSchema } from '../output-schemas';
+
+export const getFieldUniqueValuesAction = createAction({
+ name: 'baserow_get_field_unique_values',
+ classification: 'READ',
+ outputSchema: getFieldUniqueValuesOutputSchema,
+ displayName: 'Get Field Unique Values',
+ description: 'Lists the distinct values stored in a field.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns the distinct values stored in a Baserow field, most frequent first. Use to discover valid values before filtering rows or to profile a column without paging through rows. Requires an Email & Password connection. Read-only and idempotent.',
+ idempotent: true,
+ },
+ auth: baserowAuth,
+ props: {
+ field_id: baserowAiProps.fieldIdProp(),
+ limit: Property.Number({
+ displayName: 'Limit',
+ description: 'Maximum number of values to return. Defaults to 10.',
+ required: false,
+ }),
+ split_comma_separated: Property.Checkbox({
+ displayName: 'Split Comma-Separated Values',
+ description: 'Treat "a,b" as two values a and b.',
+ required: false,
+ defaultValue: false,
+ }),
+ },
+ async run(context) {
+ const { field_id, limit, split_comma_separated } = context.propsValue;
+ baserowAiHelpers.assertJwt({ auth: context.auth, actionName: 'Get Field Unique Values' });
+ const client = await makeClient(context.auth);
+ const response = await baserowAiHelpers.execute(() =>
+ client.getFieldUniqueValues({
+ fieldId: field_id,
+ limit: limit ?? undefined,
+ splitCommaSeparated: split_comma_separated,
+ })
+ );
+ return { count: response.values.length, values: response.values };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/get-row-ai.ts b/packages/pieces/community/baserow/src/lib/actions/get-row-ai.ts
new file mode 100644
index 00000000000..8d0bc06ab0b
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/get-row-ai.ts
@@ -0,0 +1,30 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { rowOutputSchema } from '../output-schemas';
+
+export const getRowAiAction = createAction({
+ name: 'baserow_get_row_ai',
+ classification: 'READ',
+ outputSchema: rowOutputSchema,
+ displayName: 'Get Row',
+ description: 'Gets a single row by its ID.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Fetches one row and all its field values (keyed by field name) from a Baserow table by numeric row ID. Use when the row ID is known; to locate a row by a field value use Find Row. Read-only and idempotent.',
+ idempotent: true,
+ },
+ auth: baserowAuth,
+ props: {
+ table_id: baserowAiProps.tableIdProp(),
+ row_id: baserowAiProps.rowIdProp(),
+ },
+ async run(context) {
+ const { table_id, row_id } = context.propsValue;
+ const client = await makeClient(context.auth);
+ return await baserowAiHelpers.execute(() => client.getRow(table_id, row_id));
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/get-row-history.ts b/packages/pieces/community/baserow/src/lib/actions/get-row-history.ts
new file mode 100644
index 00000000000..2398c1c8f78
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/get-row-history.ts
@@ -0,0 +1,49 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { getRowHistoryOutputSchema } from '../output-schemas';
+
+export const getRowHistoryAction = createAction({
+ name: 'baserow_get_row_history',
+ classification: 'READ',
+ outputSchema: getRowHistoryOutputSchema,
+ displayName: 'Get Row History',
+ description: 'Lists the change history of a row.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns the change log of a Baserow row, newest first: who changed which fields, when, and the before/after values. Use to audit edits or recover a previous value. History is kept for a limited period (180 days by default). Requires an Email & Password connection. Read-only and idempotent.',
+ idempotent: true,
+ },
+ auth: baserowAuth,
+ props: {
+ table_id: baserowAiProps.tableIdProp(),
+ row_id: baserowAiProps.rowIdProp(),
+ limit: Property.Number({
+ displayName: 'Limit',
+ description: 'Maximum entries to return.',
+ required: false,
+ }),
+ offset: Property.Number({
+ displayName: 'Offset',
+ description: 'Number of entries to skip, for paging.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { table_id, row_id, limit, offset } = context.propsValue;
+ baserowAiHelpers.assertJwt({ auth: context.auth, actionName: 'Get Row History' });
+ const client = await makeClient(context.auth);
+ const response = await baserowAiHelpers.execute(() =>
+ client.getRowHistory({
+ tableId: table_id,
+ rowId: row_id,
+ limit: limit ?? undefined,
+ offset: offset ?? undefined,
+ })
+ );
+ return { count: response['count'], has_more: Boolean(response['next']), entries: response['results'] };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/get-row.ts b/packages/pieces/community/baserow/src/lib/actions/get-row.ts
index fdf2c3c983b..263eaba6cd3 100644
--- a/packages/pieces/community/baserow/src/lib/actions/get-row.ts
+++ b/packages/pieces/community/baserow/src/lib/actions/get-row.ts
@@ -1,13 +1,15 @@
import { createAction } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { baserowCommon, makeClient } from '../common';
+import { rowOutputSchema } from '../output-schemas';
export const getRowAction = createAction({
name: 'baserow_get_row',
classification: 'READ',
+ outputSchema: rowOutputSchema,
displayName: 'Get Row',
description: 'Gets a single row by its ID from a table.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Fetches one row from a Baserow table by its numeric row ID. Use when you already know the exact row ID and want its full current field values; to locate a row by a field value instead, use Find Row. Read-only and idempotent.',
diff --git a/packages/pieces/community/baserow/src/lib/actions/get-table-fields.ts b/packages/pieces/community/baserow/src/lib/actions/get-table-fields.ts
new file mode 100644
index 00000000000..f9322b9d9d1
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/get-table-fields.ts
@@ -0,0 +1,44 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { getTableFieldsOutputSchema } from '../output-schemas';
+
+export const getTableFieldsAction = createAction({
+ name: 'baserow_get_table_fields',
+ classification: 'READ',
+ outputSchema: getTableFieldsOutputSchema,
+ displayName: 'Get Table Fields',
+ description: 'Lists the fields (columns) of a table.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns every field of a Baserow table with its ID, name, type, primary/read-only flags and select options. Call before creating, updating or filtering rows to learn exact field names, types and valid select values. Works with Database Token and Email & Password connections. Read-only and idempotent.',
+ idempotent: true,
+ },
+ auth: baserowAuth,
+ props: {
+ table_id: baserowAiProps.tableIdProp(),
+ },
+ async run(context) {
+ const { table_id } = context.propsValue;
+ const client = await makeClient(context.auth);
+ const fields = await baserowAiHelpers.execute(() => client.listTableFields(table_id));
+ return {
+ count: fields.length,
+ fields: fields.map((field) => ({
+ id: field.id,
+ name: field.name,
+ type: field.type,
+ primary: field.primary,
+ read_only: field.read_only,
+ select_options:
+ 'select_options' in field
+ ? field.select_options.map((option) => ({ id: option.id, value: option.value }))
+ : undefined,
+ link_row_table_id: 'link_row_table_id' in field ? field.link_row_table_id : undefined,
+ })),
+ };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/get-table.ts b/packages/pieces/community/baserow/src/lib/actions/get-table.ts
new file mode 100644
index 00000000000..67b1c39547d
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/get-table.ts
@@ -0,0 +1,30 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { tableOutputSchema } from '../output-schemas';
+
+export const getTableAction = createAction({
+ name: 'baserow_get_table',
+ classification: 'READ',
+ outputSchema: tableOutputSchema,
+ displayName: 'Get Table',
+ description: 'Gets a table by its ID.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns a Baserow table\'s ID, name, order and database ID. Use to confirm a table ID or its parent database; to discover tables use List Tables and for its columns use Get Table Fields. Requires an Email & Password connection. Read-only and idempotent.',
+ idempotent: true,
+ },
+ auth: baserowAuth,
+ props: {
+ table_id: baserowAiProps.tableIdProp(),
+ },
+ async run(context) {
+ const { table_id } = context.propsValue;
+ baserowAiHelpers.assertJwt({ auth: context.auth, actionName: 'Get Table' });
+ const client = await makeClient(context.auth);
+ return await baserowAiHelpers.execute(() => client.getTable({ tableId: table_id }));
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/list-databases.ts b/packages/pieces/community/baserow/src/lib/actions/list-databases.ts
new file mode 100644
index 00000000000..1096b8d39f5
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/list-databases.ts
@@ -0,0 +1,37 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { listDatabasesOutputSchema } from '../output-schemas';
+
+export const listDatabasesAction = createAction({
+ name: 'baserow_list_databases',
+ classification: 'SEARCH',
+ outputSchema: listDatabasesOutputSchema,
+ displayName: 'List Databases',
+ description: 'Lists the databases the user can access.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists every Baserow database the connected user can access across workspaces, with its ID, name, workspace and tables. Use to get the Database ID for Create Table; to just find a table use List Tables. Requires an Email & Password connection. Read-only and idempotent.',
+ idempotent: true,
+ },
+ auth: baserowAuth,
+ props: {},
+ async run(context) {
+ baserowAiHelpers.assertJwt({ auth: context.auth, actionName: 'List Databases' });
+ const client = await makeClient(context.auth);
+ const applications = await baserowAiHelpers.execute(() => client.listApplications());
+ const databases = applications.filter((application) => application.type === 'database');
+ return {
+ count: databases.length,
+ databases: databases.map((database) => ({
+ id: database.id,
+ name: database.name,
+ workspace_id: database.workspace?.id,
+ workspace_name: database.workspace?.name,
+ tables: (database.tables ?? []).map((table) => ({ id: table.id, name: table.name })),
+ })),
+ };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/list-row-names.ts b/packages/pieces/community/baserow/src/lib/actions/list-row-names.ts
new file mode 100644
index 00000000000..19276800f6b
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/list-row-names.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { listRowNamesOutputSchema } from '../output-schemas';
+
+export const listRowNamesAction = createAction({
+ name: 'baserow_list_row_names',
+ classification: 'READ',
+ outputSchema: listRowNamesOutputSchema,
+ displayName: 'List Row Names',
+ description: 'Gets the primary field value of the given rows.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns the display name (primary field value) of each given row ID in a Baserow table. Use to turn linked-row IDs into readable names without fetching whole rows. Works with Database Token and Email & Password connections. Read-only and idempotent.',
+ idempotent: true,
+ },
+ auth: baserowAuth,
+ props: {
+ table_id: baserowAiProps.tableIdProp(),
+ row_ids: Property.Array({
+ displayName: 'Row IDs',
+ description: 'Numeric row IDs to look up.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { table_id, row_ids } = context.propsValue;
+ const ids = baserowAiHelpers.toIdArray({ value: row_ids, propName: 'Row IDs', max: 200 });
+ const client = await makeClient(context.auth);
+ const response = await baserowAiHelpers.execute(() =>
+ client.listRowNames({ tableId: table_id, rowIds: ids })
+ );
+ const names = response[String(table_id)] ?? {};
+ return {
+ rows: Object.entries(names).map(([id, name]) => ({ id: Number(id), name })),
+ };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/list-rows-ai.ts b/packages/pieces/community/baserow/src/lib/actions/list-rows-ai.ts
new file mode 100644
index 00000000000..05ec27001e0
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/list-rows-ai.ts
@@ -0,0 +1,99 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { listRowsAiOutputSchema } from '../output-schemas';
+
+export const listRowsAiAction = createAction({
+ name: 'baserow_list_rows_ai',
+ classification: 'SEARCH',
+ outputSchema: listRowsAiOutputSchema,
+ displayName: 'List Rows',
+ description: 'Lists rows from a table with optional search, sorting, filters and view.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns one page of rows from a Baserow table, optionally narrowed by free-text search, structured filters (AND/OR over field names), a view, and a field selection. Use to browse or query many rows; for one row by ID use Get Row, or for an exact single-field match use Find Row. Page size is at most 200 — follow `next` by incrementing Page. Read-only and idempotent.',
+ idempotent: true,
+ },
+ auth: baserowAuth,
+ props: {
+ table_id: baserowAiProps.tableIdProp(),
+ search: Property.ShortText({
+ displayName: 'Search',
+ description: 'Only return rows with cell data matching this text.',
+ required: false,
+ }),
+ filters: Property.Json({
+ displayName: 'Filters',
+ description:
+ 'Optional filter tree: {"filter_type": "AND" | "OR", "filters": [{"field": "<field name or ID>", "type": "<operator>", "value": "<value>"}], "groups": [<nested tree>]}. Operators include equal, not_equal, contains, contains_not, higher_than, lower_than, date_is, empty, not_empty, boolean, link_row_has, single_select_equal.',
+ required: false,
+ }),
+ order_by: Property.ShortText({
+ displayName: 'Order By',
+ description: 'Comma-separated field names; prefix a name with "-" for descending, e.g. "-Created,Name".',
+ required: false,
+ }),
+ include: Property.Array({
+ displayName: 'Include Fields',
+ description: 'Only return these field names. Leave empty for all fields.',
+ required: false,
+ }),
+ exclude: Property.Array({
+ displayName: 'Exclude Fields',
+ description: 'Field names to leave out of the response.',
+ required: false,
+ }),
+ view_id: Property.Number({
+ displayName: 'View ID',
+ description: 'Apply the filters and sorts saved on this view. Resolve with List Views.',
+ required: false,
+ }),
+ page: Property.Number({
+ displayName: 'Page',
+ description: 'Page number, starting at 1.',
+ required: false,
+ defaultValue: 1,
+ }),
+ size: Property.Number({
+ displayName: 'Page Size',
+ description: 'Rows per page, 1–200. Defaults to 100.',
+ required: false,
+ defaultValue: 100,
+ }),
+ },
+ async run(context) {
+ const { table_id, search, filters, order_by, include, exclude, view_id, page, size } =
+ context.propsValue;
+ if (size !== undefined && size !== null && (size < 1 || size > 200)) {
+ throw new Error('Page Size must be between 1 and 200.');
+ }
+ const query: Record<string, string> = {
+ page: String(page ?? 1),
+ size: String(size ?? 100),
+ ...(search ? { search } : {}),
+ ...(order_by ? { order_by } : {}),
+ ...(include && include.length > 0 ? { include: include.map(String).join(',') } : {}),
+ ...(exclude && exclude.length > 0 ? { exclude: exclude.map(String).join(',') } : {}),
+ ...(view_id ? { view_id: String(view_id) } : {}),
+ ...(filters
+ ? {
+ filters: JSON.stringify(
+ baserowAiHelpers.toRecord({ value: filters, propName: 'Filters' })
+ ),
+ }
+ : {}),
+ };
+ const client = await makeClient(context.auth);
+ const response = await baserowAiHelpers.execute(() =>
+ client.queryRows({ tableId: table_id, query })
+ );
+ return {
+ count: response.count,
+ has_more: response.next !== null,
+ rows: response.results,
+ };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/list-rows.ts b/packages/pieces/community/baserow/src/lib/actions/list-rows.ts
index d7b26279441..17c42bf621e 100644
--- a/packages/pieces/community/baserow/src/lib/actions/list-rows.ts
+++ b/packages/pieces/community/baserow/src/lib/actions/list-rows.ts
@@ -4,13 +4,15 @@ import {
} from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { baserowCommon, makeClient } from '../common';
+import { listRowsOutputSchema } from '../output-schemas';
export const listRowsAction = createAction({
name: 'baserow_list_rows',
classification: 'SEARCH',
+ outputSchema: listRowsOutputSchema,
displayName: 'List Rows',
description: 'Lists rows from a table with optional search, sorting, and filtering.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Retrieves a page of rows from a Baserow table. With no search/filters it returns all rows (paginated); supply a free-text search, an order-by field, or structured field filters (each a JSON object with field ID, operator, and value, combined with AND/OR) to narrow results. Use to browse or query many rows; for a single row by ID use Get Row, or by one field value use Find Row. Read-only and idempotent.',
diff --git a/packages/pieces/community/baserow/src/lib/actions/list-tables.ts b/packages/pieces/community/baserow/src/lib/actions/list-tables.ts
new file mode 100644
index 00000000000..d2f419b3df9
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/list-tables.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { listTablesOutputSchema } from '../output-schemas';
+
+export const listTablesAction = createAction({
+ name: 'baserow_list_tables',
+ classification: 'SEARCH',
+ outputSchema: listTablesOutputSchema,
+ displayName: 'List Tables',
+ description: 'Lists the tables the connection can access.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists every Baserow table the connection can reach, with its ID, name and database ID. Call this first to get the Table ID every row action needs. Works with Database Token and Email & Password connections. Read-only and idempotent.',
+ idempotent: true,
+ },
+ auth: baserowAuth,
+ props: {},
+ async run(context) {
+ const client = await makeClient(context.auth);
+ const tables = await baserowAiHelpers.execute(() => client.listTables());
+ return {
+ count: tables.length,
+ tables: tables.map((table) => ({
+ id: table.id,
+ name: table.name,
+ database_id: table.database_id,
+ })),
+ };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/list-views.ts b/packages/pieces/community/baserow/src/lib/actions/list-views.ts
new file mode 100644
index 00000000000..5d727187af2
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/list-views.ts
@@ -0,0 +1,34 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { listViewsOutputSchema } from '../output-schemas';
+
+export const listViewsAction = createAction({
+ name: 'baserow_list_views',
+ classification: 'SEARCH',
+ outputSchema: listViewsOutputSchema,
+ displayName: 'List Views',
+ description: 'Lists the views of a table.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists all views (grid, gallery, form, kanban, calendar, timeline) of a Baserow table with their ID, name and type. Use to get a View ID for List Rows or a grid View ID for Aggregate Field. Requires an Email & Password connection. Read-only and idempotent.',
+ idempotent: true,
+ },
+ auth: baserowAuth,
+ props: {
+ table_id: baserowAiProps.tableIdProp(),
+ },
+ async run(context) {
+ const { table_id } = context.propsValue;
+ baserowAiHelpers.assertJwt({ auth: context.auth, actionName: 'List Views' });
+ const client = await makeClient(context.auth);
+ const views = await baserowAiHelpers.execute(() => client.listAllViews({ tableId: table_id }));
+ return {
+ count: views.length,
+ views: views.map((view) => ({ id: view['id'], name: view['name'], type: view['type'] })),
+ };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/list-workspace-users.ts b/packages/pieces/community/baserow/src/lib/actions/list-workspace-users.ts
new file mode 100644
index 00000000000..36e8c23450d
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/list-workspace-users.ts
@@ -0,0 +1,46 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { listWorkspaceUsersOutputSchema } from '../output-schemas';
+
+export const listWorkspaceUsersAction = createAction({
+ name: 'baserow_list_workspace_users',
+ classification: 'SEARCH',
+ outputSchema: listWorkspaceUsersOutputSchema,
+ displayName: 'List Workspace Users',
+ description: 'Lists the members of a workspace.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the members of a Baserow workspace with user ID, name, email and role. Use to find the user ID needed for collaborator fields ([{"id": <user_id>}]). Only workspace admins can call it, with an Email & Password connection. Read-only and idempotent.',
+ idempotent: true,
+ },
+ auth: baserowAuth,
+ props: {
+ workspace_id: baserowAiProps.workspaceIdProp(),
+ search: Property.ShortText({
+ displayName: 'Search',
+ description: 'Only return users whose name or email contains this text.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { workspace_id, search } = context.propsValue;
+ baserowAiHelpers.assertJwt({ auth: context.auth, actionName: 'List Workspace Users' });
+ const client = await makeClient(context.auth);
+ const users = await baserowAiHelpers.execute(() =>
+ client.listWorkspaceUsers({ workspaceId: workspace_id, search: search ?? undefined })
+ );
+ return {
+ count: users.length,
+ users: users.map((user) => ({
+ user_id: user['user_id'],
+ name: user['name'],
+ email: user['email'],
+ permissions: user['permissions'],
+ })),
+ };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/list-workspaces.ts b/packages/pieces/community/baserow/src/lib/actions/list-workspaces.ts
new file mode 100644
index 00000000000..8e7a2965a2d
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/list-workspaces.ts
@@ -0,0 +1,34 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { listWorkspacesOutputSchema } from '../output-schemas';
+
+export const listWorkspacesAction = createAction({
+ name: 'baserow_list_workspaces',
+ classification: 'SEARCH',
+ outputSchema: listWorkspacesOutputSchema,
+ displayName: 'List Workspaces',
+ description: 'Lists the workspaces the user belongs to.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the Baserow workspaces the connected user belongs to, with ID, name and the user\'s permission level. Use to get the Workspace ID for Create Database, List Workspace Users or Search Workspace. Requires an Email & Password connection. Read-only and idempotent.',
+ idempotent: true,
+ },
+ auth: baserowAuth,
+ props: {},
+ async run(context) {
+ baserowAiHelpers.assertJwt({ auth: context.auth, actionName: 'List Workspaces' });
+ const client = await makeClient(context.auth);
+ const workspaces = await baserowAiHelpers.execute(() => client.listWorkspaces());
+ return {
+ count: workspaces.length,
+ workspaces: workspaces.map((workspace) => ({
+ id: workspace['id'],
+ name: workspace['name'],
+ permissions: workspace['permissions'],
+ })),
+ };
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/search-workspace.ts b/packages/pieces/community/baserow/src/lib/actions/search-workspace.ts
new file mode 100644
index 00000000000..549bf92f2a5
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/search-workspace.ts
@@ -0,0 +1,52 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { searchWorkspaceOutputSchema } from '../output-schemas';
+
+export const searchWorkspaceAction = createAction({
+ name: 'baserow_search_workspace',
+ classification: 'SEARCH',
+ outputSchema: searchWorkspaceOutputSchema,
+ displayName: 'Search Workspace',
+ description: 'Searches databases, tables, fields and rows in a workspace.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Runs Baserow\'s workspace-wide search across databases, tables, fields and row content, returning matches with their type and IDs. Use when you do not know which table holds a record; within a known table use List Rows with Search. Requires an Email & Password connection. Read-only and idempotent.',
+ idempotent: true,
+ },
+ auth: baserowAuth,
+ props: {
+ workspace_id: baserowAiProps.workspaceIdProp(),
+ query: Property.ShortText({
+ displayName: 'Query',
+ description: 'Text to search for.',
+ required: true,
+ }),
+ limit: Property.Number({
+ displayName: 'Limit',
+ description: 'Maximum results to return.',
+ required: false,
+ }),
+ offset: Property.Number({
+ displayName: 'Offset',
+ description: 'Number of results to skip, for paging.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { workspace_id, query, limit, offset } = context.propsValue;
+ baserowAiHelpers.assertJwt({ auth: context.auth, actionName: 'Search Workspace' });
+ const client = await makeClient(context.auth);
+ return await baserowAiHelpers.execute(() =>
+ client.searchWorkspace({
+ workspaceId: workspace_id,
+ query,
+ limit: limit ?? undefined,
+ offset: offset ?? undefined,
+ })
+ );
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/update-field.ts b/packages/pieces/community/baserow/src/lib/actions/update-field.ts
new file mode 100644
index 00000000000..7231cd0081f
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/update-field.ts
@@ -0,0 +1,54 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { fieldOutputSchema } from '../output-schemas';
+
+export const updateFieldAction = createAction({
+ name: 'baserow_update_field',
+ classification: 'WRITE',
+ outputSchema: fieldOutputSchema,
+ displayName: 'Update Field',
+ description: 'Renames a field or changes its settings or type.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Updates a Baserow field: rename it, change type-specific settings such as select options, or convert its type. Only the given properties change. Converting the type can lose cell data that does not fit the new type. Requires an Email & Password connection. Idempotent — the same update converges on the same field.',
+ idempotent: true,
+ },
+ auth: baserowAuth,
+ props: {
+ field_id: baserowAiProps.fieldIdProp(),
+ name: Property.ShortText({
+ displayName: 'New Name',
+ description: 'Leave empty to keep the current name.',
+ required: false,
+ }),
+ type: Property.ShortText({
+ displayName: 'New Type',
+ description: 'Leave empty to keep the current type. Changing type can drop incompatible values.',
+ required: false,
+ }),
+ options: Property.Json({
+ displayName: 'Type Options',
+ description:
+ 'Optional JSON object of type-specific settings to change. For select fields, "select_options" replaces the whole list — include existing options (with their "id") to keep them.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { field_id, name, type, options } = context.propsValue;
+ baserowAiHelpers.assertJwt({ auth: context.auth, actionName: 'Update Field' });
+ const body = {
+ ...(options ? baserowAiHelpers.toRecord({ value: options, propName: 'Type Options' }) : {}),
+ ...(name ? { name } : {}),
+ ...(type ? { type } : {}),
+ };
+ if (Object.keys(body).length === 0) {
+ throw new Error('Provide at least one of New Name, New Type or Type Options.');
+ }
+ const client = await makeClient(context.auth);
+ return await baserowAiHelpers.execute(() => client.updateField({ fieldId: field_id, body }));
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/update-row-ai.ts b/packages/pieces/community/baserow/src/lib/actions/update-row-ai.ts
new file mode 100644
index 00000000000..a58c53952e3
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/update-row-ai.ts
@@ -0,0 +1,60 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { ensureSelectOptionsExist, makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { rowOutputSchema } from '../output-schemas';
+
+export const updateRowAiAction = createAction({
+ name: 'baserow_update_row_ai',
+ classification: 'WRITE',
+ outputSchema: rowOutputSchema,
+ displayName: 'Update Row',
+ description: 'Updates only the given fields of a row.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Updates an existing Baserow row by ID, writing only the fields present in the JSON object and leaving all others unchanged. Pass null (or [] for select, link and file fields) to clear a cell. To update many rows use Batch Update Rows; to create-or-update by a key use Upsert Row. Idempotent — repeating the same values converges on the same state.',
+ idempotent: true,
+ },
+ auth: baserowAuth,
+ props: {
+ table_id: baserowAiProps.tableIdProp(),
+ row_id: baserowAiProps.rowIdProp(),
+ fields: Property.Json({
+ displayName: 'Fields',
+ description:
+ 'JSON object of field name to new value, e.g. {"Status": "Done"}. Only these fields are written. Use null to clear a value. Formats match Create Row.',
+ required: true,
+ }),
+ create_missing_select_options: Property.Checkbox({
+ displayName: 'Create Missing Select Options',
+ description:
+ 'Adds single/multiple select values that do not exist yet as new options before writing. Requires an Email & Password connection.',
+ required: false,
+ defaultValue: false,
+ }),
+ },
+ async run(context) {
+ const { table_id, row_id, fields, create_missing_select_options } = context.propsValue;
+ baserowAiHelpers.assertSelectOptionsAllowed({
+ auth: context.auth,
+ createMissingSelectOptions: create_missing_select_options,
+ });
+ const payload = baserowAiHelpers.toRecord({ value: fields, propName: 'Fields' });
+ if (Object.keys(payload).length === 0) {
+ throw new Error('Fields must contain at least one field to update.');
+ }
+ const client = await makeClient(context.auth);
+ return await baserowAiHelpers.execute(async () => {
+ if (create_missing_select_options) {
+ await ensureSelectOptionsExist({
+ fields: await client.listTableFields(table_id),
+ payload,
+ client,
+ });
+ }
+ return await client.updateRow(table_id, row_id, payload);
+ });
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/update-row.ts b/packages/pieces/community/baserow/src/lib/actions/update-row.ts
index 6392dd54821..e59026bc00e 100644
--- a/packages/pieces/community/baserow/src/lib/actions/update-row.ts
+++ b/packages/pieces/community/baserow/src/lib/actions/update-row.ts
@@ -6,14 +6,16 @@ import {
formatFieldValues,
makeClient,
} from '../common';
+import { rowOutputSchema } from '../output-schemas';
export const updateRowAction = createAction({
name: 'baserow_update_row',
classification: 'WRITE',
+ outputSchema: rowOutputSchema,
displayName: 'Update Row',
description:
'Updates fields in an existing row. Empty values are skipped. To clear a field, use Clean Row.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Updates field values on one existing Baserow row identified by its numeric row ID. Only the fields you supply are changed and empty values are skipped, so it cannot clear a field — use Clean Row for that. Requires a known row ID (resolve one first with Find Row or List Rows if needed). Optionally auto-creates missing single/multi-select options. Idempotent: applying the same values to the same row leaves it in the same state.',
diff --git a/packages/pieces/community/baserow/src/lib/actions/update-table.ts b/packages/pieces/community/baserow/src/lib/actions/update-table.ts
new file mode 100644
index 00000000000..b5218e57288
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/update-table.ts
@@ -0,0 +1,35 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { tableOutputSchema } from '../output-schemas';
+
+export const updateTableAction = createAction({
+ name: 'baserow_update_table',
+ classification: 'WRITE',
+ outputSchema: tableOutputSchema,
+ displayName: 'Rename Table',
+ description: 'Renames a table.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Renames an existing Baserow table. Requires an Email & Password connection. Idempotent — applying the same name again changes nothing.',
+ idempotent: true,
+ },
+ auth: baserowAuth,
+ props: {
+ table_id: baserowAiProps.tableIdProp(),
+ name: Property.ShortText({
+ displayName: 'Name',
+ description: 'The new table name.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { table_id, name } = context.propsValue;
+ baserowAiHelpers.assertJwt({ auth: context.auth, actionName: 'Rename Table' });
+ const client = await makeClient(context.auth);
+ return await baserowAiHelpers.execute(() => client.updateTable({ tableId: table_id, name }));
+ },
+});
diff --git a/packages/pieces/community/baserow/src/lib/actions/upload-file.ts b/packages/pieces/community/baserow/src/lib/actions/upload-file.ts
index 90d80ebb281..b7604913aef 100644
--- a/packages/pieces/community/baserow/src/lib/actions/upload-file.ts
+++ b/packages/pieces/community/baserow/src/lib/actions/upload-file.ts
@@ -1,17 +1,19 @@
import { Property, createAction } from '@activepieces/pieces-framework';
-import { baserowAuth, baserowAuthHelpers } from '../auth';
+import { baserowAuth } from '../auth';
import { makeClient } from '../common';
+import { uploadFileOutputSchema } from '../output-schemas';
export const uploadFileAction = createAction({
name: 'baserow_upload_file',
classification: 'WRITE',
+ outputSchema: uploadFileOutputSchema,
displayName: 'Upload File',
description:
- 'Uploads a file to Baserow from a URL. Returns the uploaded file object that can be used in file fields. Requires Email & Password (JWT) authentication — Database Tokens do not have access to the user-files endpoint.',
+ 'Uploads a file to Baserow from a URL. Returns the uploaded file object that can be used in file fields.',
audience: 'both',
aiMetadata: {
description:
- 'Downloads a file from a public URL and uploads it into Baserow user files, producing a file reference you can then assign to a file field via Create/Update Row. Use as the first step before attaching files to rows. Requires Email & Password (JWT) authentication — Database Token connections cannot reach the user-files endpoint. Not idempotent — each call uploads a new file copy.',
+ 'Downloads a file from a public URL and uploads it into Baserow user files, producing a file reference you can then assign to a file field via Create/Update Row. Use as the first step before attaching files to rows. Not idempotent — each call uploads a new file copy.',
idempotent: false,
},
auth: baserowAuth,
@@ -23,11 +25,6 @@ export const uploadFileAction = createAction({
}),
},
async run(context) {
- if (!baserowAuthHelpers.isJwtAuth(context.auth)) {
- throw new Error(
- 'Upload File requires Email & Password (JWT) authentication. Database Tokens are limited to row CRUD operations and cannot access the user-files endpoint. Please create a new Baserow connection using Email & Password.'
- );
- }
const { url } = context.propsValue;
const client = await makeClient(context.auth);
return await client.uploadFileFromUrl({ url });
diff --git a/packages/pieces/community/baserow/src/lib/actions/upsert-row-ai.ts b/packages/pieces/community/baserow/src/lib/actions/upsert-row-ai.ts
new file mode 100644
index 00000000000..3b1968109a5
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/actions/upsert-row-ai.ts
@@ -0,0 +1,135 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { baserowAuth } from '../auth';
+import { BaserowFieldType } from '../common/constants';
+import { BaserowField } from '../common/types';
+import { ensureSelectOptionsExist, makeClient } from '../common';
+import { baserowAiProps } from '../common/ai-props';
+import { baserowAiHelpers } from '../common/ai-helpers';
+import { upsertRowOutputSchema } from '../output-schemas';
+
+export const upsertRowAiAction = createAction({
+ name: 'baserow_upsert_row_ai',
+ classification: 'WRITE',
+ outputSchema: upsertRowOutputSchema,
+ displayName: 'Upsert Row',
+ description: 'Updates the row matching a key field value, or creates it.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Looks up the first row whose match field equals the match value; updates it with the given fields if found, otherwise creates a new row with those fields plus the match value (the match value always wins over the same field in Fields). Use to sync records by a unique key (email, external ID) without duplicates. Idempotent only when the match value is unique in the table — the lookup and write are separate calls, so concurrent calls can still create two rows.',
+ idempotent: true,
+ },
+ auth: baserowAuth,
+ props: {
+ table_id: baserowAiProps.tableIdProp(),
+ match_field: Property.ShortText({
+ displayName: 'Match Field Name',
+ description: 'Exact name of the key field to match on. Must be a writable text, long text, number, rating, boolean, email, URL, phone number or single select field.',
+ required: true,
+ }),
+ match_value: Property.ShortText({
+ displayName: 'Match Value',
+ description: 'The key value to look for. For a single select field, pass the option name, or its option ID when no option has that name.',
+ required: true,
+ }),
+ fields: Property.Json({
+ displayName: 'Fields',
+ description:
+ 'JSON object of field name to value to write on the matched or new row. Formats match Create Row. The match field is not changed on an existing row.',
+ required: true,
+ }),
+ create_missing_select_options: Property.Checkbox({
+ displayName: 'Create Missing Select Options',
+ description:
+ 'Adds single/multiple select values that do not exist yet as new options before writing. Requires an Email & Password connection.',
+ required: false,
+ defaultValue: false,
+ }),
+ },
+ async run(context) {
+ const { table_id, match_field, match_value, fields, create_missing_select_options } =
+ context.propsValue;
+ baserowAiHelpers.assertSelectOptionsAllowed({
+ auth: context.auth,
+ createMissingSelectOptions: create_missing_select_options,
+ });
+ const payload = baserowAiHelpers.toRecord({ value: fields, propName: 'Fields' });
+ const client = await makeClient(context.auth);
+ return await baserowAiHelpers.execute(async () => {
+ const tableFields = await client.listTableFields(table_id);
+ const matchField = tableFields.find((f) => f.name === match_field);
+ if (!matchField) {
+ throw new Error(
+ `Field "${match_field}" was not found in table ${table_id}. Available fields: ${tableFields.map((f) => f.name).join(', ')}.`
+ );
+ }
+ if (!isMatchableField({ field: matchField })) {
+ throw new Error(
+ `Field "${match_field}" (${matchField.type}${matchField.read_only ? ', read-only' : ''}) cannot be used as a match field. Use a writable text, long text, number, rating, boolean, email, URL, phone number or single select field. Matchable fields: ${tableFields.filter((f) => isMatchableField({ field: f })).map((f) => f.name).join(', ')}.`
+ );
+ }
+ const matchFilter = buildMatchFilter({ field: matchField, value: match_value });
+ const existingRow = matchFilter
+ ? (await client.queryRows({ tableId: table_id, query: { size: '1', ...matchFilter } })).results[0]
+ : undefined;
+ const rowPayload = existingRow
+ ? Object.fromEntries(Object.entries(payload).filter(([key]) => key !== matchField.name))
+ : { ...payload, [matchField.name]: toCreateValue({ field: matchField, value: match_value }) };
+ if (create_missing_select_options) {
+ await ensureSelectOptionsExist({ fields: tableFields, payload: rowPayload, client });
+ }
+ if (existingRow) {
+ const row = await client.updateRow(table_id, existingRow.id, rowPayload);
+ return { action: 'updated', row };
+ }
+ const row = await client.createRow(table_id, rowPayload);
+ return { action: 'created', row };
+ });
+ },
+});
+
+function isMatchableField({ field }: { field: BaserowField }): boolean {
+ const unsupportedTypes: string[] = [
+ BaserowFieldType.LINK_TO_TABLE,
+ BaserowFieldType.MULTI_SELECT,
+ BaserowFieldType.MULTIPLE_COLLABORATORS,
+ BaserowFieldType.FILE,
+ BaserowFieldType.ROLLUP,
+ BaserowFieldType.LOOKUP,
+ BaserowFieldType.COUNT,
+ BaserowFieldType.LAST_MODIFIED_BY,
+ BaserowFieldType.CREATED_BY,
+ BaserowFieldType.DATE,
+ BaserowFieldType.LAST_MODIFIED,
+ BaserowFieldType.CREATED_ON,
+ BaserowFieldType.DURATION,
+ BaserowFieldType.UUID,
+ BaserowFieldType.AUTO_NUMBER,
+ ];
+ return !field.read_only && !unsupportedTypes.includes(field.type);
+}
+
+function buildMatchFilter({ field, value }: { field: BaserowField; value: string }): Record<string, string> | null {
+ if (field.type !== BaserowFieldType.SINGLE_SELECT) {
+ return { [`filter__field_${field.id}__equal`]: value };
+ }
+ const option = findSelectOption({ field, value });
+ return option ? { [`filter__field_${field.id}__single_select_equal`]: String(option.id) } : null;
+}
+
+function toCreateValue({ field, value }: { field: BaserowField; value: string }): string | number {
+ if (field.type !== BaserowFieldType.SINGLE_SELECT) {
+ return value;
+ }
+ return findSelectOption({ field, value })?.id ?? value;
+}
+
+function findSelectOption({ field, value }: { field: BaserowField; value: string }): { id: number; value: string } | undefined {
+ if (field.type !== BaserowFieldType.SINGLE_SELECT) {
+ return undefined;
+ }
+ return (
+ field.select_options.find((o) => o.value === value) ??
+ field.select_options.find((o) => String(o.id) === value.trim())
+ );
+}
diff --git a/packages/pieces/community/baserow/src/lib/actions/upsert-row.ts b/packages/pieces/community/baserow/src/lib/actions/upsert-row.ts
index 8c74638e9e1..9d445fbb119 100644
--- a/packages/pieces/community/baserow/src/lib/actions/upsert-row.ts
+++ b/packages/pieces/community/baserow/src/lib/actions/upsert-row.ts
@@ -11,14 +11,16 @@ import {
makeClient,
} from '../common';
import { BaserowFieldType } from '../common/constants';
+import { upsertRowOutputSchema } from '../output-schemas';
export const upsertRowAction = createAction({
name: 'baserow_upsert_row',
classification: 'WRITE',
+ outputSchema: upsertRowOutputSchema,
displayName: 'Upsert Row',
description:
'Creates a new row or updates an existing one by matching a field value.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Inserts or updates a single Baserow row keyed on a match field value: if a row whose match field exactly equals the given value exists it is updated, otherwise a new row is created with that value. Use to sync records idempotently without creating duplicates. The match field must be a writable, filterable type (read-only, link, select, file, date, and auto-number fields are excluded). Idempotent on the match key — repeating the same call converges the row to the same state rather than adding rows.',
diff --git a/packages/pieces/community/baserow/src/lib/common/ai-helpers.ts b/packages/pieces/community/baserow/src/lib/common/ai-helpers.ts
new file mode 100644
index 00000000000..c696f7ea69d
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/common/ai-helpers.ts
@@ -0,0 +1,163 @@
+import { HttpError } from '@activepieces/pieces-common';
+import { tryCatch } from '@activepieces/pieces-framework';
+import { baserowAuthHelpers, BaserowAuthValue } from '../auth';
+import { BaserowClient } from './client';
+import { BaserowField } from './types';
+
+export const baserowAiHelpers = {
+ assertJwt,
+ assertSelectOptionsAllowed,
+ execute,
+ toRecord,
+ toRecordArray,
+ toIdArray,
+ resolveField,
+ BATCH_LIMIT: 200,
+};
+
+function assertJwt({
+ auth,
+ actionName,
+}: {
+ auth: BaserowAuthValue;
+ actionName: string;
+}): void {
+ if (!baserowAuthHelpers.isJwtAuth(auth)) {
+ throw new Error(
+ `${actionName} requires a Baserow connection that uses Email & Password. Database Tokens can only read and write rows. Reconnect Baserow with Email & Password to use this action.`
+ );
+ }
+}
+
+function assertSelectOptionsAllowed({
+ auth,
+ createMissingSelectOptions,
+}: {
+ auth: BaserowAuthValue;
+ createMissingSelectOptions: boolean | undefined;
+}): void {
+ if (createMissingSelectOptions && !baserowAuthHelpers.isJwtAuth(auth)) {
+ throw new Error(
+ 'Creating missing select options edits the field and requires a Baserow connection that uses Email & Password. Turn the option off, or reconnect Baserow with Email & Password.'
+ );
+ }
+}
+
+async function execute<T>(request: () => Promise<T>): Promise<T> {
+ const { data, error } = await tryCatch(request);
+ if (error) {
+ throw new Error(describeError(error));
+ }
+ return data;
+}
+
+function toRecord({ value, propName }: { value: unknown; propName: string }): Record<string, unknown> {
+ if (isRecord(value)) {
+ return value;
+ }
+ throw new Error(`${propName} must be a JSON object.`);
+}
+
+function toRecordArray({
+ value,
+ propName,
+ max,
+}: {
+ value: unknown;
+ propName: string;
+ max: number;
+}): Record<string, unknown>[] {
+ if (!Array.isArray(value) || value.length === 0) {
+ throw new Error(`${propName} must be a non-empty JSON array of objects.`);
+ }
+ if (value.length > max) {
+ throw new Error(`${propName} accepts at most ${max} items per call; received ${value.length}.`);
+ }
+ return value.map((item, index) => {
+ if (!isRecord(item)) {
+ throw new Error(`${propName}[${index}] must be a JSON object.`);
+ }
+ return item;
+ });
+}
+
+function toIdArray({
+ value,
+ propName,
+ max,
+}: {
+ value: unknown[] | undefined;
+ propName: string;
+ max: number;
+}): number[] {
+ if (!value || value.length === 0) {
+ throw new Error(`${propName} must contain at least one ID.`);
+ }
+ if (value.length > max) {
+ throw new Error(`${propName} accepts at most ${max} IDs per call; received ${value.length}.`);
+ }
+ return value.map((item) => {
+ const id = Number(item);
+ if (!Number.isInteger(id) || id <= 0) {
+ throw new Error(`${propName} contains an invalid ID: ${String(item)}.`);
+ }
+ return id;
+ });
+}
+
+async function resolveField({
+ client,
+ tableId,
+ fieldName,
+}: {
+ client: BaserowClient;
+ tableId: number;
+ fieldName: string;
+}): Promise<BaserowField> {
+ const fields = await client.listTableFields(tableId);
+ const field = fields.find((f) => f.name === fieldName);
+ if (!field) {
+ throw new Error(
+ `Field "${fieldName}" was not found in table ${tableId}. Available fields: ${fields.map((f) => f.name).join(', ')}.`
+ );
+ }
+ return field;
+}
+
+function isRecord(value: unknown): value is Record<string, unknown> {
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
+}
+
+function describeError(error: unknown): string {
+ if (!(error instanceof HttpError)) {
+ return error instanceof Error ? error.message : String(error);
+ }
+ const { status, body } = error.response;
+ const detail = extractDetail(body);
+ switch (status) {
+ case 400:
+ return `Baserow rejected the request: ${detail}`;
+ case 401:
+ return `Baserow authentication failed. Check the connection credentials. ${detail}`;
+ case 402:
+ return `This Baserow feature requires a Premium or higher plan. ${detail}`;
+ case 403:
+ return `The Baserow connection does not have permission for this operation. ${detail}`;
+ case 404:
+ return `The Baserow resource was not found. Check the IDs. ${detail}`;
+ case 429:
+ return `Baserow rate limit reached. Retry after a short wait. ${detail}`;
+ default:
+ return `Baserow request failed with status ${status}: ${detail}`;
+ }
+}
+
+function extractDetail(body: unknown): string {
+ if (isRecord(body)) {
+ const code = typeof body['error'] === 'string' ? body['error'] : '';
+ const detail = body['detail'];
+ const detailText = typeof detail === 'string' ? detail : detail === undefined ? '' : JSON.stringify(detail);
+ return [code, detailText].filter((part) => part.length > 0).join(' — ');
+ }
+ return typeof body === 'string' ? body : JSON.stringify(body);
+}
diff --git a/packages/pieces/community/baserow/src/lib/common/ai-props.ts b/packages/pieces/community/baserow/src/lib/common/ai-props.ts
new file mode 100644
index 00000000000..636b42eaeef
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/common/ai-props.ts
@@ -0,0 +1,40 @@
+import { Property } from '@activepieces/pieces-framework';
+
+export const baserowAiProps = {
+ tableIdProp,
+ rowIdProp,
+ fieldIdProp,
+ workspaceIdProp,
+};
+
+function tableIdProp() {
+ return Property.Number({
+ displayName: 'Table ID',
+ description: 'The numeric Baserow table ID. Resolve it with List Tables.',
+ required: true,
+ });
+}
+
+function rowIdProp() {
+ return Property.Number({
+ displayName: 'Row ID',
+ description: 'The numeric row ID. Resolve it with Find Row or List Rows.',
+ required: true,
+ });
+}
+
+function fieldIdProp() {
+ return Property.Number({
+ displayName: 'Field ID',
+ description: 'The numeric field ID. Resolve it with Get Table Fields.',
+ required: true,
+ });
+}
+
+function workspaceIdProp() {
+ return Property.Number({
+ displayName: 'Workspace ID',
+ description: 'The numeric workspace ID. Resolve it with List Workspaces.',
+ required: true,
+ });
+}
diff --git a/packages/pieces/community/baserow/src/lib/common/client.ts b/packages/pieces/community/baserow/src/lib/common/client.ts
index a25422fd0fa..2d717db7a86 100644
--- a/packages/pieces/community/baserow/src/lib/common/client.ts
+++ b/packages/pieces/community/baserow/src/lib/common/client.ts
@@ -255,4 +255,235 @@ export class BaserowClient {
{ url }
);
}
+ async queryRows({
+ tableId,
+ query,
+ }: {
+ tableId: number;
+ query: QueryParams;
+ }): Promise<BaserowRowPage> {
+ return await this.makeRequest<BaserowRowPage>(
+ HttpMethod.GET,
+ `/database/rows/table/${tableId}/`,
+ { ...query, user_field_names: 'true' }
+ );
+ }
+ async listAllViews({ tableId }: { tableId: number }): Promise<Record<string, unknown>[]> {
+ return await this.makeRequest<Record<string, unknown>[]>(
+ HttpMethod.GET,
+ `/database/views/table/${tableId}/`
+ );
+ }
+ async listApplications(): Promise<BaserowApplication[]> {
+ return await this.makeRequest<BaserowApplication[]>(HttpMethod.GET, `/applications/`);
+ }
+ async listWorkspaces(): Promise<Record<string, unknown>[]> {
+ return await this.makeRequest<Record<string, unknown>[]>(HttpMethod.GET, `/workspaces/`);
+ }
+ async createDatabase({
+ workspaceId,
+ name,
+ }: {
+ workspaceId: number;
+ name: string;
+ }): Promise<Record<string, unknown>> {
+ return await this.makeRequest(
+ HttpMethod.POST,
+ `/applications/workspace/${workspaceId}/`,
+ undefined,
+ { type: 'database', name, init_with_data: false }
+ );
+ }
+ async getTable({ tableId }: { tableId: number }): Promise<Record<string, unknown>> {
+ return await this.makeRequest(HttpMethod.GET, `/database/tables/${tableId}/`);
+ }
+ async createTable({
+ databaseId,
+ name,
+ data,
+ firstRowHeader,
+ }: {
+ databaseId: number;
+ name: string;
+ data: unknown[][];
+ firstRowHeader: boolean;
+ }): Promise<Record<string, unknown>> {
+ return await this.makeRequest(
+ HttpMethod.POST,
+ `/database/tables/database/${databaseId}/`,
+ undefined,
+ { name, data, first_row_header: firstRowHeader }
+ );
+ }
+ async updateTable({
+ tableId,
+ name,
+ }: {
+ tableId: number;
+ name: string;
+ }): Promise<Record<string, unknown>> {
+ return await this.makeRequest(
+ HttpMethod.PATCH,
+ `/database/tables/${tableId}/`,
+ undefined,
+ { name }
+ );
+ }
+ async deleteTable({ tableId }: { tableId: number }): Promise<void> {
+ await this.makeRequest(HttpMethod.DELETE, `/database/tables/${tableId}/`);
+ }
+ async createField({
+ tableId,
+ body,
+ }: {
+ tableId: number;
+ body: Record<string, unknown>;
+ }): Promise<Record<string, unknown>> {
+ return await this.makeRequest(
+ HttpMethod.POST,
+ `/database/fields/table/${tableId}/`,
+ undefined,
+ body
+ );
+ }
+ async updateField({
+ fieldId,
+ body,
+ }: {
+ fieldId: number;
+ body: Record<string, unknown>;
+ }): Promise<Record<string, unknown>> {
+ return await this.makeRequest(
+ HttpMethod.PATCH,
+ `/database/fields/${fieldId}/`,
+ undefined,
+ body
+ );
+ }
+ async deleteField({ fieldId }: { fieldId: number }): Promise<Record<string, unknown>> {
+ return await this.makeRequest(HttpMethod.DELETE, `/database/fields/${fieldId}/`);
+ }
+ async getFieldUniqueValues({
+ fieldId,
+ limit,
+ splitCommaSeparated,
+ }: {
+ fieldId: number;
+ limit?: number;
+ splitCommaSeparated?: boolean;
+ }): Promise<{ values: string[] }> {
+ return await this.makeRequest<{ values: string[] }>(
+ HttpMethod.GET,
+ `/database/fields/${fieldId}/unique_row_values/`,
+ prepareQuery({ limit, split_comma_separated: splitCommaSeparated })
+ );
+ }
+ async listRowNames({
+ tableId,
+ rowIds,
+ }: {
+ tableId: number;
+ rowIds: number[];
+ }): Promise<Record<string, Record<string, string>>> {
+ return await this.makeRequest<Record<string, Record<string, string>>>(
+ HttpMethod.GET,
+ `/database/rows/names/`,
+ { [`table__${tableId}`]: rowIds.join(',') }
+ );
+ }
+ async getRowHistory({
+ tableId,
+ rowId,
+ limit,
+ offset,
+ }: {
+ tableId: number;
+ rowId: number;
+ limit?: number;
+ offset?: number;
+ }): Promise<Record<string, unknown>> {
+ return await this.makeRequest(
+ HttpMethod.GET,
+ `/database/rows/table/${tableId}/${rowId}/history/`,
+ prepareQuery({ limit, offset })
+ );
+ }
+ async listWorkspaceUsers({
+ workspaceId,
+ search,
+ }: {
+ workspaceId: number;
+ search?: string;
+ }): Promise<Record<string, unknown>[]> {
+ return await this.makeRequest<Record<string, unknown>[]>(
+ HttpMethod.GET,
+ `/workspaces/users/workspace/${workspaceId}/`,
+ prepareQuery({ search })
+ );
+ }
+ async searchWorkspace({
+ workspaceId,
+ query,
+ limit,
+ offset,
+ }: {
+ workspaceId: number;
+ query: string;
+ limit?: number;
+ offset?: number;
+ }): Promise<Record<string, unknown>> {
+ return await this.makeRequest(
+ HttpMethod.GET,
+ `/search/workspace/${workspaceId}/`,
+ prepareQuery({ query, limit, offset })
+ );
+ }
+ async exportTable({
+ tableId,
+ body,
+ }: {
+ tableId: number;
+ body: Record<string, unknown>;
+ }): Promise<Record<string, unknown>> {
+ return await this.makeRequest(
+ HttpMethod.POST,
+ `/database/export/table/${tableId}/`,
+ undefined,
+ body
+ );
+ }
+ async getExportJob({ jobId }: { jobId: number }): Promise<Record<string, unknown>> {
+ return await this.makeRequest(HttpMethod.GET, `/database/export/${jobId}/`);
+ }
+ async createView({
+ tableId,
+ name,
+ type,
+ }: {
+ tableId: number;
+ name: string;
+ type: string;
+ }): Promise<Record<string, unknown>> {
+ return await this.makeRequest(
+ HttpMethod.POST,
+ `/database/views/table/${tableId}/`,
+ undefined,
+ { name, type }
+ );
+ }
}
+
+type BaserowRowPage = {
+ count: number;
+ next: string | null;
+ previous: string | null;
+ results: Array<{ id: number } & Record<string, unknown>>;
+};
+
+type BaserowApplication = {
+ id: number;
+ name: string;
+ type: string;
+ workspace?: { id: number; name: string };
+ tables?: BaserowTable[];
+};
diff --git a/packages/pieces/community/baserow/src/lib/output-schemas.ts b/packages/pieces/community/baserow/src/lib/output-schemas.ts
new file mode 100644
index 00000000000..ce7bf4bbd54
--- /dev/null
+++ b/packages/pieces/community/baserow/src/lib/output-schemas.ts
@@ -0,0 +1,425 @@
+import { OutputSchema } from '@activepieces/pieces-framework';
+
+const rowFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Row ID', format: 'number' },
+ { key: 'order', label: 'Order' },
+ { key: 'fields', label: 'Row Fields', value: '', dynamicKey: true },
+];
+
+const rowChangeFields: OutputSchema['fields'] = [
+ { key: 'row', label: 'Row', children: rowFields },
+ { key: 'previous', label: 'Previous Row', children: rowFields },
+];
+
+const rowListFields: OutputSchema['fields'] = [
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'rows', label: 'Rows', labelKey: 'id', listItems: rowFields },
+];
+
+const tableFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Table ID', format: 'number' },
+ { key: 'name', label: 'Table Name' },
+ { key: 'order', label: 'Order', format: 'number' },
+ { key: 'database_id', label: 'Database ID', format: 'number' },
+];
+
+const selectOptionFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Option ID', format: 'number' },
+ { key: 'value', label: 'Value' },
+];
+
+const fieldDefinitionFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Field ID', format: 'number' },
+ { key: 'table_id', label: 'Table ID', format: 'number' },
+ { key: 'name', label: 'Field Name' },
+ { key: 'type', label: 'Field Type' },
+ { key: 'primary', label: 'Primary', format: 'boolean' },
+ { key: 'read_only', label: 'Read Only', format: 'boolean' },
+ { key: 'description', label: 'Description' },
+ {
+ key: 'select_options',
+ label: 'Select Options',
+ labelKey: 'value',
+ listItems: [...selectOptionFields, { key: 'color', label: 'Color' }],
+ },
+];
+
+export const rowOutputSchema: OutputSchema = { fields: rowFields };
+
+export const listRowsOutputSchema: OutputSchema = { fields: rowListFields };
+
+export const listRowsAiOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'count', label: 'Total Matching Rows', format: 'number' },
+ { key: 'has_more', label: 'Has More Pages', format: 'boolean' },
+ { key: 'rows', label: 'Rows', labelKey: 'id', listItems: rowFields },
+ ],
+};
+
+export const findRowOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'found', label: 'Found', format: 'boolean' },
+ { key: 'count', label: 'Match Count', format: 'number' },
+ ...rowFields,
+ ],
+};
+
+export const findRowAiOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'found', label: 'Found', format: 'boolean' },
+ { key: 'count', label: 'Match Count', format: 'number' },
+ { key: 'row', label: 'Row', children: rowFields },
+ ],
+};
+
+export const upsertRowOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'action', label: 'Action Taken' },
+ { key: 'row', label: 'Row', children: rowFields },
+ ],
+};
+
+export const batchRowsOutputSchema: OutputSchema = { fields: rowListFields };
+
+export const deleteRowOutputSchema: OutputSchema = {
+ fields: [{ key: 'success', label: 'Success', format: 'boolean' }],
+};
+
+export const deleteRowAiOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'deleted', label: 'Deleted', format: 'boolean' },
+ { key: 'table_id', label: 'Table ID', format: 'number' },
+ { key: 'row_id', label: 'Row ID', format: 'number' },
+ ],
+};
+
+export const batchDeleteRowsOutputSchema: OutputSchema = {
+ fields: [{ key: 'deleted_count', label: 'Deleted Count', format: 'number' }],
+};
+
+export const batchDeleteRowsAiOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'deleted', label: 'Deleted', format: 'boolean' },
+ { key: 'count', label: 'Deleted Count', format: 'number' },
+ { key: 'row_ids', label: 'Deleted Row IDs' },
+ ],
+};
+
+export const aggregateFieldOutputSchema: OutputSchema = {
+ fields: [{ key: 'result', label: 'Result' }],
+};
+
+export const aggregateFieldAiOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'aggregation_type', label: 'Aggregation Type' },
+ { key: 'value', label: 'Value' },
+ ],
+};
+
+export const uploadFileOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'name', label: 'File Name', description: 'Pass as [{"name": "<this value>"}] to a file field.' },
+ { key: 'original_name', label: 'Original Name' },
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'size', label: 'Size', format: 'filesize' },
+ { key: 'mime_type', label: 'MIME Type' },
+ { key: 'is_image', label: 'Is Image', format: 'boolean' },
+ { key: 'image_width', label: 'Image Width', format: 'number' },
+ { key: 'image_height', label: 'Image Height', format: 'number' },
+ { key: 'uploaded_at', label: 'Uploaded At', format: 'datetime' },
+ { key: 'thumbnails', label: 'Thumbnails', dynamicKey: true },
+ ],
+};
+
+export const listTablesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'count', label: 'Count', format: 'number' },
+ {
+ key: 'tables',
+ label: 'Tables',
+ labelKey: 'name',
+ listItems: [
+ { key: 'id', label: 'Table ID', format: 'number' },
+ { key: 'name', label: 'Table Name' },
+ { key: 'database_id', label: 'Database ID', format: 'number' },
+ ],
+ },
+ ],
+};
+
+export const getTableFieldsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'count', label: 'Count', format: 'number' },
+ {
+ key: 'fields',
+ label: 'Fields',
+ labelKey: 'name',
+ listItems: [
+ { key: 'id', label: 'Field ID', format: 'number' },
+ { key: 'name', label: 'Field Name' },
+ { key: 'type', label: 'Field Type' },
+ { key: 'primary', label: 'Primary', format: 'boolean' },
+ { key: 'read_only', label: 'Read Only', format: 'boolean' },
+ { key: 'select_options', label: 'Select Options', labelKey: 'value', listItems: selectOptionFields },
+ { key: 'link_row_table_id', label: 'Linked Table ID', format: 'number' },
+ ],
+ },
+ ],
+};
+
+export const listViewsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'count', label: 'Count', format: 'number' },
+ {
+ key: 'views',
+ label: 'Views',
+ labelKey: 'name',
+ listItems: [
+ { key: 'id', label: 'View ID', format: 'number' },
+ { key: 'name', label: 'View Name' },
+ { key: 'type', label: 'View Type' },
+ ],
+ },
+ ],
+};
+
+export const listWorkspacesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'count', label: 'Count', format: 'number' },
+ {
+ key: 'workspaces',
+ label: 'Workspaces',
+ labelKey: 'name',
+ listItems: [
+ { key: 'id', label: 'Workspace ID', format: 'number' },
+ { key: 'name', label: 'Workspace Name' },
+ { key: 'permissions', label: 'Permission Level' },
+ ],
+ },
+ ],
+};
+
+export const listDatabasesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'count', label: 'Count', format: 'number' },
+ {
+ key: 'databases',
+ label: 'Databases',
+ labelKey: 'name',
+ listItems: [
+ { key: 'id', label: 'Database ID', format: 'number' },
+ { key: 'name', label: 'Database Name' },
+ { key: 'workspace_id', label: 'Workspace ID', format: 'number' },
+ { key: 'workspace_name', label: 'Workspace Name' },
+ {
+ key: 'tables',
+ label: 'Tables',
+ labelKey: 'name',
+ listItems: [
+ { key: 'id', label: 'Table ID', format: 'number' },
+ { key: 'name', label: 'Table Name' },
+ ],
+ },
+ ],
+ },
+ ],
+};
+
+export const createDatabaseOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'Database ID', format: 'number' },
+ { key: 'name', label: 'Database Name' },
+ {
+ key: 'workspace',
+ label: 'Workspace',
+ children: [
+ { key: 'id', label: 'Workspace ID', format: 'number' },
+ { key: 'name', label: 'Workspace Name' },
+ ],
+ },
+ ],
+};
+
+export const tableOutputSchema: OutputSchema = { fields: tableFields };
+
+export const createTableOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'Table ID', format: 'number' },
+ { key: 'name', label: 'Table Name' },
+ { key: 'database_id', label: 'Database ID', format: 'number' },
+ ],
+};
+
+export const deleteTableOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'deleted', label: 'Deleted', format: 'boolean' },
+ { key: 'table_id', label: 'Table ID', format: 'number' },
+ ],
+};
+
+export const fieldOutputSchema: OutputSchema = { fields: fieldDefinitionFields };
+
+export const deleteFieldOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'deleted', label: 'Deleted', format: 'boolean' },
+ { key: 'field_id', label: 'Field ID', format: 'number' },
+ { key: 'related_fields', label: 'Related Fields Changed', labelKey: 'name', listItems: fieldDefinitionFields },
+ ],
+};
+
+export const getFieldUniqueValuesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'values', label: 'Values' },
+ ],
+};
+
+export const listRowNamesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'rows',
+ label: 'Rows',
+ labelKey: 'name',
+ listItems: [
+ { key: 'id', label: 'Row ID', format: 'number' },
+ { key: 'name', label: 'Name' },
+ ],
+ },
+ ],
+};
+
+export const getRowHistoryOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'count', label: 'Total Entries', format: 'number' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ {
+ key: 'entries',
+ label: 'Entries',
+ labelKey: 'timestamp',
+ listItems: [
+ { key: 'id', label: 'Entry ID', format: 'number' },
+ { key: 'action_type', label: 'Action Type' },
+ { key: 'timestamp', label: 'Changed At', format: 'datetime' },
+ {
+ key: 'user',
+ label: 'Changed By',
+ children: [
+ { key: 'id', label: 'User ID', format: 'number' },
+ { key: 'name', label: 'Name' },
+ ],
+ },
+ { key: 'before', label: 'Before', dynamicKey: true },
+ { key: 'after', label: 'After', dynamicKey: true },
+ ],
+ },
+ ],
+};
+
+export const searchWorkspaceOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ {
+ key: 'results',
+ label: 'Results',
+ labelKey: 'title',
+ listItems: [
+ { key: 'type', label: 'Result Type' },
+ { key: 'id', label: 'Result ID', format: 'number' },
+ { key: 'title', label: 'Title' },
+ { key: 'subtitle', label: 'Subtitle' },
+ { key: 'description', label: 'Description' },
+ {
+ key: 'metadata',
+ label: 'Location',
+ children: [
+ { key: 'workspace_id', label: 'Workspace ID', format: 'number' },
+ { key: 'database_id', label: 'Database ID', format: 'number' },
+ { key: 'database_name', label: 'Database Name' },
+ { key: 'table_id', label: 'Table ID', format: 'number' },
+ { key: 'table_name', label: 'Table Name' },
+ { key: 'row_id', label: 'Row ID', format: 'number' },
+ { key: 'field_id', label: 'Field ID', format: 'number' },
+ { key: 'field_name', label: 'Field Name' },
+ { key: 'primary_field_value', label: 'Primary Field Value' },
+ ],
+ },
+ ],
+ },
+ ],
+};
+
+export const listWorkspaceUsersOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'count', label: 'Count', format: 'number' },
+ {
+ key: 'users',
+ label: 'Users',
+ labelKey: 'name',
+ listItems: [
+ { key: 'user_id', label: 'User ID', format: 'number' },
+ { key: 'name', label: 'Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'permissions', label: 'Role' },
+ ],
+ },
+ ],
+};
+
+export const exportTableOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'job_id', label: 'Export Job ID', format: 'number' },
+ { key: 'state', label: 'State' },
+ ],
+};
+
+export const getExportJobOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'job_id', label: 'Export Job ID', format: 'number' },
+ { key: 'state', label: 'State' },
+ { key: 'progress_percentage', label: 'Progress (%)', format: 'number' },
+ { key: 'file_name', label: 'File Name' },
+ { key: 'url', label: 'Download URL', format: 'url' },
+ ],
+};
+
+export const createViewOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'View ID', format: 'number' },
+ { key: 'name', label: 'View Name' },
+ { key: 'type', label: 'View Type' },
+ { key: 'table_id', label: 'Table ID', format: 'number' },
+ ],
+};
+
+export const rowUpdatedTriggerOutputSchema: OutputSchema = { fields: rowChangeFields };
+
+export const rowDeletedTriggerOutputSchema: OutputSchema = {
+ fields: [{ key: 'id', label: 'Deleted Row ID', format: 'number' }],
+};
+
+export const rowEventTriggerOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'event_type', label: 'Event Type' },
+ { key: 'row', label: 'Row', children: rowFields },
+ { key: 'previous_row', label: 'Previous Row', children: rowFields },
+ ],
+};
+
+export const rowsUpdatedTriggerOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'rows', label: 'Rows', listItems: rowChangeFields },
+ ],
+};
+
+export const rowsDeletedTriggerOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'count', label: 'Count', format: 'number' },
+ {
+ key: 'rows',
+ label: 'Deleted Rows',
+ labelKey: 'id',
+ listItems: [{ key: 'id', label: 'Row ID', format: 'number' }],
+ },
+ ],
+};
diff --git a/packages/pieces/community/baserow/src/lib/triggers/row-created.ts b/packages/pieces/community/baserow/src/lib/triggers/row-created.ts
index 4cfd5116710..3a20acdf422 100644
--- a/packages/pieces/community/baserow/src/lib/triggers/row-created.ts
+++ b/packages/pieces/community/baserow/src/lib/triggers/row-created.ts
@@ -2,6 +2,7 @@ import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { baserowCommon, makeClient } from '../common';
import { createWebhookTriggerHooks, dynamicWebhookInstructions } from '../common/webhook-trigger';
+import { rowOutputSchema } from '../output-schemas';
const triggerHooks = createWebhookTriggerHooks({
events: ['rows.created'],
@@ -11,6 +12,7 @@ const triggerHooks = createWebhookTriggerHooks({
export const rowCreatedTrigger = createTrigger({
name: 'baserow_row_created',
classification: 'READ',
+ outputSchema: rowOutputSchema,
auth: baserowAuth,
displayName: 'New Row',
description: 'Triggers when a new row is created in a Baserow table.',
diff --git a/packages/pieces/community/baserow/src/lib/triggers/row-deleted.ts b/packages/pieces/community/baserow/src/lib/triggers/row-deleted.ts
index 5d32d930c2f..3da156a9265 100644
--- a/packages/pieces/community/baserow/src/lib/triggers/row-deleted.ts
+++ b/packages/pieces/community/baserow/src/lib/triggers/row-deleted.ts
@@ -2,6 +2,7 @@ import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { baserowCommon, makeClient } from '../common';
import { createWebhookTriggerHooks, dynamicWebhookInstructions } from '../common/webhook-trigger';
+import { rowDeletedTriggerOutputSchema } from '../output-schemas';
const triggerHooks = createWebhookTriggerHooks({
events: ['rows.deleted'],
@@ -11,6 +12,7 @@ const triggerHooks = createWebhookTriggerHooks({
export const rowDeletedTrigger = createTrigger({
name: 'baserow_row_deleted',
classification: 'READ',
+ outputSchema: rowDeletedTriggerOutputSchema,
auth: baserowAuth,
displayName: 'Deleted Row',
description: 'Triggers when a row is deleted from a Baserow table.',
diff --git a/packages/pieces/community/baserow/src/lib/triggers/row-event.ts b/packages/pieces/community/baserow/src/lib/triggers/row-event.ts
index c07f80466f7..34f71352cac 100644
--- a/packages/pieces/community/baserow/src/lib/triggers/row-event.ts
+++ b/packages/pieces/community/baserow/src/lib/triggers/row-event.ts
@@ -2,6 +2,7 @@ import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { baserowCommon, makeClient } from '../common';
import { createWebhookTriggerHooks, dynamicWebhookInstructions } from '../common/webhook-trigger';
+import { rowEventTriggerOutputSchema } from '../output-schemas';
const triggerHooks = createWebhookTriggerHooks({
events: ['rows.created', 'rows.updated', 'rows.deleted'],
@@ -11,6 +12,7 @@ const triggerHooks = createWebhookTriggerHooks({
export const rowEventTrigger = createTrigger({
name: 'baserow_row_event',
classification: 'READ',
+ outputSchema: rowEventTriggerOutputSchema,
auth: baserowAuth,
displayName: 'Any Row Change',
description:
diff --git a/packages/pieces/community/baserow/src/lib/triggers/row-updated.ts b/packages/pieces/community/baserow/src/lib/triggers/row-updated.ts
index 06b3ad34343..ed9cbca258a 100644
--- a/packages/pieces/community/baserow/src/lib/triggers/row-updated.ts
+++ b/packages/pieces/community/baserow/src/lib/triggers/row-updated.ts
@@ -2,6 +2,7 @@ import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { baserowCommon, makeClient } from '../common';
import { createWebhookTriggerHooks, dynamicWebhookInstructions } from '../common/webhook-trigger';
+import { rowUpdatedTriggerOutputSchema } from '../output-schemas';
const triggerHooks = createWebhookTriggerHooks({
events: ['rows.updated'],
@@ -11,6 +12,7 @@ const triggerHooks = createWebhookTriggerHooks({
export const rowUpdatedTrigger = createTrigger({
name: 'baserow_row_updated',
classification: 'READ',
+ outputSchema: rowUpdatedTriggerOutputSchema,
auth: baserowAuth,
displayName: 'Updated Row',
description: 'Triggers when an existing row is updated in a Baserow table.',
diff --git a/packages/pieces/community/baserow/src/lib/triggers/rows-created.ts b/packages/pieces/community/baserow/src/lib/triggers/rows-created.ts
index 42fbd8b9e3c..1c34c27ff1a 100644
--- a/packages/pieces/community/baserow/src/lib/triggers/rows-created.ts
+++ b/packages/pieces/community/baserow/src/lib/triggers/rows-created.ts
@@ -2,6 +2,7 @@ import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { baserowCommon, makeClient } from '../common';
import { createWebhookTriggerHooks, dynamicWebhookInstructions } from '../common/webhook-trigger';
+import { listRowsOutputSchema } from '../output-schemas';
const triggerHooks = createWebhookTriggerHooks({
events: ['rows.created'],
@@ -11,6 +12,7 @@ const triggerHooks = createWebhookTriggerHooks({
export const rowsCreatedTrigger = createTrigger({
name: 'baserow_rows_created',
classification: 'READ',
+ outputSchema: listRowsOutputSchema,
auth: baserowAuth,
displayName: 'New Rows (Batch)',
description:
diff --git a/packages/pieces/community/baserow/src/lib/triggers/rows-deleted.ts b/packages/pieces/community/baserow/src/lib/triggers/rows-deleted.ts
index 8b59d42962b..db41325b920 100644
--- a/packages/pieces/community/baserow/src/lib/triggers/rows-deleted.ts
+++ b/packages/pieces/community/baserow/src/lib/triggers/rows-deleted.ts
@@ -2,6 +2,7 @@ import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { baserowCommon, makeClient } from '../common';
import { createWebhookTriggerHooks, dynamicWebhookInstructions } from '../common/webhook-trigger';
+import { rowsDeletedTriggerOutputSchema } from '../output-schemas';
const triggerHooks = createWebhookTriggerHooks({
events: ['rows.deleted'],
@@ -11,6 +12,7 @@ const triggerHooks = createWebhookTriggerHooks({
export const rowsDeletedTrigger = createTrigger({
name: 'baserow_rows_deleted',
classification: 'READ',
+ outputSchema: rowsDeletedTriggerOutputSchema,
auth: baserowAuth,
displayName: 'Deleted Rows (Batch)',
description:
diff --git a/packages/pieces/community/baserow/src/lib/triggers/rows-updated.ts b/packages/pieces/community/baserow/src/lib/triggers/rows-updated.ts
index 5ebced3a5d3..140d7429c50 100644
--- a/packages/pieces/community/baserow/src/lib/triggers/rows-updated.ts
+++ b/packages/pieces/community/baserow/src/lib/triggers/rows-updated.ts
@@ -2,6 +2,7 @@ import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { baserowCommon, makeClient } from '../common';
import { createWebhookTriggerHooks, dynamicWebhookInstructions } from '../common/webhook-trigger';
+import { rowsUpdatedTriggerOutputSchema } from '../output-schemas';
const triggerHooks = createWebhookTriggerHooks({
events: ['rows.updated'],
@@ -11,6 +12,7 @@ const triggerHooks = createWebhookTriggerHooks({
export const rowsUpdatedTrigger = createTrigger({
name: 'baserow_rows_updated',
classification: 'READ',
+ outputSchema: rowsUpdatedTriggerOutputSchema,
auth: baserowAuth,
displayName: 'Updated Rows (Batch)',
description: