> ## Documentation Index
> Fetch the complete documentation index at: https://botmesh.afaya.com.co/llms.txt
> Use this file to discover all available pages before exploring further.

# describeFlows()

> Function exported by @botmesh/core.

## Call Signature

```ts theme={null}
function describeFlows(source, options): FlowGraph;
```

Defined in: [flows/describe.ts:298](https://github.com/andresayac/botmesh/blob/main/packages/core/src/flows/describe.ts#L298)

Describe every registered flow/conversation of a bot (or a plain list of
flows) as a Mermaid flowchart (default) or a JSON graph.

* One Mermaid `subgraph` per DSL flow; its entry node lists the triggers routed
  to it (`bot.use`, `bot.when(trigger, flow)`, …).
* `choose` options are labelled `1) Label` like the menu the user sees; a
  `then` sub-flow is drawn as a nested subgraph that returns to the parent.
* `goto` is a dotted edge to the target; an unregistered target is drawn as a
  `missing: name` node.
* Async conversations are a single node (their body is opaque).
* User text is escaped with Mermaid entity codes, so labels can never break
  out of their node or inject `%%{init}%%` directives.

Node ids are stable and shared by both formats and by `lintFlows()` diagnostics.

### Parameters

| Parameter | Type |
| - | - |
| `source` | [`FlowSource`](https://botmesh.afaya.com.co/api/core/type-aliases/FlowSource) |
| `options` | [`DescribeOptions`](https://botmesh.afaya.com.co/api/core/interfaces/DescribeOptions) & `object` |

### Returns

[`FlowGraph`](https://botmesh.afaya.com.co/api/core/interfaces/FlowGraph)

## Call Signature

```ts theme={null}
function describeFlows(source, options?): string;
```

Defined in: [flows/describe.ts:299](https://github.com/andresayac/botmesh/blob/main/packages/core/src/flows/describe.ts#L299)

Describe every registered flow/conversation of a bot (or a plain list of
flows) as a Mermaid flowchart (default) or a JSON graph.

* One Mermaid `subgraph` per DSL flow; its entry node lists the triggers routed
  to it (`bot.use`, `bot.when(trigger, flow)`, …).
* `choose` options are labelled `1) Label` like the menu the user sees; a
  `then` sub-flow is drawn as a nested subgraph that returns to the parent.
* `goto` is a dotted edge to the target; an unregistered target is drawn as a
  `missing: name` node.
* Async conversations are a single node (their body is opaque).
* User text is escaped with Mermaid entity codes, so labels can never break
  out of their node or inject `%%{init}%%` directives.

Node ids are stable and shared by both formats and by `lintFlows()` diagnostics.

### Parameters

| Parameter | Type |
| - | - |
| `source` | [`FlowSource`](https://botmesh.afaya.com.co/api/core/type-aliases/FlowSource) |
| `options?` | [`DescribeOptions`](https://botmesh.afaya.com.co/api/core/interfaces/DescribeOptions) & `object` |

### Returns

`string`

## Call Signature

```ts theme={null}
function describeFlows(source, options?): string | FlowGraph;
```

Defined in: [flows/describe.ts:300](https://github.com/andresayac/botmesh/blob/main/packages/core/src/flows/describe.ts#L300)

Describe every registered flow/conversation of a bot (or a plain list of
flows) as a Mermaid flowchart (default) or a JSON graph.

* One Mermaid `subgraph` per DSL flow; its entry node lists the triggers routed
  to it (`bot.use`, `bot.when(trigger, flow)`, …).
* `choose` options are labelled `1) Label` like the menu the user sees; a
  `then` sub-flow is drawn as a nested subgraph that returns to the parent.
* `goto` is a dotted edge to the target; an unregistered target is drawn as a
  `missing: name` node.
* Async conversations are a single node (their body is opaque).
* User text is escaped with Mermaid entity codes, so labels can never break
  out of their node or inject `%%{init}%%` directives.

Node ids are stable and shared by both formats and by `lintFlows()` diagnostics.

### Parameters

| Parameter | Type |
| - | - |
| `source` | [`FlowSource`](https://botmesh.afaya.com.co/api/core/type-aliases/FlowSource) |
| `options?` | [`DescribeOptions`](https://botmesh.afaya.com.co/api/core/interfaces/DescribeOptions) |

### Returns

`string` | [`FlowGraph`](https://botmesh.afaya.com.co/api/core/interfaces/FlowGraph)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.