Skip to content

Commit 9f41736

Browse files
authored
fix(misc): remove duplicate docs page, update clopus 4.7 (#4200)
* fix(misc): remove duplicate docs page, update clopus 4.7 * fix(docs): consolidate duplicate docs and fix SDK API signatures - Remove duplicate custom-tools page (custom-tools/index.mdx → tools/custom-tools.mdx is canonical) - Remove comparison table from custom-tools per product preference - Fix permissions inconsistency: delete now requires Admin across all docs - Consolidate sdks/ into api-reference/ (sdks/ directory deleted) - Fix Python SDK docs: correct param is `input`, not `input_data` - Fix TypeScript SDK docs: correct signature is executeWorkflow(id, input, options) not options-object form - Add FAQ sections to both SDK reference pages * fix(docs): update SDKs card links from /sdks to /api-reference * fix(docs): update /sdks references to /api-reference in llms.txt files
1 parent 147ac89 commit 9f41736

File tree

18 files changed

+55
-1954
lines changed

18 files changed

+55
-1954
lines changed

apps/docs/app/llms.txt/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ ${Object.entries(sections)
6262
6363
- Full documentation content: ${baseUrl}/llms-full.txt
6464
- Individual page content: ${baseUrl}/llms.mdx/[page-path]
65-
- API documentation: ${baseUrl}/sdks/
65+
- API documentation: ${baseUrl}/api-reference/
6666
- Tool integrations: ${baseUrl}/tools/
6767
6868
## Statistics

apps/docs/content/docs/de/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Willkommen bei Sim, einem visuellen Workflow-Builder für KI-Anwendungen. Erstel
5151
<Card title="MCP-Integration" href="/mcp">
5252
Externe Dienste mit dem Model Context Protocol verbinden
5353
</Card>
54-
<Card title="SDKs" href="/sdks">
54+
<Card title="SDKs" href="/api-reference">
5555
Sim in Ihre Anwendungen integrieren
5656
</Card>
5757
</Cards>

apps/docs/content/docs/en/api-reference/python.mdx

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ Execute a workflow with optional input data.
6565
```python
6666
result = client.execute_workflow(
6767
"workflow-id",
68-
input_data={"message": "Hello, world!"},
68+
input={"message": "Hello, world!"},
6969
timeout=30.0 # 30 seconds
7070
)
7171
```
7272

7373
**Parameters:**
7474
- `workflow_id` (str): The ID of the workflow to execute
75-
- `input_data` (dict, optional): Input data to pass to the workflow
75+
- `input` (dict, optional): Input data to pass to the workflow
7676
- `timeout` (float, optional): Timeout in seconds (default: 30.0)
7777
- `stream` (bool, optional): Enable streaming responses (default: False)
7878
- `selected_outputs` (list[str], optional): Block outputs to stream in `blockName.attribute` format (e.g., `["agent1.content"]`)
@@ -144,7 +144,7 @@ Execute a workflow with automatic retry on rate limit errors using exponential b
144144
```python
145145
result = client.execute_with_retry(
146146
"workflow-id",
147-
input_data={"message": "Hello"},
147+
input={"message": "Hello"},
148148
timeout=30.0,
149149
max_retries=3, # Maximum number of retries
150150
initial_delay=1.0, # Initial delay in seconds
@@ -155,7 +155,7 @@ result = client.execute_with_retry(
155155

156156
**Parameters:**
157157
- `workflow_id` (str): The ID of the workflow to execute
158-
- `input_data` (dict, optional): Input data to pass to the workflow
158+
- `input` (dict, optional): Input data to pass to the workflow
159159
- `timeout` (float, optional): Timeout in seconds
160160
- `stream` (bool, optional): Enable streaming responses
161161
- `selected_outputs` (list, optional): Block outputs to stream
@@ -359,7 +359,7 @@ def run_workflow():
359359
# Execute the workflow
360360
result = client.execute_workflow(
361361
"my-workflow-id",
362-
input_data={
362+
input={
363363
"message": "Process this data",
364364
"user_id": "12345"
365365
}
@@ -488,7 +488,7 @@ def execute_async():
488488
# Start async execution
489489
result = client.execute_workflow(
490490
"workflow-id",
491-
input_data={"data": "large dataset"},
491+
input={"data": "large dataset"},
492492
async_execution=True # Execute asynchronously
493493
)
494494

@@ -533,7 +533,7 @@ def execute_with_retry_handling():
533533
# Automatically retries on rate limit
534534
result = client.execute_with_retry(
535535
"workflow-id",
536-
input_data={"message": "Process this"},
536+
input={"message": "Process this"},
537537
max_retries=5,
538538
initial_delay=1.0,
539539
max_delay=60.0,
@@ -615,7 +615,7 @@ def execute_with_streaming():
615615
# Enable streaming for specific block outputs
616616
result = client.execute_workflow(
617617
"workflow-id",
618-
input_data={"message": "Count to five"},
618+
input={"message": "Count to five"},
619619
stream=True,
620620
selected_outputs=["agent1.content"] # Use blockName.attribute format
621621
)
@@ -758,4 +758,15 @@ Configure the client using environment variables:
758758

759759
## License
760760

761-
Apache-2.0
761+
Apache-2.0
762+
763+
import { FAQ } from '@/components/ui/faq'
764+
765+
<FAQ items={[
766+
{ question: "Do I need to deploy a workflow before I can execute it via the SDK?", answer: "Yes. Workflows must be deployed before they can be executed through the SDK. You can use the validate_workflow() method to check whether a workflow is deployed and ready. If it returns False, deploy the workflow from the Sim UI first and create or select an API key during deployment." },
767+
{ question: "What is the difference between sync and async execution?", answer: "Sync execution (the default) blocks until the workflow completes and returns the full result. Async execution (async_execution=True) returns immediately with a task ID that you can poll using get_job_status(). Use async mode for long-running workflows to avoid request timeouts. Async job statuses include queued, processing, completed, failed, and cancelled." },
768+
{ question: "How does the SDK handle rate limiting?", answer: "The SDK provides built-in rate limiting support through the execute_with_retry() method. It uses exponential backoff (1s, 2s, 4s, 8s...) with 25% jitter to avoid thundering herd problems. If the API returns a retry-after header, that value is used instead. You can configure max_retries, initial_delay, max_delay, and backoff_multiplier. Use get_rate_limit_info() to check your current rate limit status." },
769+
{ question: "Can I use the Python SDK as a context manager?", answer: "Yes. The SimStudioClient supports Python's context manager protocol. Use it with the 'with' statement to automatically close the underlying HTTP session when you are done, which is especially useful for scripts that create and discard client instances." },
770+
{ question: "How do I handle different types of errors from the SDK?", answer: "The SDK raises SimStudioError with a code property for API-specific errors. Common error codes are UNAUTHORIZED (invalid API key), TIMEOUT (request timed out), RATE_LIMIT_EXCEEDED (too many requests), USAGE_LIMIT_EXCEEDED (billing limit reached), and EXECUTION_ERROR (workflow failed). Use the error code to implement targeted error handling and recovery logic." },
771+
{ question: "How do I monitor my API usage and remaining quota?", answer: "Use the get_usage_limits() method to check your current usage. It returns sync and async rate limit details (limit, remaining, reset time, whether you are currently limited), plus your current period cost, usage limit, and plan tier. This lets you monitor consumption and alert before hitting limits." },
772+
]} />

apps/docs/content/docs/en/api-reference/typescript.mdx

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,15 @@ new SimStudioClient(config: SimStudioConfig)
7878
Execute a workflow with optional input data.
7979

8080
```typescript
81-
const result = await client.executeWorkflow('workflow-id', {
82-
input: { message: 'Hello, world!' },
81+
const result = await client.executeWorkflow('workflow-id', { message: 'Hello, world!' }, {
8382
timeout: 30000 // 30 seconds
8483
});
8584
```
8685

8786
**Parameters:**
8887
- `workflowId` (string): The ID of the workflow to execute
88+
- `input` (any, optional): Input data to pass to the workflow
8989
- `options` (ExecutionOptions, optional):
90-
- `input` (any): Input data to pass to the workflow
9190
- `timeout` (number): Timeout in milliseconds (default: 30000)
9291
- `stream` (boolean): Enable streaming responses (default: false)
9392
- `selectedOutputs` (string[]): Block outputs to stream in `blockName.attribute` format (e.g., `["agent1.content"]`)
@@ -158,8 +157,7 @@ if (status.status === 'completed') {
158157
Execute a workflow with automatic retry on rate limit errors using exponential backoff.
159158

160159
```typescript
161-
const result = await client.executeWithRetry('workflow-id', {
162-
input: { message: 'Hello' },
160+
const result = await client.executeWithRetry('workflow-id', { message: 'Hello' }, {
163161
timeout: 30000
164162
}, {
165163
maxRetries: 3, // Maximum number of retries
@@ -171,6 +169,7 @@ const result = await client.executeWithRetry('workflow-id', {
171169

172170
**Parameters:**
173171
- `workflowId` (string): The ID of the workflow to execute
172+
- `input` (any, optional): Input data to pass to the workflow
174173
- `options` (ExecutionOptions, optional): Same as `executeWorkflow()`
175174
- `retryOptions` (RetryOptions, optional):
176175
- `maxRetries` (number): Maximum number of retries (default: 3)
@@ -389,10 +388,8 @@ async function runWorkflow() {
389388

390389
// Execute the workflow
391390
const result = await client.executeWorkflow('my-workflow-id', {
392-
input: {
393391
message: 'Process this data',
394392
userId: '12345'
395-
}
396393
});
397394

398395
if (result.success) {
@@ -508,8 +505,7 @@ app.post('/execute-workflow', async (req, res) => {
508505
try {
509506
const { workflowId, input } = req.body;
510507

511-
const result = await client.executeWorkflow(workflowId, {
512-
input,
508+
const result = await client.executeWorkflow(workflowId, input, {
513509
timeout: 60000
514510
});
515511

@@ -555,8 +551,7 @@ export default async function handler(
555551
try {
556552
const { workflowId, input } = req.body;
557553

558-
const result = await client.executeWorkflow(workflowId, {
559-
input,
554+
const result = await client.executeWorkflow(workflowId, input, {
560555
timeout: 30000
561556
});
562557

@@ -586,9 +581,7 @@ const client = new SimStudioClient({
586581
async function executeClientSideWorkflow() {
587582
try {
588583
const result = await client.executeWorkflow('workflow-id', {
589-
input: {
590584
userInput: 'Hello from browser'
591-
}
592585
});
593586

594587
console.log('Workflow result:', result);
@@ -642,10 +635,8 @@ Alternatively, you can manually provide files using the URL format:
642635

643636
// Include files under the field name from your API trigger's input format
644637
const result = await client.executeWorkflow('workflow-id', {
645-
input: {
646638
documents: files, // Must match your workflow's "files" field name
647639
instructions: 'Analyze these documents'
648-
}
649640
});
650641

651642
console.log('Result:', result);
@@ -669,10 +660,8 @@ Alternatively, you can manually provide files using the URL format:
669660

670661
// Include files under the field name from your API trigger's input format
671662
const result = await client.executeWorkflow('workflow-id', {
672-
input: {
673663
documents: [file], // Must match your workflow's "files" field name
674664
query: 'Summarize this document'
675-
}
676665
});
677666
```
678667
</Tab>
@@ -712,8 +701,7 @@ export function useWorkflow(): UseWorkflowResult {
712701
setResult(null);
713702

714703
try {
715-
const workflowResult = await client.executeWorkflow(workflowId, {
716-
input,
704+
const workflowResult = await client.executeWorkflow(workflowId, input, {
717705
timeout: 30000
718706
});
719707
setResult(workflowResult);
@@ -774,8 +762,7 @@ const client = new SimStudioClient({
774762
async function executeAsync() {
775763
try {
776764
// Start async execution
777-
const result = await client.executeWorkflow('workflow-id', {
778-
input: { data: 'large dataset' },
765+
const result = await client.executeWorkflow('workflow-id', { data: 'large dataset' }, {
779766
async: true // Execute asynchronously
780767
});
781768

@@ -823,9 +810,7 @@ const client = new SimStudioClient({
823810
async function executeWithRetryHandling() {
824811
try {
825812
// Automatically retries on rate limit
826-
const result = await client.executeWithRetry('workflow-id', {
827-
input: { message: 'Process this' }
828-
}, {
813+
const result = await client.executeWithRetry('workflow-id', { message: 'Process this' }, {}, {
829814
maxRetries: 5,
830815
initialDelay: 1000,
831816
maxDelay: 60000,
@@ -908,8 +893,7 @@ const client = new SimStudioClient({
908893
async function executeWithStreaming() {
909894
try {
910895
// Enable streaming for specific block outputs
911-
const result = await client.executeWorkflow('workflow-id', {
912-
input: { message: 'Count to five' },
896+
const result = await client.executeWorkflow('workflow-id', { message: 'Count to five' }, {
913897
stream: true,
914898
selectedOutputs: ['agent1.content'] // Use blockName.attribute format
915899
});
@@ -1033,3 +1017,14 @@ function StreamingWorkflow() {
10331017
## License
10341018

10351019
Apache-2.0
1020+
1021+
import { FAQ } from '@/components/ui/faq'
1022+
1023+
<FAQ items={[
1024+
{ question: "Do I need to deploy a workflow before I can execute it via the SDK?", answer: "Yes. Workflows must be deployed before they can be executed through the SDK. You can use the validateWorkflow() method to check whether a workflow is deployed and ready. If it returns false, deploy the workflow from the Sim UI first and create or select an API key during deployment." },
1025+
{ question: "What is the difference between sync and async execution?", answer: "Sync execution (the default) blocks until the workflow completes and returns the full result. Async execution returns immediately with a task ID that you can poll using getJobStatus(). Use async mode for long-running workflows to avoid request timeouts. Async job statuses include queued, processing, completed, failed, and cancelled." },
1026+
{ question: "How does streaming work with the SDK?", answer: "Enable streaming by setting stream: true and specifying selectedOutputs with block names and attributes in blockName.attribute format (e.g., ['agent1.content']). The response uses Server-Sent Events (SSE) format, sending incremental chunks as the workflow executes. Each chunk includes the blockId and the text content. A final done event includes the execution metadata." },
1027+
{ question: "How does the SDK handle rate limiting?", answer: "The SDK provides built-in rate limiting support through the executeWithRetry() method. It uses exponential backoff (1s, 2s, 4s, 8s...) with 25% jitter to avoid thundering herd problems. If the API returns a retry-after header, that value is used instead. You can configure maxRetries, initialDelay, maxDelay, and backoffMultiplier. Use getRateLimitInfo() to check your current rate limit status." },
1028+
{ question: "Is it safe to use the SDK in browser-side code?", answer: "You can use the SDK in the browser, but you should not expose your API key in client-side code. In production, use a backend proxy server to handle SDK calls, or use a public API key with limited permissions. The SDK works with both Node.js and browser environments, but sensitive keys should stay server-side." },
1029+
{ question: "How do I send files to a workflow through the SDK?", answer: "File objects are automatically detected and converted to base64 format. Include them in the input object under the field name that matches your workflow's API trigger input format. In the browser, pass File objects directly from file inputs. In Node.js, create File objects from buffers. You can also provide files as URL references with type, data, name, and mime fields." },
1030+
]} />

apps/docs/content/docs/en/custom-tools/index.mdx

Lines changed: 0 additions & 100 deletions
This file was deleted.

apps/docs/content/docs/en/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Welcome to Sim, the open-source AI workspace where teams build, deploy, and mana
5151
<Card title="MCP Integration" href="/mcp">
5252
Connect external services with Model Context Protocol
5353
</Card>
54-
<Card title="SDKs" href="/sdks">
54+
<Card title="SDKs" href="/api-reference">
5555
Integrate Sim into your applications
5656
</Card>
5757
</Cards>

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"variables",
2222
"integrations",
2323
"credentials",
24-
"custom-tools",
2524
"---Platform---",
2625
"execution",
2726
"permissions",

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

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)