Condition Block
Advanced condition evaluation with LLM-as-a-Judge
The Condition block adds IF/ELSE branching to a workflow by evaluating a condition and routing execution down one of two paths — True or False. It supports boolean expressions for simple comparisons and LLM-as-a-Judge for complex, natural-language decisions that require AI reasoning.
Overview
| Property | Value |
|---|---|
| Type | condition |
| Category | blocks |
| Color | #FF752F |
When to Use
- Branch execution based on a previous block's output using a boolean expression
- Filter, validate, or classify data before sending it to downstream blocks
- Use AI to make a subjective judgment (tone, quality, relevance, sentiment) via LLM-as-a-Judge
- Route based on API response codes, string matches, or numeric comparisons
- Gate publishing or delivery steps on a confidence threshold from an LLM decision
- Replace a series of conditional checks with a single natural-language criteria prompt
Configuration
Evaluation Mode (evaluationMode)
Type: dropdown — required to select before other fields appear.
| Label | ID |
|---|---|
| Boolean Expression | expression |
| LLM as Judge | llm |
Selecting expression shows the Boolean Expression input. Selecting llm shows the LLM Judge fields (prompt, context, model, API key, and optional Azure fields).
Boolean Expression (conditions)
Type: condition-input
Visible when: evaluationMode = expression
Enter one or more boolean expressions. Each row is evaluated and the combined result determines the True or False path. Expressions support ==, !=, >, <, >=, <=, &&, ||, and .length checks against block outputs referenced with {{blockName.field}}.
Example placeholder: {{agent1.content}}==1 or content.length > 10
LLM Judge Prompt (llmPrompt)
Type: long-input (4 rows)
Visible when: evaluationMode = llm
Describe the criteria for the LLM to evaluate. The LLM will respond YES or NO based on this prompt. Be specific and unambiguous.
Example: Is the content positive and professional in tone?
Context for Evaluation (llmContext)
Type: long-input (3 rows)
Visible when: evaluationMode = llm
Provide the data you want the LLM to judge. Reference a previous block's output using {{blockName.field}}.
Example: {{agent1.content}}
LLM Model (llmModel)
Type: combobox — required when using LLM mode
Visible when: evaluationMode = llm
Select or type the model name to use for judging. Options are populated dynamically from all configured base model providers plus any locally running Ollama models. Examples include gpt-5.4-mini, claude-haiku-4-5, gemini-3.5-flash, and any Ollama model name.
API Key (apiKey)
Type: short-input (password)
Visible when: evaluationMode = llm AND the selected model is not a hosted/Ollama model (i.e., requires an explicit API key)
Enter the API key for the chosen model's provider. Use an environment variable reference such as {{OPENAI_API_KEY}} rather than pasting the key directly.
Azure OpenAI Endpoint (azureEndpoint)
Type: short-input (password)
Visible when: evaluationMode = llm AND an Azure OpenAI model is selected
The full Azure OpenAI resource endpoint URL.
Example: https://your-resource.openai.azure.com
Azure API Version (azureApiVersion)
Type: short-input
Visible when: evaluationMode = llm AND an Azure OpenAI model is selected
The Azure OpenAI API version string.
Example: 2024-07-01-preview
Require High Confidence (requireConfidence)
Type: switch
Visible when: evaluationMode = llm
When enabled, the block only treats an LLM YES decision as True if the model's reported confidence score exceeds 80%. Decisions below that threshold fall through to the False path.
Inputs & Outputs
-
Inputs: none — the Condition block has no declared inputs; all data comes from sub-block fields referencing other blocks via
{{blockName.field}}syntax. -
Outputs:
content(string) — Condition evaluation content or LLM reasoning textconditionResult(boolean) — Boolean result of the condition evaluation (trueroutes to the True path,falseto the False path)selectedPath(json) — Information about the execution path that was selected, includingblockId,blockType, andblockTitleof the downstream blockselectedConditionId(string) — Identifier of the selected path (trueorfalse)llmJudgement(json) — LLM judgement details when using LLM mode; containsreasoning(string),confidence(number 0–1),model(string), anddecision(yesorno)
Tools
This block uses no external tools. In expression mode the evaluation runs entirely in the executor. In llm mode the block calls a provider directly through the Zelaxy provider layer (not the tool registry) using the credentials and model configured in the sub-blocks.
YAML Example
# Boolean expression mode — route based on an agent's classification output
condition_1:
type: condition
name: "Check Urgency"
inputs:
evaluationMode: expression
conditions:
- left: "{{agent1.content}}"
operator: "=="
right: "urgent"
connections:
outgoing:
- target: slack_notify # True path
- target: log_low_priority # False path# LLM-as-a-Judge mode — AI evaluates tone and professionalism
condition_2:
type: condition
name: "Content Quality Check"
inputs:
evaluationMode: llm
llmPrompt: "Is this content professional, factual, and free of harmful language?"
llmContext: "{{agent1.content}}"
llmModel: gpt-5.4-mini
apiKey: "{{OPENAI_API_KEY}}"
requireConfidence: true
connections:
outgoing:
- target: publish_block # True path (YES with >80% confidence)
- target: rejection_response # False path