control.flow.guard ​
Assert a condition; pass through if it holds, else fail the branch with a reason
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-control |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
a | json | Yes | — | Left-hand value to test before allowing the branch to continue. |
op | string | Yes | — | Guard operator: eq, ne, in, not_in, truthy, falsy, gt, gte, lt, lte, contains, not_contains, regex, is_null, or not_null. |
b | json | No | — | Right-hand comparison value for binary guard operators. |
reason | string | No | — | Failure reason to emit when the guard condition is false. |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
a | json | No | — | Left-hand value echoed from input. |
op | string | No | — | Guard operator echoed from input. |
b | json | No | — | Right-hand value echoed from input. |
reason | string | No | — | Failure reason echoed from input when supplied. |
passed | boolean | No | — | True when the guard condition passed. |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "control.flow.guard",
"initial_data": {
"a": "value",
"op": "value"
}
}