Skip to content

Commit 147ac89

Browse files
feat(docs): fill documentation gaps across platform features (#4110)
* feat(docs): fill documentation gaps across platform features * fix(docs): address PR review comments on chat OTP cookies and MCP env var placeholders * fix(docs): replace smart quotes with straight quotes in JSX attributes * update(docs): update mcp, custom tools, and variables docs * Fix grammar * mothership docs, tags, connectors, api, chat deploy, etc * more info * more * feat(docs): auto-generate per-provider trigger documentation Extends scripts/generate-docs.ts to produce one MDX page per trigger provider (39 pages) in apps/docs/content/docs/en/triggers/. The 5 hand-written pages (index, start, schedule, webhook, rss) are never touched. Key additions to the generation script: - resolveConstVariable() resolves module-level const spreads so providers like Vercel that build outputs from const variables (not just functions) are fully documented - resolveTriggerBuilderFunction() extended to expand variable spreads (...varName) in addition to function-call spreads (...fn()) - groupTriggersByProvider() deduplicates v1/v2 trigger variants by name, keeping the highest-versioned one per provider - writeIconMapping() adds bare-name aliases for versioned block types (github_v2 → github, fireflies_v2 → fireflies, etc.) so BlockInfoCard resolves icons for all 39 trigger providers - extractTriggerConfigFields() filters readOnly display blocks (webhook URL displays, sample payloads, curl examples) from config tables Each generated page includes: BlockInfoCard with correct icon/color, trigger count, polling note where applicable, Configuration table, and Output table for every trigger. No "Type:" lines. * refactor(docs): align trigger docs structure with tools docs - Use ### `trigger_id` headings (matching ### `tool_id` in tools docs) - Wrap all trigger sections under a ## Triggers header - Rename Configuration/Output to #### level (matching #### Input/Output) - Use Parameter column header to match tools docs table style - Map UI widget types to semantic types: short-input/long-input/dropdown → string, switch → boolean, slider → number, oauth-input → string * refactor(docs): use human-readable names for trigger section headings Trigger IDs are internal identifiers; users scan by name. Switch from ### `trigger_id` to ### Trigger Name for cleaner sidebar navigation and better readability. * fix(docs): resolve subBlock builder functions for all trigger Config sections Extends generate-docs.ts to parse subBlock builder functions so all 15 providers previously missing Configuration sections now generate them. Handles three patterns: - `buildTriggerSubBlocks({extraFields: buildX(...)})` — extracts extra fields from the call site and resolves them from the provider's utils.ts - `return [...]` — direct array return (Attio, Confluence, etc.) - `blocks.push(...)` — imperative push pattern (Linear, Ashby) Also resolves const-reference field IDs (SCREAMING_CASE) by searching the webhook provider constants cache, fixing Gong's `gongJwtPublicKeyPem` field which was previously unresolvable. Adds title-as-description fallback for OAuth credential fields that have no explicit description. * fix(docs): correctly destructure nested implicit-object trigger outputs Fixes a parser bug where output fields with no top-level `type` key but child fields each having their own `type`/`description` were incorrectly parsed. The `type:` and `description:` regex matches were not depth-aware, so values from nested children bled into the parent field. Changes: - Add `isAtDepthZero()` helper for brace-depth-aware regex matching - Fix `parseFieldContent` to only match `type:` at brace depth 0 - Fix `extractDescription` to only match `description:` at brace depth 0 - Add implicit-object fallback: when no top-level `type` exists but child fields have their own types, treat as `object` with `properties` - Regenerate all affected trigger docs (Cal.com payload, Linear data, Jira issue.fields, Ashby application, Greenhouse candidate, etc.) * chore(docs): update static trigger and start page images * feat(providers): add claude-opus-4-7 model with adaptive thinking support * Add workflow version screenshots * Add function block screenshots --------- Co-authored-by: Theodore Li <theo@sim.ai>
1 parent 4cdc941 commit 147ac89

File tree

126 files changed

+12442
-564
lines changed

Some content is hidden

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

126 files changed

+12442
-564
lines changed

apps/docs/app/[lang]/not-found.tsx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { DocsBody, DocsPage } from 'fumadocs-ui/page'
1+
import { DocsPage } from 'fumadocs-ui/page'
2+
import Link from 'next/link'
23

34
export const metadata = {
45
title: 'Page Not Found',
@@ -7,17 +8,21 @@ export const metadata = {
78
export default function NotFound() {
89
return (
910
<DocsPage>
10-
<DocsBody>
11-
<div className='flex min-h-[60vh] flex-col items-center justify-center text-center'>
12-
<h1 className='mb-4 bg-gradient-to-b from-[#47d991] to-[#33c482] bg-clip-text font-bold text-8xl text-transparent'>
13-
404
14-
</h1>
15-
<h2 className='mb-2 font-semibold text-2xl text-foreground'>Page Not Found</h2>
16-
<p className='text-muted-foreground'>
17-
The page you're looking for doesn't exist or has been moved.
18-
</p>
19-
</div>
20-
</DocsBody>
11+
<div className='flex min-h-[70vh] flex-col items-center justify-center gap-4 text-center'>
12+
<h1 className='bg-gradient-to-b from-[#47d991] to-[#33c482] bg-clip-text font-bold text-8xl text-transparent'>
13+
404
14+
</h1>
15+
<h2 className='font-semibold text-2xl text-foreground'>Page Not Found</h2>
16+
<p className='text-muted-foreground'>
17+
The page you're looking for doesn't exist or has been moved.
18+
</p>
19+
<Link
20+
href='/'
21+
className='ml-1 flex items-center rounded-[8px] bg-[#33c482] px-2.5 py-1.5 text-[13px] text-white transition-colors duration-200 hover:bg-[#2DAC72]'
22+
>
23+
Go home
24+
</Link>
25+
</div>
2126
</DocsPage>
2227
)
2328
}

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,10 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
226226
cloudflare: CloudflareIcon,
227227
cloudformation: CloudFormationIcon,
228228
cloudwatch: CloudWatchIcon,
229+
confluence: ConfluenceIcon,
229230
confluence_v2: ConfluenceIcon,
230231
crowdstrike: CrowdStrikeIcon,
232+
cursor: CursorIcon,
231233
cursor_v2: CursorIcon,
232234
dagster: DagsterIcon,
233235
databricks: DatabricksIcon,
@@ -245,19 +247,25 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
245247
enrich: EnrichSoIcon,
246248
evernote: EvernoteIcon,
247249
exa: ExaAIIcon,
250+
extend: ExtendIcon,
248251
extend_v2: ExtendIcon,
249252
fathom: FathomIcon,
253+
file: DocumentIcon,
250254
file_v3: DocumentIcon,
251255
firecrawl: FirecrawlIcon,
256+
fireflies: FirefliesIcon,
252257
fireflies_v2: FirefliesIcon,
253258
gamma: GammaIcon,
259+
github: GithubIcon,
254260
github_v2: GithubIcon,
255261
gitlab: GitLabIcon,
262+
gmail: GmailIcon,
256263
gmail_v2: GmailIcon,
257264
gong: GongIcon,
258265
google_ads: GoogleAdsIcon,
259266
google_bigquery: GoogleBigQueryIcon,
260267
google_books: GoogleBooksIcon,
268+
google_calendar: GoogleCalendarIcon,
261269
google_calendar_v2: GoogleCalendarIcon,
262270
google_contacts: GoogleContactsIcon,
263271
google_docs: GoogleDocsIcon,
@@ -268,7 +276,9 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
268276
google_meet: GoogleMeetIcon,
269277
google_pagespeed: GooglePagespeedIcon,
270278
google_search: GoogleIcon,
279+
google_sheets: GoogleSheetsIcon,
271280
google_sheets_v2: GoogleSheetsIcon,
281+
google_slides: GoogleSlidesIcon,
272282
google_slides_v2: GoogleSlidesIcon,
273283
google_tasks: GoogleTasksIcon,
274284
google_translate: GoogleTranslateIcon,
@@ -287,16 +297,19 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
287297
imap: MailServerIcon,
288298
incidentio: IncidentioIcon,
289299
infisical: InfisicalIcon,
300+
intercom: IntercomIcon,
290301
intercom_v2: IntercomIcon,
291302
jina: JinaAIIcon,
292303
jira: JiraIcon,
293304
jira_service_management: JiraServiceManagementIcon,
305+
kalshi: KalshiIcon,
294306
kalshi_v2: KalshiIcon,
295307
ketch: KetchIcon,
296308
knowledge: PackageSearchIcon,
297309
langsmith: LangsmithIcon,
298310
launchdarkly: LaunchDarklyIcon,
299311
lemlist: LemlistIcon,
312+
linear: LinearIcon,
300313
linear_v2: LinearIcon,
301314
linkedin: LinkedInIcon,
302315
linkup: LinkupIcon,
@@ -308,13 +321,16 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
308321
memory: BrainIcon,
309322
microsoft_ad: AzureIcon,
310323
microsoft_dataverse: MicrosoftDataverseIcon,
324+
microsoft_excel: MicrosoftExcelIcon,
311325
microsoft_excel_v2: MicrosoftExcelIcon,
312326
microsoft_planner: MicrosoftPlannerIcon,
313327
microsoft_teams: MicrosoftTeamsIcon,
328+
mistral_parse: MistralIcon,
314329
mistral_parse_v3: MistralIcon,
315330
mongodb: MongoDBIcon,
316331
mysql: MySQLIcon,
317332
neo4j: Neo4jIcon,
333+
notion: NotionIcon,
318334
notion_v2: NotionIcon,
319335
obsidian: ObsidianIcon,
320336
okta: OktaIcon,
@@ -331,12 +347,14 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
331347
postgresql: PostgresIcon,
332348
posthog: PosthogIcon,
333349
profound: ProfoundIcon,
350+
pulse: PulseIcon,
334351
pulse_v2: PulseIcon,
335352
qdrant: QdrantIcon,
336353
quiver: QuiverIcon,
337354
rds: RDSIcon,
338355
reddit: RedditIcon,
339356
redis: RedisIcon,
357+
reducto: ReductoIcon,
340358
reducto_v2: ReductoIcon,
341359
resend: ResendIcon,
342360
revenuecat: RevenueCatIcon,
@@ -362,11 +380,13 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
362380
stagehand: StagehandIcon,
363381
stripe: StripeIcon,
364382
sts: STSIcon,
383+
stt: STTIcon,
365384
stt_v2: STTIcon,
366385
supabase: SupabaseIcon,
367386
tailscale: TailscaleIcon,
368387
tavily: TavilyIcon,
369388
telegram: TelegramIcon,
389+
textract: TextractIcon,
370390
textract_v2: TextractIcon,
371391
tinybird: TinybirdIcon,
372392
translate: TranslateIcon,
@@ -377,7 +397,9 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
377397
typeform: TypeformIcon,
378398
upstash: UpstashIcon,
379399
vercel: VercelIcon,
400+
video_generator: VideoIcon,
380401
video_generator_v2: VideoIcon,
402+
vision: EyeIcon,
381403
vision_v2: EyeIcon,
382404
wealthbox: WealthboxIcon,
383405
webflow: WebflowIcon,

apps/docs/content/docs/en/blocks/function.mdx

Lines changed: 119 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
title: Function
33
---
44

5+
import { Callout } from 'fumadocs-ui/components/callout'
6+
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
57
import { Image } from '@/components/ui/image'
68
import { FAQ } from '@/components/ui/faq'
79

8-
The Function block executes custom JavaScript or TypeScript code in your workflows. Transform data, perform calculations, or implement custom logic.
10+
The Function block executes custom JavaScript, TypeScript, or Python code in your workflows. Transform data, perform calculations, or implement custom logic.
911

1012
<div className="flex justify-center">
1113
<Image
@@ -41,6 +43,8 @@ Input → Function (Validate & Sanitize) → API (Save to Database)
4143

4244
### Example: Loyalty Score Calculator
4345

46+
<Tabs items={['JavaScript', 'Python']}>
47+
<Tab value="JavaScript">
4448
```javascript title="loyalty-calculator.js"
4549
// Process customer data and calculate loyalty score
4650
const { purchaseHistory, accountAge, supportTickets } = <agent>;
@@ -64,6 +68,120 @@ return {
6468
metrics: { spendScore, frequencyScore, supportScore }
6569
};
6670
```
71+
</Tab>
72+
<Tab value="Python">
73+
```python title="loyalty-calculator.py"
74+
import json
75+
76+
# Reference outputs from other blocks using angle bracket syntax
77+
data = json.loads('<agent>')
78+
purchase_history = data["purchaseHistory"]
79+
account_age = data["accountAge"]
80+
support_tickets = data["supportTickets"]
81+
82+
# Calculate metrics
83+
total_spent = sum(p["amount"] for p in purchase_history)
84+
purchase_frequency = len(purchase_history) / (account_age / 365)
85+
ticket_ratio = support_tickets["resolved"] / support_tickets["total"]
86+
87+
# Calculate loyalty score (0-100)
88+
spend_score = min(total_spent / 1000 * 30, 30)
89+
frequency_score = min(purchase_frequency * 20, 40)
90+
support_score = ticket_ratio * 30
91+
92+
loyalty_score = round(spend_score + frequency_score + support_score)
93+
94+
tier = "Platinum" if loyalty_score >= 80 else "Gold" if loyalty_score >= 60 else "Silver"
95+
96+
result = {
97+
"customer": data["name"],
98+
"loyaltyScore": loyalty_score,
99+
"loyaltyTier": tier,
100+
"metrics": {
101+
"spendScore": spend_score,
102+
"frequencyScore": frequency_score,
103+
"supportScore": support_score
104+
}
105+
}
106+
print(json.dumps(result))
107+
```
108+
</Tab>
109+
</Tabs>
110+
111+
## Python Support
112+
113+
The Function block supports Python as an alternative to JavaScript. Python code runs in a secure [E2B](https://e2b.dev) cloud sandbox.
114+
115+
<div className="flex justify-center">
116+
<Image
117+
src="/static/blocks/function-python.png"
118+
alt="Function block with Python selected"
119+
width={400}
120+
height={500}
121+
className="my-6"
122+
/>
123+
</div>
124+
125+
### Enabling Python
126+
127+
Select **Python** from the language dropdown in the Function block. Python execution requires E2B to be enabled on your Sim instance.
128+
129+
<Callout type="warn">
130+
If you don't see Python as an option in the language dropdown, E2B is not enabled. This only applies to self-hosted instances — E2B is enabled by default on sim.ai.
131+
</Callout>
132+
133+
<Callout type="info">
134+
Python code always runs in the E2B sandbox, even for simple scripts without imports. This ensures a secure, isolated execution environment.
135+
</Callout>
136+
137+
### Returning Results
138+
139+
In Python, print your result as JSON to stdout. The Function block captures stdout and makes it available via `<function.result>`:
140+
141+
```python title="example.py"
142+
import json
143+
144+
data = {"status": "processed", "count": 42}
145+
print(json.dumps(data))
146+
```
147+
148+
### Available Libraries
149+
150+
The E2B sandbox includes the Python standard library (`json`, `re`, `datetime`, `math`, `os`, `collections`, etc.) and common packages like `matplotlib` for visualization. Charts generated with matplotlib are captured as images automatically.
151+
152+
<Callout type="info">
153+
The exact set of pre-installed packages depends on the E2B sandbox configuration. If a package you need isn't available, consider calling an external API from your code instead.
154+
</Callout>
155+
156+
### Matplotlib Charts
157+
158+
When your Python code generates matplotlib figures, they are automatically captured and returned as base64-encoded PNG images in the output:
159+
160+
```python title="chart.py"
161+
import matplotlib.pyplot as plt
162+
import json
163+
164+
data = json.loads('<api.data>')
165+
166+
plt.figure(figsize=(10, 6))
167+
plt.bar(data["labels"], data["values"])
168+
plt.title("Monthly Revenue")
169+
plt.xlabel("Month")
170+
plt.ylabel("Revenue ($)")
171+
plt.savefig("chart.png")
172+
plt.show()
173+
```
174+
175+
{/* TODO: Screenshot of Python code execution output in the logs panel */}
176+
177+
### JavaScript vs. Python
178+
179+
| | JavaScript | Python |
180+
|--|-----------|--------|
181+
| **Execution** | Local VM (fast) or E2B sandbox (with imports) | Always E2B sandbox |
182+
| **Returning results** | `return { ... }` | `print(json.dumps({ ... }))` |
183+
| **HTTP requests** | `fetch()` built-in | `requests` or `httpx` |
184+
| **Best for** | Quick transforms, JSON manipulation | Data science, charting, complex math |
67185

68186
## Best Practices
69187

0 commit comments

Comments
 (0)