> For the complete documentation index, see [llms.txt](https://docs.cosmocloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cosmocloud.io/flow-builder.md).

# Flow Builder

Cosmocloud's Flow Builder is one of the most interesting and exciting parts of using Cosmocloud. This is the **main engine** that powers custom logics in APIs, SubFlows and every other place where you need some logic based processing to be done.

<figure><img src="/files/zezQaYcbWadCMDIB8Xvk" alt=""><figcaption></figcaption></figure>

## Flow Types in Cosmocloud

### APIs

REST APIs are the essence of Backend Development, the most used way for your frontend (client) to talk to your backend layer. Every API has it's own flow which you can customise using the Flow Builder.

{% hint style="info" %}
Checkout more on building APIs [here](/resources/apis.md).
{% endhint %}

### SubFlows

SubFlow in Cosmocloud provides modular approach to build reusable piece of flow. It helps you to build a piece of code once and plug it in existing flow.

{% hint style="info" %}
Checkout more on SubFlows [here](/resources/subflows.md).
{% endhint %}

## Flow Builder Basic Concepts

### Nodes

Nodes are the individual boxes that represent one single functional component of your flow. Your flow would have multiple boxes linked together in a **flowchart** mode to define your APIs flow logic.

### Edges

An edge is the **connection path** between 2 nodes. This edge informs the flow of processing order of your APIs nodes.

Sometimes, you will also find more helpful actions on your Edges, to either add more nodes or more information about the edge / flow in that particular context.

## Adding new Nodes

There are 2 ways to add new Nodes in your Flow -

1. You can add new nodes into the flow by clicking the **Add Node** box at the end of every branch of the flowchart, excluding when your flow is finished with a `Response` node.
2. You can also add a node **between any 2 nodes** by clicked in **+** icon over the edge connecting the 2 nodes.

## Deleting any Node

You can click on the **X** delete icon on any node to delete that particular node from the flow.

{% hint style="warning" %}
There are some nodes which cannot be deleted, such as Trigger Nodes, Executor Node, Placeholder Nodes, etc.
{% endhint %}


---

# 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://docs.cosmocloud.io/flow-builder.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.
