# 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="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FS73SQoSsRrMisgJ0RTP4%2FScreenshot%202024-04-29%20at%2021.23.50.png?alt=media&#x26;token=cb790bde-818d-41ed-a21d-7854d600b3c8" alt=""><figcaption></figcaption></figure>

As same as the "[Aggregator](https://docs.ylem.co/pipelines/tasks-ip/aggregator)" the "**Condition**" can use [mathematical functions](https://docs.ylem.co/pipelines/mathematical-functions) like `SUM()`, `AVG()` and other aggregating functions and operations like `+`,`-`,`==`, `!=`,`<`,`>`. etc. The full list can be found [here](https://docs.ylem.co/mathematical-functions#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="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2F5kMM9TUeVGLWlqDXmO6R%2FScreenshot%202024-04-29%20at%2021.26.23.png?alt=media&#x26;token=1a075618-31ef-40b2-9516-c3aaa7dc4ed3" alt=""><figcaption><p>If list is not empty</p></figcaption></figure> <figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2Fix9Bcq4hAaZShG0PNLyz%2FScreenshot%202024-04-29%20at%2021.26.48.png?alt=media&#x26;token=2b2e6c46-b9f3-4b88-bba1-6fbb5279f9c0" alt=""><figcaption><p>If average amount is equal to the last amount</p></figcaption></figure> <figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FOW2pXzO8wlwHzzUWCMoM%2FScreenshot%202024-04-29%20at%2021.27.15.png?alt=media&#x26;token=6a0f7a47-e904-4602-87f6-0677549a14e0" 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="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FRJ5qvMYwBl89dqpenqH0%2FScreenshot%202024-04-29%20at%2021.30.44.png?alt=media&#x26;token=bd59610f-b540-4191-9c48-53f44b3b374d" alt=""><figcaption></figcaption></figure>

Or build more complicated branched and nested conditions:

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FcpMXdOxqO7AvLV2eOtCq%2FScreenshot%202024-04-29%20at%2021.32.22.png?alt=media&#x26;token=1ed697d6-eb55-4507-9992-223ffd7d668d" alt=""><figcaption></figcaption></figure>
