You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sim provides a comprehensive external API for querying workflow execution logs and setting up webhooks for real-time notifications when workflows complete.
9
+
Sim provides a comprehensive external API for querying workflow run logs and setting up webhooks for real-time notifications when workflows complete.
10
10
11
11
## Authentication
12
12
@@ -21,7 +21,7 @@ You can generate API keys from the Sim platform and navigate to **Settings**, th
21
21
22
22
## Logs API
23
23
24
-
All API responses include information about your workflow execution limits and usage:
24
+
All API responses include information about your workflow run limits and usage:
25
25
26
26
```json
27
27
"limits": {
@@ -48,11 +48,11 @@ All API responses include information about your workflow execution limits and u
48
48
}
49
49
```
50
50
51
-
**Note:** Rate limits use a token bucket algorithm. `remaining` can exceed `requestsPerMinute` up to `maxBurst` when you haven't used your full allowance recently, allowing for burst traffic. The rate limits in the response body are for workflow executions. The rate limits for calling this API endpoint are in the response headers (`X-RateLimit-*`).
51
+
**Note:** Rate limits use a token bucket algorithm. `remaining` can exceed `requestsPerMinute` up to `maxBurst` when you haven't used your full allowance recently, allowing for burst traffic. The rate limits in the response body are for workflow runs. The rate limits for calling this API endpoint are in the response headers (`X-RateLimit-*`).
52
52
53
53
### Query Logs
54
54
55
-
Query workflow execution logs with extensive filtering options.
55
+
Query workflow run logs with extensive filtering options.
- `startDate` - ISO timestamp for date range start
72
72
- `endDate` - ISO timestamp for date range end
73
-
- `executionId` - Exact execution ID match
74
-
- `minDurationMs` - Minimum execution duration in milliseconds
75
-
- `maxDurationMs` - Maximum execution duration in milliseconds
76
-
- `minCost` - Minimum execution cost
77
-
- `maxCost` - Maximum execution cost
73
+
- `executionId` - Exact run ID match
74
+
- `minDurationMs` - Minimum run duration in milliseconds
75
+
- `maxDurationMs` - Maximum run duration in milliseconds
76
+
- `minCost` - Minimum run cost
77
+
- `maxCost` - Maximum run cost
78
78
- `model` - Filter by AI model used
79
79
80
80
**Pagination:**
@@ -213,9 +213,9 @@ Retrieve detailed information about a specific log entry.
213
213
</Tab>
214
214
</Tabs>
215
215
216
-
### Get Execution Details
216
+
### Get Run Details
217
217
218
-
Retrieve execution details including the workflow state snapshot.
218
+
Retrieve run details including the workflow state snapshot.
219
219
220
220
<Tabsitems={['Request', 'Response']}>
221
221
<Tabvalue="Request">
@@ -248,15 +248,15 @@ Retrieve execution details including the workflow state snapshot.
248
248
249
249
## Notifications
250
250
251
-
Get real-time notifications when workflow executions complete via webhook, email, or Slack. Notifications are configured at the workspace level from the Logs page.
251
+
Get real-time notifications when workflow runs complete via webhook, email, or Slack. Notifications are configured at the workspace level from the Logs page.
252
252
253
253
### Configuration
254
254
255
255
Configure notifications from the Logs page by clicking the menu button and selecting "Configure Notifications".
256
256
257
257
**Notification Channels:**
258
258
-**Webhook**: Send HTTP POST requests to your endpoint
259
-
-**Email**: Receive email notifications with execution details
259
+
-**Email**: Receive email notifications with run details
260
260
-**Slack**: Post messages to a Slack channel
261
261
262
262
**Workflow Selection:**
@@ -269,38 +269,38 @@ Configure notifications from the Logs page by clicking the menu button and selec
269
269
270
270
**Optional Data:**
271
271
-`includeFinalOutput`: Include the workflow's final output
272
-
-`includeTraceSpans`: Include detailed execution trace spans
272
+
-`includeTraceSpans`: Include detailed trace spans
273
273
-`includeRateLimits`: Include rate limit information (sync/async limits and remaining)
274
274
-`includeUsageData`: Include billing period usage and limits
275
275
276
276
### Alert Rules
277
277
278
-
Instead of receiving notifications for every execution, configure alert rules to be notified only when issues are detected:
278
+
Instead of receiving notifications for every run, configure alert rules to be notified only when issues are detected:
279
279
280
280
**Consecutive Failures**
281
-
- Alert after X consecutive failed executions (e.g., 3 failures in a row)
282
-
- Resets when an execution succeeds
281
+
- Alert after X consecutive failed runs (e.g., 3 failures in a row)
282
+
- Resets when a run succeeds
283
283
284
284
**Failure Rate**
285
285
- Alert when failure rate exceeds X% over the last Y hours
286
-
- Requires minimum 5 executions in the window
286
+
- Requires minimum 5 runs in the window
287
287
- Only triggers after the full time window has elapsed
288
288
289
289
**Latency Threshold**
290
-
- Alert when any execution takes longer than X seconds
290
+
- Alert when any run takes longer than X seconds
291
291
- Useful for catching slow or hanging workflows
292
292
293
293
**Latency Spike**
294
-
- Alert when execution is X% slower than the average
294
+
- Alert when a run is X% slower than the average
295
295
- Compares against the average duration over the configured time window
296
-
- Requires minimum 5 executions to establish baseline
296
+
- Requires minimum 5 runs to establish baseline
297
297
298
298
**Cost Threshold**
299
-
- Alert when a single execution costs more than $X
299
+
- Alert when a single run costs more than $X
300
300
- Useful for catching expensive LLM calls
301
301
302
302
**No Activity**
303
-
- Alert when no executions occur within X hours
303
+
- Alert when no runs occur within X hours
304
304
- Useful for monitoring scheduled workflows that should run regularly
305
305
306
306
**Error Count**
@@ -317,7 +317,7 @@ For webhooks, additional options are available:
317
317
318
318
### Payload Structure
319
319
320
-
When a workflow execution completes, Sim sends the following payload (via webhook POST, email, or Slack):
320
+
When a workflow run completes, Sim sends the following payload (via webhook POST, email, or Slack):
321
321
322
322
```json
323
323
{
@@ -456,7 +456,7 @@ Failed webhook deliveries are retried with exponential backoff and jitter:
456
456
- Deliveries timeout after 30 seconds
457
457
458
458
<Callouttype="info">
459
-
Webhook deliveries are processed asynchronously and don't affect workflow execution performance.
459
+
Webhook deliveries are processed asynchronously and don't affect workflow run performance.
460
460
</Callout>
461
461
462
462
## Best Practices
@@ -596,11 +596,11 @@ app.listen(3000, () => {
596
596
import { FAQ } from'@/components/ui/faq'
597
597
598
598
<FAQitems={[
599
-
{ question: "How do I trigger async execution via the API?", answer: "Set the X-Execution-Mode header to 'async' on your POST request to /api/workflows/{id}/execute. The API returns a 202 response with a jobId, executionId, and a statusUrl you can poll to check when the job completes. Async mode does not support draft state, workflow overrides, or selective output options." },
599
+
{ question: "How do I trigger an async run via the API?", answer: "Set the X-Execution-Mode header to 'async' on your POST request to /api/workflows/{id}/execute. The API returns a 202 response with a jobId, executionId, and a statusUrl you can poll to check when the job completes. Async mode does not support draft state, workflow overrides, or selective output options." },
600
600
{ question: "What authentication methods does the API support?", answer: "The API supports two authentication methods: API keys passed in the x-api-key header, and session-based authentication for logged-in users. API keys can be generated from Settings > Sim Keys in the platform. Workflows with public API access enabled can also be called without authentication." },
601
601
{ question: "How does the webhook retry policy work?", answer: "Failed webhook deliveries are retried up to 5 times with exponential backoff: 5 seconds, 15 seconds, 1 minute, 3 minutes, and 10 minutes, plus up to 10% jitter. Only HTTP 5xx and 429 responses trigger retries. Each delivery times out after 30 seconds." },
602
-
{ question: "What rate limits apply to the Logs API?", answer: "Rate limits use a token bucket algorithm. Free plans get 30 requests/minute with 60 burst capacity, Pro gets 100/200, Team gets 200/400, and Enterprise gets 500/1000. These are separate from workflow execution rate limits, which are shown in the response body." },
602
+
{ question: "What rate limits apply to the Logs API?", answer: "Rate limits use a token bucket algorithm. Free plans get 30 requests/minute with 60 burst capacity, Pro gets 100/200, Team gets 200/400, and Enterprise gets 500/1000. These are separate from workflow run rate limits, which are shown in the response body." },
603
603
{ question: "How do I verify that a webhook is from Sim?", answer: "Configure a webhook secret when setting up notifications. Sim signs each delivery with HMAC-SHA256 using the format 't={timestamp},v1={signature}' in the sim-signature header. Compute the HMAC of '{timestamp}.{body}' with your secret and compare it to the signature value." },
604
604
{ question: "What alert rules are available for notifications?", answer: "You can configure alerts for consecutive failures, failure rate thresholds, latency thresholds, latency spikes (percentage above average), cost thresholds, no-activity periods, and error counts within a time window. All alert types include a 1-hour cooldown to prevent notification spam." },
605
-
{ question: "Can I filter which executions trigger notifications?", answer: "Yes. You can filter notifications by specific workflows (or select all), log level (info or error), and trigger type (api, webhook, schedule, manual, chat). You can also choose whether to include final output, trace spans, rate limits, and usage data in the notification payload." },
605
+
{ question: "Can I filter which runs trigger notifications?", answer: "Yes. You can filter notifications by specific workflows (or select all), log level (info or error), and trigger type (api, webhook, schedule, manual, chat). You can also choose whether to include final output, trace spans, rate limits, and usage data in the notification payload." },
Understanding how workflows execute in Sim is key to building efficient and reliable automations. The execution engine automatically handles dependencies, concurrency, and data flow to ensure your workflows run smoothly and predictably.
9
+
Understanding how workflows run in Sim is key to building efficient and reliable automations. The execution engine automatically handles dependencies, concurrency, and data flow to ensure your workflows run smoothly and predictably.
10
10
11
11
## How Workflows Execute
12
12
13
13
Sim's execution engine processes workflows intelligently by analyzing dependencies and running blocks in the most efficient order possible.
14
14
15
15
### Concurrent Execution by Default
16
16
17
-
Multiple blocks run concurrently when they don't depend on each other. This parallel execution dramatically improves performance without requiring manual configuration.
17
+
Multiple blocks run concurrently when they don't depend on each other. This dramatically improves performance without requiring manual configuration.
18
18
19
19
<Image
20
20
src="/static/execution/concurrency.png"
@@ -49,15 +49,15 @@ Workflows can branch in multiple directions using routing blocks. The execution
49
49
height={500}
50
50
/>
51
51
52
-
This workflow demonstrates how execution can follow different paths based on conditions or AI decisions, with each path executing independently.
52
+
This workflow demonstrates how a run can follow different paths based on conditions or AI decisions, with each path running independently.
53
53
54
54
## Block Types
55
55
56
56
Sim provides different types of blocks that serve specific purposes in your workflows:
57
57
58
58
<Cards>
59
59
<Cardtitle="Triggers"href="/triggers">
60
-
**Starter blocks** initiate workflows and **Webhook blocks** respond to external events. Every workflow needs a trigger to begin execution.
60
+
**Starter blocks** initiate workflows and **Webhook blocks** respond to external events. Every workflow needs a trigger to begin a run.
61
61
</Card>
62
62
63
63
<Cardtitle="Processing Blocks"href="/blocks">
@@ -73,37 +73,37 @@ Sim provides different types of blocks that serve specific purposes in your work
73
73
</Card>
74
74
</Cards>
75
75
76
-
All blocks execute automatically based on their dependencies - you don't need to manually manage execution order or timing.
76
+
All blocks run automatically based on their dependencies - you don't need to manually manage run order or timing.
77
77
78
-
## Execution Monitoring
78
+
## Run Monitoring
79
79
80
-
When workflows run, Sim provides real-time visibility into the execution process:
80
+
When workflows run, Sim provides real-time visibility into the process:
81
81
82
-
-**Live Block States**: See which blocks are currently executing, completed, or failed
83
-
-**Execution Logs**: Detailed logs appear in real-time showing inputs, outputs, and any errors
84
-
-**Performance Metrics**: Track execution time and costs for each block
85
-
-**Path Visualization**: Understand which execution paths were taken through your workflow
82
+
-**Live Block States**: See which blocks are currently running, completed, or failed
83
+
-**Run Logs**: Detailed logs appear in real-time showing inputs, outputs, and any errors
84
+
-**Performance Metrics**: Track run time and costs for each block
85
+
-**Path Visualization**: Understand which paths were taken through your workflow
86
86
87
87
<Callouttype="info">
88
-
All execution details are captured and available for review even after workflows complete, helping with debugging and optimization.
88
+
All run details are captured and available for review even after workflows complete, helping with debugging and optimization.
89
89
</Callout>
90
90
91
-
## Key Execution Principles
91
+
## Key Principles
92
92
93
93
Understanding these core principles will help you build better workflows:
94
94
95
95
1.**Dependency-Based Execution**: Blocks only run when all their dependencies have completed
96
96
2.**Automatic Parallelization**: Independent blocks run concurrently without configuration
97
97
3.**Smart Data Flow**: Outputs flow automatically to connected blocks
98
-
4.**Error Handling**: Failed blocks stop their execution path but don't affect independent paths
99
-
5.**Response Blocks as Exit Points**: When a Response block executes, the entire workflow stops and the API response is sent immediately. Multiple Response blocks can exist on different branches — the first one to execute wins
100
-
6.**State Persistence**: All block outputs and execution details are preserved for debugging
101
-
7.**Cycle Protection**: Workflows that call other workflows (via Workflow blocks, MCP tools, or API blocks) are tracked with a call chain. If the chain exceeds 25 hops, execution is stopped to prevent infinite loops
98
+
4.**Error Handling**: Failed blocks stop their run path but don't affect independent paths
99
+
5.**Response Blocks as Exit Points**: When a Response block runs, the entire workflow stops and the API response is sent immediately. Multiple Response blocks can exist on different branches — the first one to run wins
100
+
6.**State Persistence**: All block outputs and run details are preserved for debugging
101
+
7.**Cycle Protection**: Workflows that call other workflows (via Workflow blocks, MCP tools, or API blocks) are tracked with a call chain. If the chain exceeds 25 hops, the run is stopped to prevent infinite loops
102
102
103
103
## Next Steps
104
104
105
105
Now that you understand execution basics, explore:
106
106
-**[Block Types](/blocks)** - Learn about specific block capabilities
107
-
-**[Logging](/execution/logging)** - Monitor workflow executions and debug issues
107
+
-**[Logging](/execution/logging)** - Monitor workflow runs and debug issues
108
108
-**[Cost Calculation](/execution/costs)** - Understand and optimize workflow costs
109
109
-**[Triggers](/triggers)** - Set up different ways to run your workflows
0 commit comments