# Branches and loops

Sydekyks user and operator guide. Check feature availability and release-specific installation requirements.

Use control flow when the next action depends on a condition or when the same action must run for several records.

## ​Conditional routes

Add a router and define conditions using values from earlier steps. For a bill workflow, one route might require a supplier match and a nonempty invoice number. Another route can collect records that need a person’s attention.

Choose the route mode offered by your builder deliberately. Running the first matching branch and running every matching branch have different effects. Include an otherwise/no-match path where the business rule needs one.

Test a matching sample, a nonmatching sample and a sample with a missing value. A comparison against an empty string is different from a comparison against an absent field.

## ​Process a list

Add a loop and map the list to its items input. Configure the actions inside the loop using the current item. A loop over three supplier records should use a different supplier for each iteration.

Check the list’s size before adding actions that write or send. An unexpectedly large result can consume API quota or create hundreds of messages.

## ​Pauses and delays

Use a delay for a time-based pause and a human-input/wait action for a decision. Confirm the deployment’s pause lifetime and how the mission resumes. See human review (https://docs.sydekyks.com/flows/human-review) and limits (https://docs.sydekyks.com/install/reference/limits).

## ​Avoid duplicates

Before creating a record inside a loop, look up its stable business identifier. Decide what to do if it already exists. If an external write succeeds but a later step fails, retrying can otherwise create a second record.
