# Flows

Flows are the core orchestration mechanism in MindedJS that define how your AI agent processes conversations. A flow represents a complete conversation pathway from trigger to completion, consisting of nodes (processing units), edges (routing logic), and memory (shared state).

## Flow Structure

Every flow follows this YAML structure:

```yaml
id: flow-id                    # Unique flow identifier
name: Flow Name                # Human-readable flow name
nodes:                         # Array of processing nodes
  - type: trigger
    name: node-name
    displayName: Node Name
    # ... node-specific properties

edges:                         # Array of routing connections
  - source: source-node-name
    target: target-node-name
    type: stepForward
    # ... edge-specific properties
```

### Flow Properties

* `id` (string, required): Unique identifier for the flow
* `name` (string, required): Human-readable name for the flow
* `nodes` (array, required): Array of node definitions
* `edges` (array, required): Array of edge definitions connecting nodes

## Flow Components

| Component                                                  | Purpose    | Description                                          |
| ---------------------------------------------------------- | ---------- | ---------------------------------------------------- |
| [**Nodes**](https://docs.minded.com/low-code-editor/nodes) | Processing | Handle specific tasks like LLM calls, tool execution |
| [**Edges**](https://docs.minded.com/low-code-editor/edges) | Routing    | Define transitions and decision logic between nodes  |
| [**Memory**](https://docs.minded.com/sdk/memory)           | State      | Shared context that persists throughout the flow     |

## Example

```yaml
id: customer-support-flow
name: Customer Support Flow
nodes:
  - type: trigger
    triggerType: webhook
    name: customer-request
    displayName: Customer Request

  - type: promptNode
    name: support-agent
    displayName: Support Agent
    prompt: |
      You are a helpful customer support agent.
      Assist the customer with their inquiry.

edges:
  - source: customer-request
    target: support-agent
    type: stepForward
```
