*Workflows › Build*

# Conditions and operators

> A condition compares one variable with one value. The Condition step sends the run down one of two paths; the Switch step picks the first of several.

## A condition is one comparison

A condition has three parts: a variable, an operator and a value. That is all. There is no and/or, no grouping, no nesting, no variable on the right side and no function in either side.

- The value on the right is a literal: a true/false, a number, a date or a text. A text can mention variables, so "Order {order number}" works as a text.
- To combine tests, nest conditions (a condition inside the Then lane of another is an AND; a switch with several branches that do the same thing is an OR), or compute a true/false with functions in a Set variable step and compare that.
- The same single-comparison condition is used by the Condition step, each branch of a Switch, the Loop, the list filters and the "Only when" filter of an event trigger.

## Operators

The operators offered depend on the type of the variable you pick. Each type's reference page lists its operators: [text](https://docs.filmo.io/workflows/reference/types/string#operators), [number](https://docs.filmo.io/workflows/reference/types/number#operators), [date](https://docs.filmo.io/workflows/reference/types/date#operators), [true/false](https://docs.filmo.io/workflows/reference/types/boolean#operators), [enumeration](https://docs.filmo.io/workflows/reference/types/enum#operators), [list](https://docs.filmo.io/workflows/reference/types/list#operators) and the structured types ([record](https://docs.filmo.io/workflows/reference/types/record#operators), [structure](https://docs.filmo.io/workflows/reference/types/shape#operators), [tuple](https://docs.filmo.io/workflows/reference/types/tuple#operators) and [file](https://docs.filmo.io/workflows/reference/types/file#operators), which can only be compared for equality). While no variable is chosen, all operators are offered. The two list operators, "has at least one item" and "is empty", take no value; dates offer "is after" and "is before" where the others say greater and less.

### Text comparisons are exact

`contains`, `starts with` and `ends with` are case-sensitive: "Invoice" does not contain "invoice". Equality on text is also exact.

### Dates

Dates are compared as text in ISO format, so both sides must have the same shape: a date (`2026-09-04`) against a date, an instant (`2026-09-04T10:30:00.000Z`) against an instant. A date against an instant gives a wrong answer without an error. The editor offers the value in the same form as the variable.

## The Condition step

It has two lanes, «Then» and «Else». The condition is true: the steps in «Then» run. Otherwise the steps in «Else» run. The «Else» lane can be empty, which means "do nothing". After the lane, the run continues with the step that follows the condition.

## The Switch step

- A switch has any number of branches («Branch»), each with its own condition and steps, and a «Default» lane.
- Branches are tried in order and the first one that is true wins; the rest are not even evaluated. If none is true, the default lane runs.
- A branch cannot match several values. To say "open, waiting or repairing", add one branch per value with the same steps. The templates do this.
- A Switch added on its own is born with no branches; the one that comes paired with an AI classifier is born with one branch per category. Changing the categories of an AI classifier later does not rebuild the branches: a label that has no branch falls into the default lane.

## Missing values

A condition on a variable that does not exist in this run (for instance one created in a branch that did not run) behaves in a way worth knowing:

| Condition | Variable is missing |
| --- | --- |
| is equal to | False |
| is not equal to | True |
| has at least one item / is empty / contains / starts with / ends with | The step fails with "the expression could not be evaluated" |
| No variable chosen yet | False, without evaluating; the run takes the Else lane. The editor may not flag it as a missing required field, so it can pass unnoticed. |

> **Strict true or false:** A condition that cannot be evaluated does not go down the Else lane: it fails the step, and so the run. Only a comparison that evaluates to false takes Else.

## Example

*A quote that is still pending*

```text
Condition: Quote status  is equal to  pending
  Then:  Ask the AI for the customer's history
         Create a task for the salesperson
  Else:  (nothing)
```

A complete workflow built on this pattern: [Warn sales when a quote is viewed and not signed](https://docs.filmo.io/workflows/guides/quote-viewed-no-signature).

---

Canonical URL: https://docs.filmo.io/workflows/conditions  
Last updated: 2026-10-09