> For the complete documentation index, see [llms.txt](https://supernova-developers.gitbook.io/supernova-dsm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://supernova-developers.gitbook.io/supernova-dsm/pulsar-language/flows.md).

# Flows

Flows refer to definition structures that control the flow of execution - conditions, loops, tree-traversals, and others. Flows start with `{[` and end with `]}` tags respectively, and must be closed with `{[/]}`:

```
{[ for name in names ]}
- {{ name }}
{[/]}
```

Some flows change or enhance data inside the blocks they define. In the example above, the value of the property `name` will always be different with each pass of the loop. When running with appropriate data (`names = [primary, secondary, ternary]`), the output will look like this:

```
- primary
- secondary
- ternary
```

### Shorthand syntax

In some cases, the flow doesn't form a block - that is, it doesn't have a body that it can execute. One such example would be a variable definition:

```
{[ const numberOfPeople = 10 /]}
```

In this case, you can use shorthand flow syntax to immediately close the flow without a body. You can close any flow using the shorthand syntax, indicating that you are not interested in the body at all.

### Available Control Flows

**Condition flows**

* [If / Else If / Else](/supernova-dsm/pulsar-language/flows/if-else-if-else.md)
* [Switch / Case / Default](/supernova-dsm/pulsar-language/flows/switch-case-default.md)

**Loops**

* [For](/supernova-dsm/pulsar-language/flows/for.md)
* [Map](/supernova-dsm/pulsar-language/flows/map.md)
* [Traverse](/supernova-dsm/pulsar-language/flows/traverse.md)

**Variables**

* [Let / Const / Set / Global](/supernova-dsm/pulsar-language/flows/var-let-set-global.md)

**Manipulating and using blueprints**

* [Inject](/supernova-dsm/pulsar-language/flows/inject.md)
* [Emit](/supernova-dsm/pulsar-language/flows/emit.md)

**Debugging**

* [Log](/supernova-dsm/pulsar-language/flows/log.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://supernova-developers.gitbook.io/supernova-dsm/pulsar-language/flows.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
