New274+ blocks and 249+ tools are now fully documented
Flow Control
Block

Condition Block

Advanced condition evaluation with LLM-as-a-Judge

The Condition block adds branching to a workflow by evaluating one or more conditions in order and routing execution down the matching path. In its simplest form that's a two-way if / else — but a Condition block can have any number of else if branches in between, each with its own path. It supports boolean expressions for simple comparisons and LLM-as-a-Judge for complex, natural-language decisions that require AI reasoning.

Overview

PropertyValue
Typecondition
Categoryblocks
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.

LabelID
Boolean Expressionexpression
LLM as Judgellm

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

This is a list of branches, not a single combined expression. It starts with two rows — IF and ELSE — and you can add as many ELSE IF rows between them as you need (the + button on the IF row). Each row is its own separate path: rows are checked top to bottom, the first one whose expression evaluates to true is taken, and if none match, ELSE runs. Expressions support ==, !=, >, <, >=, <=, &&, ||, and .length checks against block outputs referenced with {{blockName.field}}.

Example IF expression: {{agent1.content}}==1 or content.length > 10

Connecting branches on the canvas — every row gets its own connection point on the right edge of the block: green for IF, amber for each ELSE IF, red for ELSE. Drag a connection from each one to whatever should run for that branch. A branch left unconnected has nowhere to go — if execution takes that path, the workflow will error, so wire up every row you define (or remove the ones you don't need). The block grows taller automatically as you add ELSE IF branches so there's room for each handle.

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 text
    • conditionResult (boolean) — Whether a condition matched (true), or the ELSE fallback was taken (false)
    • selectedPath (json) — Information about the execution path that was selected, including blockId, blockType, and blockTitle of the downstream block
    • selectedConditionId (string) — Which branch was taken: true or false for a plain two-way if/else, or the internal id of the matched row for an ELSE IF branch
    • llmJudgement (json) — LLM judgement details when using LLM mode; contains reasoning (string), confidence (number 0–1), model (string), and decision (yes or no)

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

Condition branches are their own connection type — a plain connections.outgoing target does not connect a branch (the path will look wired in the YAML but nothing downstream will run, and the workflow errors if that branch is taken). Always wire branches under connections.conditions, and give inputs.conditions the same keys: if, then else-if / else-if-2 / else-if-3 / ... for as many extra branches as you need, then else.

# Boolean expression mode, simple if/else — route based on an agent's classification output
condition_1:
  type: condition
  name: "Check Urgency"
  inputs:
    evaluationMode: expression
    conditions:
      if: "{{agent1.content}} == 'urgent'"
  connections:
    conditions:
      if: slack_notify        # runs when the condition is true
      else: log_low_priority  # runs when it's false
# Boolean expression mode with an extra branch — three-way routing
condition_3:
  type: condition
  name: "Route by Score"
  inputs:
    evaluationMode: expression
    conditions:
      if: "{{score.result.value}} >= 90"
      else-if: "{{score.result.value}} >= 50"
  connections:
    conditions:
      if: high_priority        # score >= 90
      else-if: medium_priority # 50 <= score < 90
      else: low_priority       # everything else
# LLM-as-a-Judge mode — AI evaluates tone and professionalism (always a plain if/else)
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:
    conditions:
      if: publish_block       # YES with >80% confidence
      else: rejection_response

Editing an existing condition block with edit_workflow? The same rule applies to an operation's params.connections.conditions — it is not part of params.connections.outgoing.