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

# CompiledStep

> Type alias exported by @botmesh/core.

```ts theme={null}
type CompiledStep = 
  | {
  kind: "say";
  text: string | DynamicText;
  delayMs?: number;
}
  | {
  kind: "ask";
  text: string | DynamicText;
  stateKey: string;
  opts?: CompiledAskOptions;
  delayMs?: number;
}
  | {
  kind: "do";
  fn: FlowAction;
  media?: {
     source: string;
     caption?: string;
  };
}
  | {
  kind: "choose";
  prompt: string;
  options: Record<string, CompiledChooseOption>;
  stateKey?: string;
  opts?: WaitOptions;
  delayMs?: number;
}
  | {
  kind: "goto";
  target: string;
}
  | {
  kind: "media";
  type: FlowMediaKind;
  source: FlowMediaSource;
  caption?: string;
  opts?: Omit<FlowMediaOptions, "delay">;
  delayMs?: number;
}
  | {
  kind: "guard";
  check: FlowGuard;
  message?: string | DynamicText;
  redirect?: string;
}
  | {
  kind: "use";
  flow: CompiledFlow;
}
  | {
  kind: "delay";
  ms: number;
}
  | {
  kind: "form";
  form: FormDefinition;
  opts?: FormStepOptions;
};
```

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

One step of a [CompiledFlow](https://botmesh.afaya.com.co/api/core/interfaces/CompiledFlow.md).

## Union Members

### Type Literal

```ts theme={null}
{
  kind: "say";
  text: string | DynamicText;
  delayMs?: number;
}
```

***

### Type Literal

```ts theme={null}
{
  kind: "ask";
  text: string | DynamicText;
  stateKey: string;
  opts?: CompiledAskOptions;
  delayMs?: number;
}
```

***

### Type Literal

```ts theme={null}
{
  kind: "do";
  fn: FlowAction;
  media?: {
     source: string;
     caption?: string;
  };
}
```

| Name | Type | Description | Defined in |
| - | - | - | - |
| `kind` | `"do"` | - | [flows/FlowBuilder.ts:213](https://github.com/andresayac/botmesh/blob/main/packages/core/src/flows/FlowBuilder.ts#L213) |
| `fn` | [`FlowAction`](https://botmesh.afaya.com.co/api/core/type-aliases/FlowAction) | - | [flows/FlowBuilder.ts:214](https://github.com/andresayac/botmesh/blob/main/packages/core/src/flows/FlowBuilder.ts#L214) |
| `media?` | `object` | Legacy tag (flows compiled by older versions); `.media()` now compiles to a `media` step. | [flows/FlowBuilder.ts:216](https://github.com/andresayac/botmesh/blob/main/packages/core/src/flows/FlowBuilder.ts#L216) |
| `media.source` | `string` | - | [flows/FlowBuilder.ts:216](https://github.com/andresayac/botmesh/blob/main/packages/core/src/flows/FlowBuilder.ts#L216) |
| `media.caption?` | `string` | - | [flows/FlowBuilder.ts:216](https://github.com/andresayac/botmesh/blob/main/packages/core/src/flows/FlowBuilder.ts#L216) |

***

### Type Literal

```ts theme={null}
{
  kind: "choose";
  prompt: string;
  options: Record<string, CompiledChooseOption>;
  stateKey?: string;
  opts?: WaitOptions;
  delayMs?: number;
}
```

***

### Type Literal

```ts theme={null}
{
  kind: "goto";
  target: string;
}
```

***

### Type Literal

```ts theme={null}
{
  kind: "media";
  type: FlowMediaKind;
  source: FlowMediaSource;
  caption?: string;
  opts?: Omit<FlowMediaOptions, "delay">;
  delayMs?: number;
}
```

***

### Type Literal

```ts theme={null}
{
  kind: "guard";
  check: FlowGuard;
  message?: string | DynamicText;
  redirect?: string;
}
```

***

### Type Literal

```ts theme={null}
{
  kind: "use";
  flow: CompiledFlow;
}
```

***

### Type Literal

```ts theme={null}
{
  kind: "delay";
  ms: number;
}
```

***

### Type Literal

```ts theme={null}
{
  kind: "form";
  form: FormDefinition;
  opts?: FormStepOptions;
}
```

`.form()`: a native form, or one question per field on providers without forms.


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