Logic
Decisions, repetition, and security: If/Else, While Loop, User Approval, and Guardrails — conditions, expressions, and outputs.
Updated on Sep 02, 2026
Logic cards decide where the flow goes. If/Else and While share the same condition engine — simple mode (variable + operator + value) or expression mode.
In expression mode you write the complete condition, with variables between {{ }}:
{{round}} <= 3 AND {{votos.culpado}} < 2 AND {{votos.inocente}} < 2
{{status}} == "aprovado" OR {{tentativas}} > 5
{{jogadores.* | alive=true | role=lobo}}.count >= 1
NOT {{terminou}}| Feature | Syntax |
|---|---|
| Simple variable | {{round}}, {{status}} — absent/empty counts as 0 |
| Object access | {{votos.culpado}} enters the dict by key |
| Filtered collection | {{colecao.* | campo=valor | campo2=valor2}} (filters in AND) |
| Count / existence | suffix .count or .exists after the collection |
| Operators | == != < <= > >= · AND OR NOT (uppercase or lowercase) |
if_else · branches the flowEvaluates the condition once and follows the TRUE or FALSE output.
namestringpadrão: 'If/Else'Node name.
conditionstring (expressão)Expression mode — see above. When present, ignores simple mode fields.
condition_typestringpadrão: containsSimple mode: `contains`, `not_contains`, `equals`, `not_equals`, `starts_with`, `ends_with`, `greater_than`, `less_than`, `is_empty`, `is_not_empty`, `regex`.
condition_variablestringpadrão: last_responseWhat to test: `last_response` (last agent response) or a variable.
condition_valuestringThe comparison value (not used in `is_empty`/`is_not_empty`).
while · repeats while trueRe-evaluates the condition each iteration: true → LOOP output; false (or iteration cap) → EXIT output. The last node in the body loops back via the left loop-back input. Simple numeric variables mentioned in the condition (e.g., {{round}}) are auto-incremented each iteration.
namestringpadrão: 'While Loop'Node name.
loop_conditionstring (expressão)The condition to stay in the loop.
condition_type / condition_variable / condition_valuestringAlternative in simple mode (same operators as If/Else).
max_iterationsnumberpadrão: 10Iteration cap — protection against infinite loops.
clear_context_each_iterationbooleanpadrão: falseClears transient context each iteration (previous response does not leak to the next).
user_approval · pauses and waitsPauses the workflow and waits for the user. Follows approved or rejected based on the response. In A2A protocol the task stays in input-required; in the widget it appears as a question with options.
namestringpadrão: 'User Input'Node name.
approval_messagestringobrigatórioThe question shown to the user. Accepts `{{variables}}`.
approval_optionsstring[]Response options (buttons). Empty = free response; negative words ("no", "cancel"…) count as rejection.
approval_timeoutnumber (s)padrão: 0Maximum wait time. `0` = wait forever.
auto_approvebooleanpadrão: falseOn timeout: `true` approves and continues; `false` rejects.
guardrails · inspection with pass/fail outputsThe flow gatekeeper: inspects a text — the user message or the last response — and exits via pass or fail, like a security If/Else. Deterministic checks (PII, term list) run first and cost zero; model checks (jailbreak, moderation, natural language rule) are combined into a single classification.
config.targetinput | last_responsepadrão: inputWhat to inspect: the user message or the last generated response.
config.checks.piibooleanCPF, CNPJ, email, phone, and card (with Luhn digit) via regex — deterministic, no cost.
config.checks.blockliststring[]Forbidden terms/expressions — deterministic, no cost.
config.checks.jailbreakbooleanModel classifier for instruction bypass attempts.
config.checks.moderationbooleanModel classifier for harmful content.
config.checks.customstringNatural language rule ("reject if asking for X") — evaluated by the model.
config.fail_messagestringLogged in the event and variables when it fails.
config.on_errorpass | failpadrão: passWhat to do if the classifier fails.
config.modelstringModel for LLM checks (default: the agent's). Charged like any inference.
The result becomes a variable
guardrails_result and guardrails_reason are available for the following nodes — you can log, explain to the user, or branch again. Complete example in the Passwordless Identification flow, where the fail path falls into an agent without tools that asks not to send the data.

