Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions apps/docs/content/docs/en/workflows/triggers/sim.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Pick one event per Sim trigger block:
**Plain events** — fire on every occurrence:

<ul className="list-disc space-y-1 pl-6">
<li><strong>Execution Error</strong>: a watched workflow's run failed</li>
<li><strong>Execution Success</strong>: a watched workflow's run completed successfully</li>
<li><strong>Run Error</strong>: a watched workflow's run failed</li>
<li><strong>Run Success</strong>: a watched workflow's run completed successfully</li>
<li><strong>Workflow Deployed</strong>: a watched workflow was deployed (including redeploys and version rollbacks)</li>
<li><strong>Workflow Undeployed</strong>: a watched workflow was taken offline</li>
</ul>
Expand All @@ -41,7 +41,7 @@ By default the trigger watches every workflow in the workspace. Select specific

All events include `event`, `timestamp`, `workflowId`, and `workflowName` (the source workflow). Additional fields depend on the event type:

<Tabs items={['Execution Events', 'Alert Conditions', 'Workflow Deployed']}>
<Tabs items={['Run Events', 'Alert Conditions', 'Workflow Deployed']}>
<Tab>
<ul className="list-disc space-y-1 pl-6">
<li><strong>runId</strong>: the run that completed</li>
Expand Down
4 changes: 2 additions & 2 deletions apps/sim/blocks/blocks/sim_workspace_event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const SimWorkspaceEventBlock: BlockConfig = {
type: 'sim_workspace_event',
name: 'Sim',
description:
'Run this workflow when workspace events occur: execution errors or successes, deployments, and alert conditions like latency or cost spikes.',
'Run this workflow when workspace events occur: run errors or successes, deployments, and alert conditions like latency or cost spikes.',
category: 'triggers',
icon: SimTriggerIcon,
bgColor: '#33C482',
Expand All @@ -19,7 +19,7 @@ export const SimWorkspaceEventBlock: BlockConfig = {
bestPractices: `
- Events are scoped to this workspace. Pick an event type, then optionally narrow to specific workflows (empty selection watches all).
- This workflow must be deployed for the trigger to fire, and it never receives events about itself.
- Executions started by this trigger never emit workspace events, so side-effect workflows cannot chain or loop.
- Runs started by this trigger never emit workspace events, so side-effect workflows cannot chain or loop.
- Alert conditions (latency spike, cost threshold, consecutive failures, ...) fire at most once per cooldown window; plain events fire on every occurrence.
- Compose any blocks downstream (Slack, email, webhooks, custom logic) to act on the event payload.
`,
Expand Down
17 changes: 8 additions & 9 deletions apps/sim/triggers/sim/workspace-event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const simWorkspaceEventTrigger: TriggerConfig = {
name: 'Sim',
provider: SIM_TRIGGER_PROVIDER,
description:
'Triggers when workspace events occur: execution errors or successes, deployments, and alert conditions like latency or cost spikes',
'Triggers when workspace events occur: run errors or successes, deployments, and alert conditions like latency or cost spikes',
version: '1.0.0',
icon: SimTriggerIcon,

Expand All @@ -23,8 +23,8 @@ export const simWorkspaceEventTrigger: TriggerConfig = {
title: 'Event',
type: 'dropdown',
options: [
{ id: 'execution_error', label: 'Execution Error', group: 'Events' },
{ id: 'execution_success', label: 'Execution Success', group: 'Events' },
{ id: 'execution_error', label: 'Run Error', group: 'Events' },
{ id: 'execution_success', label: 'Run Success', group: 'Events' },
{ id: 'workflow_deployed', label: 'Workflow Deployed', group: 'Events' },
{ id: 'workflow_undeployed', label: 'Workflow Undeployed', group: 'Events' },
{ id: 'consecutive_failures', label: 'Consecutive Failures', group: 'Alert Conditions' },
Expand Down Expand Up @@ -59,7 +59,7 @@ export const simWorkspaceEventTrigger: TriggerConfig = {
type: 'short-input',
placeholder: String(SIM_RULE_DEFAULTS.consecutiveFailures),
defaultValue: String(SIM_RULE_DEFAULTS.consecutiveFailures),
description: 'Fire after this many consecutive failed executions.',
description: 'Fire after this many consecutive failed runs.',
required: { field: 'eventType', value: 'consecutive_failures' },
mode: 'trigger',
condition: { field: 'eventType', value: 'consecutive_failures' },
Expand All @@ -82,7 +82,7 @@ export const simWorkspaceEventTrigger: TriggerConfig = {
type: 'short-input',
placeholder: String(SIM_RULE_DEFAULTS.durationThresholdMs),
defaultValue: String(SIM_RULE_DEFAULTS.durationThresholdMs),
description: 'Fire when an execution takes longer than this many milliseconds.',
description: 'Fire when a run takes longer than this many milliseconds.',
required: { field: 'eventType', value: 'latency_threshold' },
mode: 'trigger',
condition: { field: 'eventType', value: 'latency_threshold' },
Expand All @@ -93,8 +93,7 @@ export const simWorkspaceEventTrigger: TriggerConfig = {
type: 'short-input',
placeholder: String(SIM_RULE_DEFAULTS.latencySpikePercent),
defaultValue: String(SIM_RULE_DEFAULTS.latencySpikePercent),
description:
'Fire when an execution is this much slower than the average over the time window.',
description: 'Fire when a run is this much slower than the average over the time window.',
required: { field: 'eventType', value: 'latency_spike' },
mode: 'trigger',
condition: { field: 'eventType', value: 'latency_spike' },
Expand Down Expand Up @@ -144,7 +143,7 @@ export const simWorkspaceEventTrigger: TriggerConfig = {
type: 'short-input',
placeholder: String(SIM_RULE_DEFAULTS.inactivityHours),
defaultValue: String(SIM_RULE_DEFAULTS.inactivityHours),
description: 'Fire when a watched workflow has no executions for this many hours.',
description: 'Fire when a watched workflow has no runs for this many hours.',
required: { field: 'eventType', value: 'no_activity' },
mode: 'trigger',
condition: { field: 'eventType', value: 'no_activity' },
Expand All @@ -158,7 +157,7 @@ export const simWorkspaceEventTrigger: TriggerConfig = {
'Choose the workspace event or alert condition to react to',
'Optionally narrow it to specific workflows — leaving the selection empty watches every workflow (this workflow is always excluded; it never triggers itself)',
'Deploy this workflow — events only fire for deployed workflows',
'Executions started by this trigger never emit workspace events, so chains and loops are not possible',
'Runs started by this trigger never emit workspace events, so chains and loops are not possible',
]
.map(
(instruction, index) =>
Expand Down
Loading