> For the complete documentation index, see [llms.txt](https://docs.chatlayer.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chatlayer.ai/buildabot/tips-and-best-practices/reuse-flows.md).

# Reuse flows

For a lot of bots built on our platform, the answer to a user's question depends on the information you know about that user. This information, such as which type of customer they are, which sort of subscription they have and so on, can be gathered through an API, but also directly in the flow itself.

For example:

![](/files/-M-PYFB2IB3unvAYCRut)

In the flow above, the answer to the user's question depends on the type of customer they are. However, the customer type is important for the answer to a lot of different questions a user might have. We don't want to show the same question every time our user asks a question like this. Instead we want to store that in one place.

In this tutorial, you will learn how to create a reusable flow, how to trigger it, and how to return to the original point in the flow.

1. Create a block that links to an intent that needs a specific answer. Link this  block with a 'Go To' to the flow you want to reuse. Add a variable of the type block and give it a name, like "reuseFlow." and link to a block to return to once the flow is finished.

{% hint style="info" %}
You can create two types of variables on our platform: text variables, which allow you to store data in the session of the user, and block variables, that allow you to store a variable. \
Read more about variables [here](broken://pages/-LLTwJA9WiK4ksc3r6ZI).
{% endhint %}

![](/files/-M-PjFY_o5Sm_fFPmZK_)

2\. Create the flow you want to reuse and gather the variables you need from the customer

3\. Add the end of this flow, add a new 'Action' block, and add a 'Go to variable block' plugin. Fill in the block variable to return to in this flow

![](/files/-M-PnfDaHHo2X-h64tu0)

4\. When a user reaches this part of the flow, they will return to the original block that was defined in the reuseFlow variable.

The flow used in the example above looks like this:

![](/files/-M-PonJLTxK3F7fnfTK4)


---

# 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.chatlayer.ai/buildabot/tips-and-best-practices/reuse-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.
