---
title: "Using If/Else Branching for Quality Control"
description: "Add control points to your skills with If/Else: the agent checks each key result and redoes failed steps before errors reach the report."
url: https://help-takeoff.kreo.net/en/articles/11688703-using-ifelse-branching-for-quality-control
collection: "Skills"
updated: 2026-07-15
language: en
alternates: [fr]
---

# Using If/Else Branching for Quality Control

Add control points to your skills with If/Else: the agent checks each key result and redoes failed steps before errors reach the report.

A skill workflow doesn't have to be linear. If/Else adds conditional branching: the agent completes a step, checks the result, and takes a different path depending on the outcome. This is the main quality-control mechanism inside skills.

![](https://staticfiles.gleap.io/gattachments/oQJDMCAfqDgSdU44YQecQF1YXguDYcNl9sj3rW4QkHDyL9J8zCdcieT44hvxD1Kn6L9IwuaGpj1.png)

## Why it matters

Without control points, an error made early in a workflow rides all the way to the final report — and nobody catches it along the way. If/Else stops that: the error gets caught at its own step and fixed right there.

## How it works

A typical pattern:

1.  The agent completes a step — for example, measurements are calculated.
    
2.  The If/Else condition asks the agent to check: did it do this correctly?
    
3.  **If correct** — the workflow continues to the next step.
    
4.  **If not** — the step is sent back for a redo.
    

\[IMAGE: Diagram of an If/Else flow — step, check, continue or redo\]

## Where to place If/Else

You don't need a check after every step. Place If/Else:

-   **Before the step where a mistake would cost the most** — at minimum. For example, before results feed into a report.
    
-   **After steps with unstable output** — if a step sometimes produces a result that drifts, add a check right after it.
    
-   **At handoff points** — where the output of one part of the workflow becomes the input of the next.
    

## Tips

-   Make the check condition as specific as the steps themselves: "check that every measurement has been assigned a group" works better than "check that everything is fine."
    
-   If a step keeps failing its check, the problem is usually the step's wording, not the check. See [Writing Effective Skill Instructions: Best Practices](https://help-takeoff.kreo.net/en/articles/11688707-writing-effective-skill-instructions-best-practices.md).

## Related

- [What Are Skills? An Overview](https://help-takeoff.kreo.net/en/articles/11688700-what-are-skills-an-overview.md)
- [Creating Your First Skill](https://help-takeoff.kreo.net/en/articles/11688701-creating-your-first-skill.md)
- [Skill Steps: How to Describe Tasks](https://help-takeoff.kreo.net/en/articles/11688702-skill-steps-how-to-describe-tasks.md)
- [Adding Notes to Skills for Team Collaboration](https://help-takeoff.kreo.net/en/articles/11688704-adding-notes-to-skills-for-team-collaboration.md)
- [Naming, Describing, and Tagging Skills](https://help-takeoff.kreo.net/en/articles/11688705-naming-describing-and-tagging-skills.md)
