|
21 | 21 |
|
22 | 22 | `@flowiseai/agentflow` is a React-based flow editor for creating AI agent workflows. It provides a visual canvas built on ReactFlow for connecting AI agents, LLMs, tools, and logic nodes. |
23 | 23 |
|
| 24 | +## Features |
| 25 | + |
| 26 | +- **Visual Canvas** — Drag-and-drop flow editor built on ReactFlow with zoom, pan, minimap, and fit-to-view controls |
| 27 | +- **15 Built-in Node Types** — Start, Agent, LLM, Condition, Condition Agent, Human Input, Loop, Direct Reply, Custom Function, Tool, Retriever, Sticky Note, HTTP, Iteration, and Execute Flow |
| 28 | +- **Node Editor Dialog** — Modal for editing node parameters with dynamic input types (text, number, boolean, dropdown, arrays, async options) |
| 29 | +- **Rich Text Editor** — TipTap-based editor with syntax highlighting for JavaScript, TypeScript, Python, and JSON (lazy-loaded) |
| 30 | +- **Specialized Input Components** — Condition builder, messages input (role + content), and structured output schema builder |
| 31 | +- **AI Flow Generator** — Generate flows from natural language descriptions with model selection |
| 32 | +- **Flow Validation** — Detects empty flows, missing start nodes, disconnected nodes, cycles, hanging edges, and per-node input errors with visual feedback |
| 33 | +- **Dark Mode** — Full light/dark theme support via design tokens and CSS variables |
| 34 | +- **Read-Only Mode** — Disable editing for view-only embedding |
| 35 | +- **Custom Rendering** — Replace the default header and node palette with your own components via render props |
| 36 | +- **Imperative API** — Programmatic control via ref (`getFlow`, `validate`, `fitView`, `clear`, `addNode`, `toJSON`) |
| 37 | +- **Request Interceptor** — Customize outgoing API requests (headers, credentials) via an Axios interceptor callback |
| 38 | +- **Keyboard Shortcuts** — Cmd/Ctrl+S to save |
| 39 | + |
24 | 40 | ## Installation |
25 | 41 |
|
26 | 42 | ```bash |
@@ -139,10 +155,48 @@ The `requestInterceptor` callback runs inside the Axios request pipeline and has |
139 | 155 | - Follow the **principle of least privilege** — only read or modify the specific config properties you need (e.g., `withCredentials`, custom headers). |
140 | 156 | - If the interceptor throws, the error is caught, logged, and the **original unmodified config** is used so the request still proceeds safely. |
141 | 157 |
|
| 158 | +### Node Types |
| 159 | + |
| 160 | +The following node types are available in the palette by default. Use the `components` prop to restrict which types are shown. |
| 161 | + |
| 162 | +<!-- prettier-ignore --> |
| 163 | +| Node Type | Description | |
| 164 | +| -------------------------- | ------------------------------------ | |
| 165 | +| `startAgentflow` | Entry point (required, always shown) | |
| 166 | +| `agentAgentflow` | AI agent execution | |
| 167 | +| `llmAgentflow` | LLM / language model call | |
| 168 | +| `conditionAgentflow` | Conditional branching | |
| 169 | +| `conditionAgentAgentflow` | Agent-level conditional branching | |
| 170 | +| `humanInputAgentflow` | Wait for user input | |
| 171 | +| `loopAgentflow` | Loop / iteration | |
| 172 | +| `directReplyAgentflow` | Direct response to user | |
| 173 | +| `customFunctionAgentflow` | Custom JavaScript function | |
| 174 | +| `toolAgentflow` | Tool integration | |
| 175 | +| `retrieverAgentflow` | Data retrieval | |
| 176 | +| `stickyNoteAgentflow` | Canvas annotation (not connectable) | |
| 177 | +| `httpAgentflow` | HTTP request | |
| 178 | +| `iterationAgentflow` | Iteration / map-reduce container | |
| 179 | +| `executeFlowAgentflow` | Execute a sub-flow | |
| 180 | + |
142 | 181 | ### Design Note |
143 | 182 |
|
144 | 183 | `<Agentflow>` is an **uncontrolled component**. The `initialFlow` prop seeds the canvas state on mount, but the component owns its own state afterward. Use the `ref` for imperative access and `onFlowChange` to observe changes. |
145 | 184 |
|
| 185 | +## Exports |
| 186 | + |
| 187 | +Beyond the main `<Agentflow>` component, the package exports utilities for advanced usage: |
| 188 | + |
| 189 | +```ts |
| 190 | +// Main component and provider |
| 191 | +// Types |
| 192 | + |
| 193 | +// Hooks |
| 194 | +// Validation |
| 195 | +// Node utilities |
| 196 | + |
| 197 | +// Field visibility helpers |
| 198 | +``` |
| 199 | + |
146 | 200 | ## Development |
147 | 201 |
|
148 | 202 | ```bash |
|
0 commit comments