Skip to content

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.

Expressions

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}}
FeatureSyntax
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 / existencesuffix .count or .exists after the collection
Operators== != < <= > >= · AND OR NOT (uppercase or lowercase)

If / Else

Logic · if_else · branches the flow

Evaluates 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: contains

Simple 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_response

What to test: `last_response` (last agent response) or a variable.

condition_valuestring

The comparison value (not used in `is_empty`/`is_not_empty`).

While Loop

Logic · while · repeats while true

Re-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_valuestring

Alternative in simple mode (same operators as If/Else).

max_iterationsnumberpadrão: 10

Iteration cap — protection against infinite loops.

clear_context_each_iterationbooleanpadrão: false

Clears transient context each iteration (previous response does not leak to the next).

User Approval

Logic · user_approval · pauses and waits

Pauses 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ório

The 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: 0

Maximum wait time. `0` = wait forever.

auto_approvebooleanpadrão: false

On timeout: `true` approves and continues; `false` rejects.

Guardrails

Logic · guardrails · inspection with pass/fail outputs

The 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: input

What to inspect: the user message or the last generated response.

config.checks.piiboolean

CPF, CNPJ, email, phone, and card (with Luhn digit) via regex — deterministic, no cost.

config.checks.blockliststring[]

Forbidden terms/expressions — deterministic, no cost.

config.checks.jailbreakboolean

Model classifier for instruction bypass attempts.

config.checks.moderationboolean

Model classifier for harmful content.

config.checks.customstring

Natural language rule ("reject if asking for X") — evaluated by the model.

config.fail_messagestring

Logged in the event and variables when it fails.

config.on_errorpass | failpadrão: pass

What to do if the classifier fails.

config.modelstring

Model 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.

Was this page helpful?