# Condition

The "**Condition"** is a one-of-a-kind task having two outputs instead of one.

It allows you to branch your pipelines and dynamically execute one part of it if the condition result is true and another one if it is false.

<figure><img src="/files/njN9Pwag8BCR6UOHqeCH" alt=""><figcaption></figcaption></figure>

As same as the "[Aggregator](/pipelines/tasks-ip/aggregator.md)" the "**Condition**" can use [mathematical functions](/pipelines/mathematical-functions.md) like `SUM()`, `AVG()` and other aggregating functions and operations like `+`,`-`,`==`, `!=`,`<`,`>`. etc. The full list can be found [here](/pipelines/mathematical-functions.md#arithmetical-and-logical-operations).&#x20;

The result of it can be compared with a desired value.

For example:

<div align="center" data-full-width="false"><figure><img src="/files/3PkkCv6TDRi9FcKNndHE" alt=""><figcaption><p>If list is not empty</p></figcaption></figure> <figure><img src="/files/AsFstN7njc9CEAZyjbD9" alt=""><figcaption><p>If average amount is equal to the last amount</p></figcaption></figure> <figure><img src="/files/2HdSKelJF0ZVouYWLfOY" alt=""><figcaption><p>Or even a single field value can be used</p></figcaption></figure></div>

In addition to that, you can execute several tasks depending on the condition is true or false:

<figure><img src="/files/0uFCo01KnWnPHt3wH7OD" alt=""><figcaption></figcaption></figure>

Or build more complicated branched and nested conditions:

<figure><img src="/files/d8My2zR3mjMfQNEutK7l" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ylem.co/pipelines/tasks-ip/condition.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
