Workspace Events Trigger
Run a workflow when a workspace alert rule fires on another workflow
The Workspace Events trigger runs a workflow when a workspace alert rule fires on any other workflow in the same workspace — consecutive failures, failure-rate spikes, error counts, latency thresholds/spikes, or cost thresholds. It reuses the same rule engine that powers workspace notifications, but exposes those events as a composable trigger you can build on.
Unlike webhook triggers, there is no URL to register: Zelaxy evaluates your workspace's run history on a schedule (about once per minute) and runs this workflow once per firing event.
Overview
| Property | Value |
|---|---|
| Type | workspace_events |
| Trigger ID | workspace_events_poller |
| Category | Trigger |
| Delivery | Internal polling (no external endpoint) |
When to Use
- Auto-remediate: restart, roll back, or re-run a workflow when it starts failing
- Escalate: page a human, open a ticket, or post to a channel when failure rates spike
- Observe: capture every failing run in the workspace into a log, warehouse, or dashboard
- Guardrails: react when a workflow's cost or latency crosses a threshold
Configuration
| Setting | Type | Description |
|---|---|---|
| Event type | Select | Which rule to listen for: any, consecutive_failures, failure_rate, error_count, latency_threshold, latency_spike, cost_threshold |
| Thresholds (JSON) | Text | Optional JSON overriding the rule thresholds — keys mirror the alert engine (count, windowHours, durationMs, dollars, percent). Leave blank for defaults |
| Watched workflow IDs | Text | Comma-separated workflow IDs to watch. Leave blank to watch every workflow in the workspace |
Event types
| Event type | Fires when | Threshold keys (defaults) |
|---|---|---|
any | Any run completes (success or error) | — |
consecutive_failures | The last N runs of a workflow all failed | count (3) |
failure_rate | Failure percentage over a window crosses the threshold | windowHours (24), percent (50) |
error_count | Number of errors over a window crosses the threshold | windowHours (24), count (5) |
latency_threshold | A run's duration exceeds the threshold | durationMs (30000) |
latency_spike | A run is much slower than the recent average | windowHours (24), percent (100) |
cost_threshold | A run's cost exceeds the threshold | dollars (1) |
no_activityalerts have no triggering run, so they are delivered through workspace notification channels rather than this poll-driven trigger.
How It Works
- Add the Workspace Events trigger to a workflow and choose an Event type.
- Activate the workflow. Zelaxy begins evaluating the workspace's run history on a schedule.
- The first poll only seeds the cursor — it records the runs that already exist and triggers nothing. This prevents replaying history when you connect the trigger.
- As other workflows in the workspace complete runs, each firing event runs this workflow once, oldest first.
- The workflow that hosts this trigger is always excluded from evaluation, so reacting to an event can never re-trigger itself (no infinite loop).
Event Fields
The poller flattens each event's fields to the top level of the trigger block's output, so you can reference them directly.
| Field | Type | Description |
|---|---|---|
rule_type | string | The alert rule type that fired |
reason | string | Human-readable explanation of why the rule fired |
workflow_id | string | ID of the workflow whose run triggered the event |
workflow_name | string | Name of that workflow |
execution_id | string | Execution ID of the triggering run |
status | string | Run status: success or error |
level | string | Run log level: info or error |
trigger | string | How the triggering run was started (api, webhook, schedule, ...) |
duration_ms | number | Total duration of the triggering run in milliseconds |
cost | number | Total cost of the triggering run |
started_at | string | When the triggering run started (ISO) |
ended_at | string | When the triggering run ended (ISO) |
Example event
{
"rule_type": "consecutive_failures",
"reason": "Last 3 runs all failed",
"workflow_id": "wf_abc123",
"workflow_name": "Nightly sync",
"execution_id": "exec_xyz789",
"status": "error",
"level": "error",
"trigger": "schedule",
"duration_ms": 4200,
"cost": 0.0123,
"started_at": "2024-01-15T13:14:15.000Z",
"ended_at": "2024-01-15T13:14:19.200Z"
}Accessing Data in Downstream Blocks
Reference the flattened fields with the {{BlockName.field}} syntax. The block name is the label shown on the canvas (default: Workspace Events 1).
{{Workspace Events 1.rule_type}} → "consecutive_failures"
{{Workspace Events 1.reason}} → "Last 3 runs all failed"
{{Workspace Events 1.workflow_name}} → "Nightly sync"
{{Workspace Events 1.workflow_id}} → "wf_abc123"
{{Workspace Events 1.status}} → "error"
{{Workspace Events 1.cost}} → 0.0123Example: Alert on repeated failures
Workflow:
[Workspace Events 1 (consecutive_failures)] → [Agent: Summarize failure] → [Slack: Post to #ops]Whenever any workflow in the workspace fails 3 times in a row, this workflow runs. Pass the event into the Agent block:
Workflow "{{Workspace Events 1.workflow_name}}" is failing: {{Workspace Events 1.reason}}.
Last execution: {{Workspace Events 1.execution_id}} (trigger: {{Workspace Events 1.trigger}}).Tips
- Scope it — set Watched workflow IDs to react to only a few critical workflows instead of the whole workspace.
- Tune thresholds — the Thresholds (JSON) field overrides only the keys you set; everything else keeps the alert-engine default.
anyis a firehose — every completed run fires an event. Filter downstream with a Condition block onstatusorworkflow_id, or prefer a specific event type.- No replay — connecting the trigger never fires for runs that already happened; only new runs count.
- Self-trigger safe — the hosting workflow is always excluded, so a remediation workflow reacting to failures never triggers itself.