> ## Documentation Index
> Fetch the complete documentation index at: https://openchat-api-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction to flows

> OpenCopilot Flows Definition

By default, OpenCopilot attempts to map the user's request to an action (or actions) automatically, and this works well for most simple use cases. However, if your backend contains flows that are not straightforward or intuitive, you may need to define these flows using OpenCopilot's flows.

<Card title="Flows are optional" icon="lightbulb" iconType="duotone" color="#ca8b04">
  Implementing them will give the copilot the ability to execute complex flows/cases. if your app
  only serve simple CRUD operations, then you might not need to use the flows.
</Card>

## What is a Flow?

A flow consists of a series of steps, where each step represents an API call to your backend (action). Each flow has a name and description to guide the copilot in determining when to invoke it based on the user's request.

For example, imagine that your system includes an "add to cart" functionality, which involves calling multiple endpoints. You may want your copilot to handle user requests that require this functionality. To achieve this, you need to define a flow flows editor

![Conversion](https://mintlify.s3-us-west-1.amazonaws.com/openchat-api-docs/images/example-flow.png)

**In this example:**

1. The user requested the copilot to add 3 sunglasses to the cart.

2. OpenCopilot automatically mapped the user request to the pre-defined "create cart" flow, passing the necessary parameters based on the user request.

3. OpenCopilot will handle loops, conditions, and other complex steps by itself, so you don't have to worry about them. (for example: creating a cart with 3 items, or 100 items)
