Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
4c86122
fix(table): return 400 instead of 500 for malformed sort/filter input…
waleedlatif1 May 4, 2026
af8dfbd
fix(knowledge): revert column width multipliers that misaligned Name …
waleedlatif1 May 4, 2026
5d53847
fix(executor): strip childTraceSpans from block state before LLM tool…
waleedlatif1 May 4, 2026
57dc745
feat(knowledge): expose Cohere reranker controls (#4429)
waleedlatif1 May 4, 2026
3af6c25
fix(mothership): catch draft restore errors instead of crashing /home…
waleedlatif1 May 4, 2026
578fc50
fix(mothership): stop persisting log resources from get_workflow_logs…
waleedlatif1 May 4, 2026
2f90e41
feat(mothership): restore attachment previews on draft and add video …
waleedlatif1 May 4, 2026
ae20d1c
fix(copilot): redact sim_key API keys from persisted Mothership chat …
TheodoreSpeaks May 4, 2026
6d044a9
feat(image-generator): add gpt-image-2 model support (#4437)
waleedlatif1 May 4, 2026
029ac9f
fix(logs): split summary/detail contracts to make trace tab gate type…
waleedlatif1 May 4, 2026
1dc6f7d
fix: double wrap reponse of guest session handler (#4438)
stylessh May 4, 2026
9eeb1b2
improvement(mothership): streaming state transitions (#4439)
icecrasher321 May 4, 2026
1166d82
feat(logs): add Logs block for querying execution logs from workflows…
TheodoreSpeaks May 5, 2026
51addc5
fix(terminal): use wall-clock duration for loop iterations with concu…
waleedlatif1 May 5, 2026
e14a3a5
fix(tables): suppress phantom rows on sort, center gutter numbers, st…
waleedlatif1 May 5, 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
14 changes: 8 additions & 6 deletions apps/docs/content/docs/en/tools/image_generator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ In Sim, the DALL-E integration enables your agents to generate images programmat

## Usage Instructions

Integrate Image Generator into the workflow. Can generate images using DALL-E 3 or GPT Image.
Integrate Image Generator into the workflow. Can generate images using DALL-E 3, GPT Image 1, or GPT Image 2.



Expand All @@ -43,12 +43,14 @@ Generate images using OpenAI

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `model` | string | Yes | The model to use \(gpt-image-1 or dall-e-3\) |
| `model` | string | Yes | The model to use \(dall-e-3, gpt-image-1, or gpt-image-2\) |
| `prompt` | string | Yes | A text description of the desired image |
| `size` | string | Yes | The size of the generated images \(1024x1024, 1024x1792, or 1792x1024\) |
| `quality` | string | No | The quality of the image \(standard or hd\) |
| `style` | string | No | The style of the image \(vivid or natural\) |
| `background` | string | No | The background color, only for gpt-image-1 |
| `size` | string | Yes | Image size. dall-e-3: 1024x1024, 1024x1792, or 1792x1024. gpt-image-1: auto, 1024x1024, 1536x1024, or 1024x1536. gpt-image-2: auto or any size with edges ≤3840px and multiples of 16 \(e.g. 1024x1024, 1536x1024, 1024x1536, 2560x1440, 3840x2160\). |
| `quality` | string | No | Quality. dall-e-3: standard\|hd. gpt-image-1/gpt-image-2: auto\|low\|medium\|high |
| `style` | string | No | The style of the image \(vivid or natural\), only for dall-e-3 |
| `background` | string | No | Background. gpt-image-1: auto\|transparent\|opaque. gpt-image-2: auto\|opaque \(transparent not supported\) |
| `outputFormat` | string | No | Output image format \(png, jpeg, webp\), only for gpt-image-1 and gpt-image-2 |
| `moderation` | string | No | Moderation level \(auto or low\), only for gpt-image-1 and gpt-image-2 |
| `n` | number | No | The number of images to generate \(1-10\) |
| `apiKey` | string | Yes | Your OpenAI API key |

Expand Down
2 changes: 2 additions & 0 deletions apps/docs/content/docs/en/tools/knowledge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ Search for similar content in a knowledge base using vector similarity
| `tagValue` | string | No | No description |
| `rerankerEnabled` | boolean | No | Whether to apply Cohere reranking to vector search results |
| `rerankerModel` | string | No | Cohere rerank model to use \(one of: rerank-v4.0-pro, rerank-v4.0-fast, rerank-v3.5\) |
| `rerankerInputCount` | number | No | Number of vector results sent to the Cohere reranker \(1–100\). Defaults to topK × 4 capped at 100. |
| `apiKey` | string | No | Cohere API key for reranker \(self-hosted deployments only\) |
| `tagFilters` | string | No | No description |

#### Output
Expand Down
17 changes: 7 additions & 10 deletions apps/docs/content/docs/en/tools/mem0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,9 @@ Add memories to Mem0 for persistent storage and retrieval

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `ids` | array | Array of memory IDs that were created |
| `memories` | array | Array of memory objects that were created |
| ↳ `id` | string | Unique identifier for the memory |
| ↳ `memory` | string | The content of the memory |
| ↳ `event` | string | Event type indicating operation performed \(ADD, UPDATE, DELETE, NOOP\) |
| ↳ `metadata` | json | Custom metadata associated with the memory |
| `message` | string | Status message for the queued memory processing job |
| `status` | string | Processing status returned by Mem0 |
| `event_id` | string | Event ID for polling memory processing status |

### `mem0_search_memories`

Expand Down Expand Up @@ -102,6 +99,7 @@ Retrieve memories from Mem0 by ID or filter criteria
| `startDate` | string | No | Start date for filtering by created_at \(e.g., "2024-01-15"\) |
| `endDate` | string | No | End date for filtering by created_at \(e.g., "2024-12-31"\) |
| `limit` | number | No | Maximum number of results to return \(e.g., 10, 50, 100\) |
| `page` | number | No | Page number to retrieve for paginated list results |
| `apiKey` | string | Yes | Your Mem0 API key |

#### Output
Expand All @@ -120,10 +118,9 @@ Retrieve memories from Mem0 by ID or filter criteria
| ↳ `categories` | json | Auto-assigned categories for the memory |
| ↳ `created_at` | string | ISO 8601 timestamp when the memory was created |
| ↳ `updated_at` | string | ISO 8601 timestamp when the memory was last updated |
| ↳ `owner` | string | Owner of the memory |
| ↳ `organization` | string | Organization associated with the memory |
| ↳ `immutable` | boolean | Whether the memory can be modified |
| ↳ `expiration_date` | string | Expiration date after which memory is not retrieved |
| `ids` | array | Array of memory IDs that were retrieved |
| `count` | number | Total number of memories matching the filters |
| `next` | string | URL for the next page of results |
| `previous` | string | URL for the previous page of results |


1 change: 1 addition & 0 deletions apps/docs/content/docs/en/triggers/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"servicenow",
"slack",
"stripe",
"table",
"telegram",
"twilio_voice",
"typeform",
Expand Down
45 changes: 45 additions & 0 deletions apps/docs/content/docs/en/triggers/table.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: Table
description: Available Table triggers for automating workflows
---

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

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

Table provides 1 trigger for automating workflows based on events.

## Triggers

### Table Trigger

Triggers when rows are inserted or updated in a table

#### Configuration

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `tableSelector` | table-selector | Yes | The table to monitor. |
| `manualTableId` | string | Yes | The table to monitor. |
| `eventType` | string | Yes | The type of event to trigger on. |
| `watchColumns` | string | No | Only fire when these columns change. Leave empty to fire on any update. |
| `includeHeaders` | boolean | No | When enabled, each row is returned as a key-value object mapped to column names. |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `row` | json | Row data mapped to column names \(when header mapping is enabled\) |
| `rawRow` | json | Raw row data object |
| `previousRow` | json | Previous row data before the update \(null for inserts\) |
| `changedColumns` | json | List of column names that changed \(empty for inserts\) |
| `rowId` | string | The unique row ID |
| `headers` | json | Column names from the table schema |
| `rowNumber` | number | The position of the row in the table |
| `tableId` | string | The table ID |
| `tableName` | string | The table name |
| `timestamp` | string | Event timestamp in ISO format |

2 changes: 2 additions & 0 deletions apps/sim/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ API_ENCRYPTION_KEY=your_api_encryption_key # Use `openssl rand -hex 32` to gener
# AZURE_ANTHROPIC_API_KEY= # Azure Anthropic API key
# AZURE_ANTHROPIC_API_VERSION= # Azure Anthropic API version (e.g., 2023-06-01)
# NEXT_PUBLIC_AZURE_CONFIGURED=true # Set when Azure credentials are pre-configured above. Hides endpoint/key/version fields in Agent block UI.
# COHERE_API_KEY= # Cohere API key for the Knowledge block reranker (rerank-v4.0-pro/-fast, rerank-v3.5). Alternatively set COHERE_API_KEY_1/2/3 for rotation.
# NEXT_PUBLIC_COHERE_CONFIGURED=true # Set when COHERE_API_KEY (or rotation keys) are pre-configured above. Hides the Cohere API Key field on the Knowledge block UI.

# Admin API (Optional - for self-hosted GitOps)
# ADMIN_API_KEY= # Use `openssl rand -hex 32` to generate. Enables admin API for workflow export/import.
Expand Down
4 changes: 2 additions & 2 deletions apps/sim/app/(landing)/integrations/data/integrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -6496,7 +6496,7 @@
"slug": "image-generator",
"name": "Image Generator",
"description": "Generate images",
"longDescription": "Integrate Image Generator into the workflow. Can generate images using DALL-E 3 or GPT Image.",
"longDescription": "Integrate Image Generator into the workflow. Can generate images using DALL-E 3, GPT Image 1, or GPT Image 2.",
"bgColor": "#4D5FFF",
"iconName": "ImageIcon",
"docsUrl": "https://docs.sim.ai/tools/image_generator",
Expand Down Expand Up @@ -7540,7 +7540,7 @@
"operationCount": 14,
"triggers": [],
"triggerCount": 0,
"authType": "none",
"authType": "api-key",
"category": "blocks"
},
{
Expand Down
16 changes: 6 additions & 10 deletions apps/sim/app/api/auth/[...all]/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ const handlerMocks = vi.hoisted(() => ({
betterAuthGET: vi.fn(),
betterAuthPOST: vi.fn(),
ensureAnonymousUserExists: vi.fn(),
createAnonymousGetSessionResponse: vi.fn(() => ({
data: {
user: { id: 'anon' },
session: { id: 'anon-session' },
},
createAnonymousSession: vi.fn(() => ({
user: { id: 'anon' },
session: { id: 'anon-session' },
})),
isAuthDisabled: false,
}))
Expand All @@ -30,7 +28,7 @@ vi.mock('@/lib/auth', () => ({

vi.mock('@/lib/auth/anonymous', () => ({
ensureAnonymousUserExists: handlerMocks.ensureAnonymousUserExists,
createAnonymousGetSessionResponse: handlerMocks.createAnonymousGetSessionResponse,
createAnonymousSession: handlerMocks.createAnonymousSession,
}))

vi.mock('@/lib/core/config/feature-flags', () => ({
Expand Down Expand Up @@ -63,10 +61,8 @@ describe('auth catch-all route (DISABLE_AUTH get-session)', () => {
expect(handlerMocks.ensureAnonymousUserExists).toHaveBeenCalledTimes(1)
expect(handlerMocks.betterAuthGET).not.toHaveBeenCalled()
expect(json).toEqual({
data: {
user: { id: 'anon' },
session: { id: 'anon-session' },
},
user: { id: 'anon' },
session: { id: 'anon-session' },
})
})

Expand Down
4 changes: 2 additions & 2 deletions apps/sim/app/api/auth/[...all]/route.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { toNextJsHandler } from 'better-auth/next-js'
import { type NextRequest, NextResponse } from 'next/server'
import { auth } from '@/lib/auth'
import { createAnonymousGetSessionResponse, ensureAnonymousUserExists } from '@/lib/auth/anonymous'
import { createAnonymousSession, ensureAnonymousUserExists } from '@/lib/auth/anonymous'
import { isAuthDisabled } from '@/lib/core/config/feature-flags'
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'

Expand All @@ -24,7 +24,7 @@ export const GET = withRouteHandler(async (request: NextRequest) => {

if (path === 'get-session' && isAuthDisabled) {
await ensureAnonymousUserExists()
return NextResponse.json(createAnonymousGetSessionResponse())
return NextResponse.json(createAnonymousSession())
}

return betterAuthGET(request)
Expand Down
11 changes: 11 additions & 0 deletions apps/sim/app/api/copilot/chat/stop/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ const {
mockSql: vi.fn((strings: TemplateStringsArray, ...values: unknown[]) => ({ strings, values })),
}))

vi.mock('@sim/db/schema', () => ({
copilotChats: {
id: 'copilotChats.id',
userId: 'copilotChats.userId',
workspaceId: 'copilotChats.workspaceId',
messages: 'copilotChats.messages',
conversationId: 'copilotChats.conversationId',
},
}))

vi.mock('@sim/db', () => ({
db: {
select: mockSelect,
Expand Down Expand Up @@ -140,6 +150,7 @@ describe('copilot chat stop route', () => {
workspaceId: 'ws-1',
chatId: 'chat-1',
type: 'completed',
streamId: 'stream-1',
})
})
})
1 change: 1 addition & 0 deletions apps/sim/app/api/copilot/chat/stop/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export const POST = withRouteHandler((req: NextRequest) =>
workspaceId: updated.workspaceId,
chatId,
type: 'completed',
streamId,
})
}

Expand Down
1 change: 1 addition & 0 deletions apps/sim/app/api/copilot/chat/stream/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ async function handleResumeRequestBody({
events: batchEvents,
previewSessions,
status: run.status,
...(run.chatId ? { chatId: run.chatId } : {}),
})
}

Expand Down
25 changes: 21 additions & 4 deletions apps/sim/app/api/knowledge/search/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,21 @@ export const POST = withRouteHandler(async (request: NextRequest) => {

const hasFilters = structuredFilters && structuredFilters.length > 0

/** Oversample candidates when reranking so the reranker has more to choose from.
* Cap at 100 to bound Cohere request cost (1 search unit = ≤100 docs). */
const candidateTopK = useReranker ? Math.min(100, validatedData.topK * 4) : validatedData.topK
/** Oversample vector results when reranking so the reranker has more to choose from.
* Cap at 100 to bound Cohere request cost (1 search unit = ≤100 docs). When the caller
* supplies `rerankerInputCount`, honor it but never let it drop below `topK`
* (which would defeat the purpose) or exceed 100 (which would split into >1 search units). */
const rawInputCount = validatedData.rerankerInputCount
if (useReranker && rawInputCount !== undefined && rawInputCount < validatedData.topK) {
logger.warn(
`[${requestId}] rerankerInputCount (${rawInputCount}) is below topK (${validatedData.topK}); raising to topK`
)
}
const candidateTopK = useReranker
? rawInputCount !== undefined
? Math.min(100, Math.max(validatedData.topK, rawInputCount))
: Math.min(100, validatedData.topK * 4)
: validatedData.topK

if (!hasQuery && hasFilters) {
results = await handleTagOnlySearch({
Expand Down Expand Up @@ -300,7 +312,12 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
const { results: ranked, isBYOK } = await rerank(
validatedData.query!,
results.map((r) => ({ id: r.id, text: r.content })),
{ model: rerankerModel, topN: validatedData.topK, workspaceId }
{
model: rerankerModel,
topN: validatedData.topK,
workspaceId,
apiKey: validatedData.rerankerApiKey,
}
)
rerankBilled = true
rerankIsBYOK = isBYOK
Expand Down
Loading
Loading