Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
6386e6b
updates
lakeesiv Jan 13, 2026
5dddb03
required
lakeesiv Jan 13, 2026
e80660f
trashy table viewer
lakeesiv Jan 13, 2026
4316f45
updates
lakeesiv Jan 13, 2026
7e4fc32
updates
lakeesiv Jan 13, 2026
0872314
filtering ui
lakeesiv Jan 14, 2026
9a3d563
updates
lakeesiv Jan 14, 2026
48ecb19
updates
lakeesiv Jan 14, 2026
ed807be
updates
lakeesiv Jan 14, 2026
8a8589e
one input mode
lakeesiv Jan 14, 2026
a919816
format
lakeesiv Jan 14, 2026
6605c88
fix lints
lakeesiv Jan 14, 2026
c1eef30
improved errors
lakeesiv Jan 14, 2026
a537ca7
updates
lakeesiv Jan 14, 2026
fc6dbcf
updates
lakeesiv Jan 14, 2026
48250f5
chages
lakeesiv Jan 14, 2026
c155d8a
doc strings
lakeesiv Jan 14, 2026
4d176c0
breaking down file
lakeesiv Jan 14, 2026
e287388
update comments with ai
lakeesiv Jan 14, 2026
dfa018f
updates
lakeesiv Jan 14, 2026
22f89cf
comments
lakeesiv Jan 14, 2026
8f9cf93
changes
lakeesiv Jan 14, 2026
4422a69
revert
lakeesiv Jan 15, 2026
15bef48
updates
lakeesiv Jan 15, 2026
cfbc8d7
dedupe
lakeesiv Jan 15, 2026
b3ca0c9
updates
lakeesiv Jan 15, 2026
df3e869
updates
lakeesiv Jan 15, 2026
96a3fe5
updates
lakeesiv Jan 15, 2026
cbb93c6
refactoring
lakeesiv Jan 15, 2026
c9373c7
renames & refactors
lakeesiv Jan 15, 2026
b08ce03
refactoring
lakeesiv Jan 15, 2026
ffad20e
updates
lakeesiv Jan 15, 2026
793c888
undo
lakeesiv Jan 15, 2026
c3afbae
update db
lakeesiv Jan 15, 2026
5a69d16
wand
lakeesiv Jan 15, 2026
fdc3af9
updates
lakeesiv Jan 15, 2026
80270ce
fix comments
lakeesiv Jan 15, 2026
57fbd2a
fixes
lakeesiv Jan 15, 2026
7f894ec
simplify comments
lakeesiv Jan 15, 2026
ed543a7
u[dates
lakeesiv Jan 15, 2026
e503408
renames
lakeesiv Jan 15, 2026
0a6312d
better comments
lakeesiv Jan 16, 2026
4665595
validation
lakeesiv Jan 16, 2026
d00997c
updates
lakeesiv Jan 16, 2026
cfffd05
updates
lakeesiv Jan 16, 2026
1a13762
updates
lakeesiv Jan 16, 2026
4490996
fix sorting
lakeesiv Jan 16, 2026
fef2d2c
fix appearnce
lakeesiv Jan 16, 2026
c94bb5a
updating prompt to make it user sort
lakeesiv Jan 16, 2026
e695007
rm
lakeesiv Jan 16, 2026
a940dd6
updates
lakeesiv Jan 16, 2026
271375d
rename
lakeesiv Jan 16, 2026
26d9662
comments
lakeesiv Jan 16, 2026
5173320
clean comments
lakeesiv Jan 16, 2026
ea72ab5
simplicifcaiton
lakeesiv Jan 16, 2026
42aa794
updates
lakeesiv Jan 16, 2026
897891e
updates
lakeesiv Jan 16, 2026
7093209
refactor
lakeesiv Jan 16, 2026
2e624c2
reduced type confusion
lakeesiv Jan 16, 2026
f90c9c7
undo
lakeesiv Jan 16, 2026
abb671e
rename
lakeesiv Jan 16, 2026
448b8f0
undo changes
lakeesiv Jan 16, 2026
e4dd14d
undo
lakeesiv Jan 16, 2026
cca1772
simplify
lakeesiv Jan 16, 2026
86c5e1b
updates
lakeesiv Jan 16, 2026
94c6795
updates
lakeesiv Jan 16, 2026
3d81c1c
revert
lakeesiv Jan 16, 2026
51d1b95
updates
lakeesiv Jan 16, 2026
c662a31
db updates
lakeesiv Jan 16, 2026
e7f4516
type fix
lakeesiv Jan 16, 2026
4357230
fix
lakeesiv Jan 17, 2026
0e1133f
fix error handling
lakeesiv Jan 17, 2026
8955915
updates
lakeesiv Jan 17, 2026
ea77790
docs
lakeesiv Jan 17, 2026
292cd39
docs
lakeesiv Jan 17, 2026
118e4f6
updates
lakeesiv Jan 17, 2026
7ca628d
rename
lakeesiv Jan 17, 2026
37b50cb
dedupe
lakeesiv Jan 17, 2026
4b6de03
revert
lakeesiv Jan 17, 2026
e79e9e7
Merge origin/main into lakees/db
lakeesiv Jan 17, 2026
8574d66
uncook
lakeesiv Jan 17, 2026
d0c3c6a
updates
lakeesiv Jan 17, 2026
6e8dc77
fix
lakeesiv Jan 17, 2026
87f8fcd
fix
lakeesiv Jan 17, 2026
f05f5bb
fix
lakeesiv Jan 17, 2026
a8e413a
fix
lakeesiv Jan 17, 2026
107679b
prepare merge
icecrasher321 Jan 22, 2026
8d43947
Merge staging into lakees/db
icecrasher321 Jan 22, 2026
1f682eb
readd migrations
icecrasher321 Jan 22, 2026
2d49de7
add back missed code
icecrasher321 Jan 22, 2026
2818b74
migrate enrichment logic to general abstraction
icecrasher321 Jan 22, 2026
1938818
address bugbot concerns
icecrasher321 Jan 22, 2026
be757a4
adhere to size limits for tables
icecrasher321 Jan 22, 2026
d9dbe93
remove conflicting migration
icecrasher321 Feb 11, 2026
f0a8d82
Merge remote-tracking branch 'origin/staging' into lakees/db
icecrasher321 Feb 11, 2026
0ffcce8
add back migrations
icecrasher321 Feb 11, 2026
ca70280
fix tables auth
icecrasher321 Feb 11, 2026
8bf3370
fix permissive auth
icecrasher321 Feb 11, 2026
c4986a9
fix lint
icecrasher321 Feb 11, 2026
c18fbcf
Merge branch 'staging' into lakees/db
waleedlatif1 Feb 19, 2026
b476b8d
reran migrations
waleedlatif1 Feb 19, 2026
592dd46
migrate to use tanstack query for all server state
waleedlatif1 Feb 19, 2026
f1938f0
update table-selector
waleedlatif1 Feb 19, 2026
7b0e030
update names
waleedlatif1 Feb 19, 2026
407f9c7
added tables to permission groups, updated subblock types
waleedlatif1 Feb 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions apps/docs/components/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4964,6 +4964,26 @@ export function BedrockIcon(props: SVGProps<SVGSVGElement>) {
)
}

export function TableIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
xmlns='http://www.w3.org/2000/svg'
viewBox='0 0 24 24'
fill='none'
stroke='currentColor'
strokeWidth={2}
strokeLinecap='round'
strokeLinejoin='round'
{...props}
>
<rect width='18' height='18' x='3' y='3' rx='2' />
<path d='M3 9h18' />
<path d='M3 15h18' />
<path d='M9 3v18' />
<path d='M15 3v18' />
</svg>
)
}
export function ReductoIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
Expand Down
1 change: 1 addition & 0 deletions apps/docs/content/docs/en/tools/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
"stripe",
"stt",
"supabase",
"table",
"tavily",
"telegram",
"textract",
Expand Down
351 changes: 351 additions & 0 deletions apps/docs/content/docs/en/tools/table.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,351 @@
---
title: Table
description: User-defined data tables for storing and querying structured data
---

import { BlockInfoCard } from "@/components/ui/block-info-card"

<BlockInfoCard
type="table"
color="#10B981"
/>

Tables allow you to create and manage custom data tables directly within Sim. Store, query, and manipulate structured data within your workflows without needing external database integrations.

**Why Use Tables?**
- **No external setup**: Create tables instantly without configuring external databases
- **Workflow-native**: Data persists across workflow executions and is accessible from any workflow in your workspace
- **Flexible schema**: Define columns with types (string, number, boolean, date, json) and constraints (required, unique)
- **Powerful querying**: Filter, sort, and paginate data using MongoDB-style operators
- **Agent-friendly**: Tables can be used as tools by AI agents for dynamic data storage and retrieval

**Key Features:**
- Create tables with custom schemas
- Insert, update, upsert, and delete rows
- Query with filters and sorting
- Batch operations for bulk inserts
- Bulk updates and deletes by filter
- Up to 10,000 rows per table, 100 tables per workspace

## Creating Tables

Tables are created from the **Tables** section in the sidebar. Each table requires:
- **Name**: Alphanumeric with underscores (e.g., `customer_leads`)
- **Description**: Optional description of the table's purpose
- **Schema**: Define columns with name, type, and optional constraints

### Column Types

| Type | Description | Example Values |
|------|-------------|----------------|
| `string` | Text data | `"John Doe"`, `"active"` |
| `number` | Numeric data | `42`, `99.99` |
| `boolean` | True/false values | `true`, `false` |
| `date` | Date/time values | `"2024-01-15T10:30:00Z"` |
| `json` | Complex nested data | `{"address": {"city": "NYC"}}` |

### Column Constraints

- **Required**: Column must have a value (cannot be null)
- **Unique**: Values must be unique across all rows (enables upsert matching)

## Usage Instructions

Create and manage custom data tables. Store, query, and manipulate structured data within workflows.

## Tools

### `table_query_rows`

Query rows from a table with filtering, sorting, and pagination

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `tableId` | string | Yes | Table ID |
| `filter` | object | No | Filter conditions using MongoDB-style operators |
| `sort` | object | No | Sort order as \{column: "asc"\|"desc"\} |
| `limit` | number | No | Maximum rows to return \(default: 100, max: 1000\) |
| `offset` | number | No | Number of rows to skip \(default: 0\) |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether query succeeded |
| `rows` | array | Query result rows |
| `rowCount` | number | Number of rows returned |
| `totalCount` | number | Total rows matching filter |
| `limit` | number | Limit used in query |
| `offset` | number | Offset used in query |

### `table_insert_row`

Insert a new row into a table

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `tableId` | string | Yes | Table ID |
| `data` | object | Yes | Row data as JSON object matching the table schema |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether row was inserted |
| `row` | object | Inserted row data including generated ID |
| `message` | string | Status message |

### `table_upsert_row`

Insert or update a row based on unique column constraints. If a row with matching unique field exists, update it; otherwise insert a new row.

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `tableId` | string | Yes | Table ID |
| `data` | object | Yes | Row data to insert or update |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether row was upserted |
| `row` | object | Upserted row data |
| `operation` | string | Operation performed: "insert" or "update" |
| `message` | string | Status message |

### `table_batch_insert_rows`

Insert multiple rows at once (up to 1000 rows per batch)

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `tableId` | string | Yes | Table ID |
| `rows` | array | Yes | Array of row data objects to insert |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether batch insert succeeded |
| `rows` | array | Array of inserted rows with IDs |
| `insertedCount` | number | Number of rows inserted |
| `message` | string | Status message |

### `table_update_row`

Update a specific row by its ID

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `tableId` | string | Yes | Table ID |
| `rowId` | string | Yes | Row ID to update |
| `data` | object | Yes | Data to update \(partial update supported\) |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether row was updated |
| `row` | object | Updated row data |
| `message` | string | Status message |

### `table_update_rows_by_filter`

Update multiple rows matching a filter condition

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `tableId` | string | Yes | Table ID |
| `filter` | object | Yes | Filter to match rows for update |
| `data` | object | Yes | Data to apply to matching rows |
| `limit` | number | No | Maximum rows to update \(default: 1000\) |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether update succeeded |
| `updatedCount` | number | Number of rows updated |
| `updatedRowIds` | array | IDs of updated rows |
| `message` | string | Status message |

### `table_delete_row`

Delete a specific row by its ID

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `tableId` | string | Yes | Table ID |
| `rowId` | string | Yes | Row ID to delete |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether row was deleted |
| `deletedCount` | number | Number of rows deleted \(1 or 0\) |
| `message` | string | Status message |

### `table_delete_rows_by_filter`

Delete multiple rows matching a filter condition

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `tableId` | string | Yes | Table ID |
| `filter` | object | Yes | Filter to match rows for deletion |
| `limit` | number | No | Maximum rows to delete \(default: 1000\) |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether delete succeeded |
| `deletedCount` | number | Number of rows deleted |
| `deletedRowIds` | array | IDs of deleted rows |
| `message` | string | Status message |

### `table_get_row`

Get a single row by its ID

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `tableId` | string | Yes | Table ID |
| `rowId` | string | Yes | Row ID to retrieve |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether row was found |
| `row` | object | Row data |
| `message` | string | Status message |

### `table_get_schema`

Get the schema definition for a table

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `tableId` | string | Yes | Table ID |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether schema was retrieved |
| `name` | string | Table name |
| `columns` | array | Array of column definitions |
| `message` | string | Status message |

## Filter Operators

Filters use MongoDB-style operators for flexible querying:

| Operator | Description | Example |
|----------|-------------|---------|
| `$eq` | Equals | `{"status": {"$eq": "active"}}` or `{"status": "active"}` |
| `$ne` | Not equals | `{"status": {"$ne": "deleted"}}` |
| `$gt` | Greater than | `{"age": {"$gt": 18}}` |
| `$gte` | Greater than or equal | `{"score": {"$gte": 80}}` |
| `$lt` | Less than | `{"price": {"$lt": 100}}` |
| `$lte` | Less than or equal | `{"quantity": {"$lte": 10}}` |
| `$in` | In array | `{"status": {"$in": ["active", "pending"]}}` |
| `$nin` | Not in array | `{"type": {"$nin": ["spam", "blocked"]}}` |
| `$contains` | String contains | `{"email": {"$contains": "@gmail.com"}}` |

### Combining Filters

Multiple field conditions are combined with AND logic:

```json
{
"status": "active",
"age": {"$gte": 18}
}
```

Use `$or` for OR logic:

```json
{
"$or": [
{"status": "active"},
{"status": "pending"}
]
}
```

## Sort Specification

Specify sort order with column names and direction:

```json
{
"createdAt": "desc"
}
```

Multi-column sorting:

```json
{
"priority": "desc",
"name": "asc"
}
```

## Built-in Columns

Every row automatically includes:

| Column | Type | Description |
|--------|------|-------------|
| `id` | string | Unique row identifier |
| `createdAt` | date | When the row was created |
| `updatedAt` | date | When the row was last modified |

These can be used in filters and sorting.

## Limits

| Resource | Limit |
|----------|-------|
| Tables per workspace | 100 |
| Rows per table | 10,000 |
| Columns per table | 50 |
| Max row size | 100KB |
| String value length | 10,000 characters |
| Query limit | 1,000 rows |
| Batch insert size | 1,000 rows |
| Bulk update/delete | 1,000 rows |

## Notes

- Category: `blocks`
- Type: `table`
- Tables are scoped to workspaces and accessible from any workflow within that workspace
- Data persists across workflow executions
- Use unique constraints to enable upsert functionality
- The visual filter/sort builder provides an easy way to construct queries without writing JSON
Loading