Skip to content

Commit 6abcf82

Browse files
feat(workflows): sim trigger, logs v2 block, toolbar renaming (#4941)
* feat(workflows): sim trigger, logs v2 block, toolbar renaming * fix(review): bound rule queries, canonical logs params, watched-workflow SQL scoping Code-review fixes: read the canonical workflowIds param in logs_v2 (the serializer deletes the source pair ids), aggregate failure-rate in the DB and switch rule windows to the indexed startedAt column, clamp rule config to the legacy contract bounds, push no_activity watch scoping into SQL before the LIMIT, fix the generated sim icon-map key, normalize docs wording, and drop dead exports. Co-authored-by: Cursor <cursoragent@cursor.com> * address comments * fix(review): integer rule rounding, success-gated workflow labels, display module hygiene Second-pass review fixes: round integer rule fields so fractional input never reaches SQL LIMIT, gate workflow-name readiness on a successful non-placeholder load in both editor and preview (errored loads mislabeled valid workflows as deleted), lazily read the variables store in preview rows, move the filter-field JSON preview into the shared display module and unexport its single-consumer helpers, and align >= boundary copy (failure rate, error count, cooldown window) with implementation. Co-authored-by: Cursor <cursoragent@cursor.com> * chore: sync lockfile after staging merge Co-authored-by: Cursor <cursoragent@cursor.com> * fix(workspace-events): keyset-paginate the no_activity subscription scan A fixed LIMIT 500 with no ORDER BY silently starved subscriptions beyond the cap once the global count exceeded it. The poll now pages by webhook id so every subscription is visited each cycle; pagination bounds memory, not total work. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(workspace-events): keyset-paginate the watched-workflow scan The 500-row LIMIT silently and deterministically excluded high-id workflows from no_activity coverage in watch-everything subscriptions on large workspaces. The scan now pages by workflow id, mirroring the subscription scan; per-workflow checks move into a helper so the pagination loop stays flat. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(workspace-events): skip no_activity subscriptions on the execution-completion path no_activity is poller-owned and can never fire from a completed execution, but it passed into the rule branch and cost a pointless cooldown point-read per subscription on the hottest path. Early-continue alongside the workflow_deployed guard. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(sim-trigger): note failure-based alert conditions evaluate on failed runs Co-authored-by: Cursor <cursoragent@cursor.com> * fix(blocks): recategorize Data Enrichment as a core block It's a Sim-native capability (registry enrichments over a managed provider cascade, like Search), not a third-party integration. Moves it to Core Blocks in the toolbar, out of the integrations catalog, and relocates its docs page to blocks/ with the icon-map allowlist keeping the docs card icon. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(blocks): recategorize MySQL, PostgreSQL, SFTP, SMTP, SSH as integrations External-system connectors with host/credential auth belong under Integrations, not Core Blocks — consistent with MongoDB, Redis, ClickHouse, and the other datastore integrations. They already carried integrationType and /tools docsLinks; the regenerated docs pages turn those previously-dangling links into real pages, and the blocks join the integrations catalog and icon maps. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 540e608 commit 6abcf82

113 files changed

Lines changed: 22312 additions & 5836 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/docs/components/icons.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6823,6 +6823,29 @@ export function SixtyfourIcon(props: SVGProps<SVGSVGElement>) {
68236823
)
68246824
}
68256825

6826+
export function SimTriggerIcon(props: SVGProps<SVGSVGElement>) {
6827+
return (
6828+
<svg
6829+
{...props}
6830+
viewBox='0 0 222 222'
6831+
fill='none'
6832+
xmlns='http://www.w3.org/2000/svg'
6833+
aria-hidden='true'
6834+
>
6835+
<path
6836+
fillRule='evenodd'
6837+
clipRule='evenodd'
6838+
d='M107.822 93.76C107.822 97.35 106.403 100.792 103.884 103.328L103.523 103.692C101.006 106.236 97.59 107.658 94.02 107.658H13.45C6.02 107.658 0 113.718 0 121.191V208.332C0 215.806 6.02 221.866 13.45 221.866H99.96C107.383 221.866 113.4 215.806 113.4 208.332V126.745C113.4 123.419 114.71 120.228 117.047 117.874C119.377 115.527 122.546 114.207 125.849 114.207H207.777C215.198 114.207 221.214 108.148 221.214 100.674V13.53C221.214 6.06 215.198 0 207.777 0H121.26C113.839 0 107.822 6.06 107.822 13.53V93.76ZM134.078 18.55H194.952C199.289 18.55 202.796 22.09 202.796 26.45V87.76C202.796 92.12 199.289 95.66 194.952 95.66H134.078C129.748 95.66 126.233 92.12 126.233 87.76V26.45C126.233 22.09 129.748 18.55 134.078 18.55Z'
6839+
fill='currentColor'
6840+
/>
6841+
<path
6842+
d='M207.878 129.57H143.554C135.756 129.57 129.434 135.937 129.434 143.791V207.784C129.434 215.638 135.756 222.005 143.554 222.005H207.878C215.677 222.005 221.999 215.638 221.999 207.784V143.791C221.999 135.937 215.677 129.57 207.878 129.57Z'
6843+
fill='currentColor'
6844+
/>
6845+
</svg>
6846+
)
6847+
}
6848+
68266849
export function SimilarwebIcon(props: SVGProps<SVGSVGElement>) {
68276850
return (
68286851
<svg

apps/docs/components/ui/icon-mapping.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ import {
129129
MistralIcon,
130130
MondayIcon,
131131
MongoDBIcon,
132+
MySQLIcon,
132133
Neo4jIcon,
133134
NeverBounceIcon,
134135
NewRelicIcon,
@@ -146,6 +147,7 @@ import {
146147
PineconeIcon,
147148
PipedriveIcon,
148149
PolymarketIcon,
150+
PostgresIcon,
149151
PosthogIcon,
150152
ProfoundIcon,
151153
ProspeoIcon,
@@ -173,11 +175,15 @@ import {
173175
SentryIcon,
174176
SerperIcon,
175177
ServiceNowIcon,
178+
SftpIcon,
176179
ShopifyIcon,
177180
SimilarwebIcon,
181+
SimTriggerIcon,
178182
SixtyfourIcon,
179183
SlackIcon,
184+
SmtpIcon,
180185
SQSIcon,
186+
SshIcon,
181187
STSIcon,
182188
STTIcon,
183189
StagehandIcon,
@@ -355,6 +361,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
355361
mistral_parse_v3: MistralIcon,
356362
monday: MondayIcon,
357363
mongodb: MongoDBIcon,
364+
mysql: MySQLIcon,
358365
neo4j: Neo4jIcon,
359366
neverbounce: NeverBounceIcon,
360367
new_relic: NewRelicIcon,
@@ -373,6 +380,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
373380
pinecone: PineconeIcon,
374381
pipedrive: PipedriveIcon,
375382
polymarket: PolymarketIcon,
383+
postgresql: PostgresIcon,
376384
posthog: PosthogIcon,
377385
profound: ProfoundIcon,
378386
prospeo: ProspeoIcon,
@@ -402,13 +410,17 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
402410
serper: SerperIcon,
403411
servicenow: ServiceNowIcon,
404412
ses: SESIcon,
413+
sftp: SftpIcon,
405414
sharepoint: MicrosoftSharepointIcon,
406415
sharepoint_v2: MicrosoftSharepointIcon,
407416
shopify: ShopifyIcon,
417+
sim_workspace_event: SimTriggerIcon,
408418
similarweb: SimilarwebIcon,
409419
sixtyfour: SixtyfourIcon,
410420
slack: SlackIcon,
421+
smtp: SmtpIcon,
411422
sqs: SQSIcon,
423+
ssh: SshIcon,
412424
stagehand: StagehandIcon,
413425
stripe: StripeIcon,
414426
sts: STSIcon,
File renamed without changes.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: Logs
3+
---
4+
5+
import { Callout } from 'fumadocs-ui/components/callout'
6+
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
7+
import { FAQ } from '@/components/ui/faq'
8+
9+
The Logs block queries workflow run logs in the current workspace and fetches full details for individual runs — the same data you see on the Logs page, available to your workflows.
10+
11+
## Operations
12+
13+
<Tabs items={['Query Logs', 'Get Run Details']}>
14+
<Tab>
15+
<p>Find runs matching a set of filters. Returns only the matching <strong>run IDs</strong>, ordered newest-first by default.</p>
16+
<ul className="list-disc space-y-1 pl-6">
17+
<li><strong>Workflows</strong>: select specific workflows, or leave empty for all (comma-separated IDs in advanced mode)</li>
18+
<li><strong>Status</strong>: info, error, running, pending, cancelled (empty for all)</li>
19+
<li><strong>Time Range</strong>: presets from the past 30 minutes to the past 30 days, or explicit ISO start/end dates in advanced mode</li>
20+
<li><strong>Cost</strong>: compare run cost against a credit threshold (e.g. ≥ 10 credits)</li>
21+
<li><strong>Duration</strong>: compare run duration against a millisecond threshold</li>
22+
<li><strong>Limit</strong>: maximum run IDs to return (default 100, max 200)</li>
23+
</ul>
24+
</Tab>
25+
<Tab>
26+
<p>Fetch everything about a single run by its run ID:</p>
27+
<ul className="list-disc space-y-1 pl-6">
28+
<li><strong>runId</strong>, <strong>workflowId</strong>, <strong>workflowName</strong></li>
29+
<li><strong>status</strong>, <strong>trigger</strong>, <strong>startedAt</strong>, <strong>durationMs</strong></li>
30+
<li><strong>cost</strong>: run cost in credits</li>
31+
<li><strong>traceSpans</strong>: the full trace — per-block inputs, outputs, timings, and tool calls</li>
32+
<li><strong>finalOutput</strong>: the run's final output</li>
33+
</ul>
34+
</Tab>
35+
</Tabs>
36+
37+
## Typical Pattern
38+
39+
Query for the runs you care about, then loop over the returned IDs and fetch details for each:
40+
41+
1. **Query Logs** with `Status: error` and `Time Range: Past 24 hours``<logs1.runIds>`
42+
2. Loop over the IDs and call **Get Run Details** → inspect `<logs2.traceSpans>` to find the failing block
43+
3. Act on it — post a summary to Slack, file a ticket, or feed the trace to an Agent block for diagnosis
44+
45+
This pairs naturally with the [Sim trigger](/triggers/sim): the trigger hands you the `runId` that fired the event, and Get Run Details gives you the full trace.
46+
47+
<Callout type="info">
48+
The block always operates on the current workspace. Costs are denominated in credits, both for
49+
the cost filter and the cost output.
50+
</Callout>
51+
52+
<FAQ items={[
53+
{ question: "Why does Query Logs only return run IDs?", answer: "To keep payloads small and predictable. Run summaries can be large — fetch only the runs you actually need with Get Run Details." },
54+
{ question: "Can I query logs from another workspace?", answer: "No. The block is scoped to the workspace the workflow lives in." },
55+
{ question: "What are trace spans?", answer: "The execution trace for a run: every block that ran, its inputs and outputs, timings, and any tool calls — the same data shown in the Logs page trace view." },
56+
{ question: "How far back can I query?", answer: "As far as your plan's log retention. Free plans retain logs for 7 days; paid plans retain them indefinitely." },
57+
]} />

apps/docs/content/docs/en/blocks/meta.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
"api",
66
"condition",
77
"credential",
8+
"enrichment",
89
"evaluator",
910
"function",
1011
"guardrails",
1112
"human-in-the-loop",
1213
"knowledge",
14+
"logs",
1315
"loop",
1416
"parallel",
1517
"response",

0 commit comments

Comments
 (0)