# Sub Flow

"Sub Flow" organizes steps in the whole Rapidbott/flow.

### Create Sub Flow <a href="#create-sub-flow" id="create-sub-flow"></a>

Navigate "Flows" from the sidebar, click "+ New Sub Flow", choose a flow type, give a name and save.

<figure><img src="https://2144409983-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHbDmB8MlZRo4hzrDiO0X%2Fuploads%2FNA9Rv75n6vBznKKo9Ugi%2FCapture.png?alt=media&#x26;token=2f5fdd77-a7e7-48c2-9588-903e07ac0d94" alt=""><figcaption></figcaption></figure>

| Flow Type      | Description                                                |
| -------------- | ---------------------------------------------------------- |
| Normal Subflow | Varies in channels, basic subflow                          |
| Workflow       | work at the backend without influencing the front end task |
| Function Flow  | perform repetitive tasks                                   |

Click on the subflow to enter and start editing it. For more operations, click on the 3-dots icon. The **Sub Flow Ns** is a unique subflow ID in the Rapidbott.

<div align="left"><figure><img src="https://2144409983-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHbDmB8MlZRo4hzrDiO0X%2Fuploads%2Fg4oy6jG3cihxGrqgGzJr%2Fdownload%20(34).png?alt=media&#x26;token=f126e5d7-75b6-4452-8a9d-9d7722f5bd98" alt=""><figcaption></figcaption></figure></div>

Folders are used to organize subflows.

### Move Steps to Sub Flow <a href="#move-steps-to-sub-flow" id="move-steps-to-sub-flow"></a>

To move a step or multiple steps to another subflow, select the steps first, then you can either

* use the **Move to Subflow** button in the editing panel, or
* copy and paste them

To select multiple steps, hold the **Shift** key, click and drag to cover the steps.

<figure><img src="https://2144409983-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHbDmB8MlZRo4hzrDiO0X%2Fuploads%2FYsN5e3nZDLg0BYwRzyii%2Fworkspace3.ce17a72e.png?alt=media&#x26;token=68564df7-5129-448a-b5bb-98e0c2e9a1ea" alt=""><figcaption></figcaption></figure>

Alternatively, hold **ctrl** key and click steps one by one:

<figure><img src="https://2144409983-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHbDmB8MlZRo4hzrDiO0X%2Fuploads%2FL8a0DxGjiHdMb5owHgrj%2Fworkspace4.58de402e.png?alt=media&#x26;token=53a8752d-115a-4b83-8ede-23b4b1282592" alt=""><figcaption></figcaption></figure>

After selecting multiple steps, editing panel shows. "Select sub flow", then click "Move to sub flow".

{% hint style="info" %}
You will need to select at least 2 steps to create a canvas or move them to other sub flows. So if you have only 1 step to move or put in a canvas, try adding a temporary step to help and discard it after that.
{% endhint %}

<div align="left"><figure><img src="https://2144409983-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHbDmB8MlZRo4hzrDiO0X%2Fuploads%2FTv9GiPbTOLAGxZKku4Im%2Fsubflow1.ff69be06.png?alt=media&#x26;token=4a7c6c1b-0636-420f-bb3c-9f2fba3e052d" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
If you find yourself unable to click "Move to sub flow" after choosing a sub flow, perhaps you included the green **Start Step** in your selection. Because the green start point of any subflow can't be moved to other subflows. You can solve this issue by de-selecting the green start point.
{% endhint %}

To copy and paste, use **Ctrl + C** to copy the selected steps, then go to the destination subflow, use **Ctrl + V** to paste there.

### Call Sub Flow <a href="#call-sub-flow" id="call-sub-flow"></a>

After creating subflows, you can then call a subflow via:

* Goto Step
* Keyword
* Sequence
* Broadcast
* Facebook Widget
* Comment Growth Tool
* Triggers
* Live Chat
* Menu Items
* Inbound Webhooks
* API call
