# Section

Your [automation script](/docs/manual/automation/scripts.md) will likely consist of many different [actions](/docs/manual/automation/scripts/action.md). These actions can be grouped into larger logical units — for example, "Depart from station A" or "Stop at station 1". A section provides this grouping and helps you maintain a clear overview of the different steps in your script.

<figure><img src="/files/BjBsCD5f9HC5YWAspUXE" alt="" width="188"><figcaption></figcaption></figure>

## Disabled

A section can be disabled. Disabled sections are skipped during execution, which is useful for temporarily excluding part of a script without deleting it.

## Execute conditions <a href="#conditional" id="conditional"></a>

A section can be made conditional by configuring conditions, similar to those on [scripts](/docs/manual/automation/scripts.md) and [actions](/docs/manual/automation/scripts/action.md). You can configure whether all (**AND**) or only one (**OR**) condition must be met to execute the section.

Conditions can be based on accessories, feedback sensors, vehicle state, flags, variables, or camera detection. If the conditions are not met, the entire section is skipped.

This allows you to make a section execute only when, for example, a specific turnout is thrown or a sensor is active.

## Repeat <a href="#repeat" id="repeat"></a>

Just like execute conditions, you can define a set of **repeat conditions**. After all actions in the section have been executed, the repeat conditions are evaluated. If they are met, the section runs again from the beginning.

This allows you to create a section that retries as long as, for example, a sensor remains active — useful for "wait and retry" patterns.

{% hint style="info" %}
The repeat conditions are only checked **after** the section has completed a full pass, not continuously during execution.
{% endhint %}

## Actions <a href="#actions" id="actions"></a>

Inside a section, you create [actions](/docs/manual/automation/scripts/action.md) that perform the actual work of the script. You can create, delete, duplicate, and reorder them. The order you see in the app is the execution order of the script.

Actions can be added with the "+" button, or inserted at any position within the section by swiping right on an existing action. The new action will be inserted at that position.


---

# 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://modeltrainscript.gitbook.io/docs/manual/automation/scripts/section.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.
