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
Copy file name to clipboardExpand all lines: docs/content/architecture/trigger-types.mdx
+12-18Lines changed: 12 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -139,7 +139,7 @@ json!({
139
139
140
140
**Output**: `ApiResponse` with status_code, body, headers
141
141
142
-
**Conditions**: Optional. Add `_condition_path` to config with a function ID. The engine invokes it before the handler; if it returns `false`, the handler function is not called. See [Trigger Conditions](#trigger-conditions).
142
+
**Conditions**: Optional. Add `condition_function_id` to config with a function ID. The engine invokes it before the handler; if it returns `false`, the handler function is not called. See [Trigger Conditions](#trigger-conditions).
143
143
144
144
**Path Parameters**: Extract values from URL
145
145
@@ -546,7 +546,7 @@ json!({
546
546
547
547
**Output**: Function result (optional, fire-and-forget pattern supported)
548
548
549
-
**Conditions**: Optional. Add `_condition_path` to config. See [Trigger Conditions](#trigger-conditions).
549
+
**Conditions**: Optional. Add `condition_function_id` to config. See [Trigger Conditions](#trigger-conditions).
550
550
551
551
**Multiple Topics**: Register separate triggers for each topic.
552
552
@@ -604,7 +604,7 @@ json!({
604
604
605
605
**Output**: Function result
606
606
607
-
**Conditions**: Optional. Add `_condition_path` to config. See [Trigger Conditions](#trigger-conditions).
607
+
**Conditions**: Optional. Add `condition_function_id` to config. See [Trigger Conditions](#trigger-conditions).
608
608
609
609
**Cron Expression**: Standard 5-field format (minute hour day month weekday)
610
610
@@ -906,7 +906,7 @@ Triggers can optionally use a **condition function** to decide whether the handl
906
906
### How It Works
907
907
908
908
1. Register a condition function that receives the same input as the handler and returns a boolean.
909
-
2. Add `_condition_path` to the trigger config for http, queue, and cron; use `condition_function_id` for state and stream triggers.
909
+
2. Add `condition_function_id` to the trigger config with the condition function's ID.
910
910
3. When the trigger fires, the engine calls the condition first. Only if it returns truthy does the handler run.
State and stream triggers use `condition_function_id` in the config instead of `_condition_path`. The condition receives the full state event, including the event type (`created`, `updated`, `deleted`), scope, key, and both old and new values.
240
+
The condition receives the full state event, including the event type (`created`, `updated`, `deleted`), scope, key, and both old and new values.
- Condition functions are registered with `registerFunction` / `register_function` like any other function. They receive the same event data as the handler and must return `true` or `false`.
322
-
- For HTTP, queue, and cron triggers, add `_condition_path` to the trigger config with the condition function's ID.
323
-
- For state and stream triggers, use `condition_function_id` in the trigger config instead.
322
+
- Add `condition_function_id` to the trigger config with the condition function's ID. This key is the same for all trigger types.
324
323
- When a condition returns `false`:
325
324
-**HTTP** — the engine responds with `422 Unprocessable Entity`; the handler function is not called.
326
325
-**Queue / Cron** — the handler function is not called; no error is surfaced.
0 commit comments