> ## 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.

# flow()

> Function exported by @botmesh/core.

```ts theme={null}
function flow<S>(trigger): FlowBuilder<S>;
```

Defined in: [flows/FlowBuilder.ts:255](https://github.com/andresayac/botmesh/blob/main/packages/core/src/flows/FlowBuilder.ts#L255)

Start a DSL flow. `S` optionally declares state the flow expects up front; `.ask()`,
`.choose()` and `.use()` add the keys they capture, so `c.state` is typed without casts.

## Type Parameters

| Type Parameter | Default type |
| - | - |
|  `S` *extends* `object` | [`EmptyFlowState`](https://botmesh.afaya.com.co/api/core/type-aliases/EmptyFlowState) |

## Parameters

| Parameter | Type |
| - | - |
| `trigger` | [`Trigger`](https://botmesh.afaya.com.co/api/core/type-aliases/Trigger) |

## Returns

[`FlowBuilder`](https://botmesh.afaya.com.co/api/core/classes/FlowBuilder)\<`S`>


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