# Flowise Designer

> Flowise Flow Generator

- Skill: `scholarly360/flowise-designer` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add scholarly360/flowise-designer`
- Raw SKILL.md: https://api.skillmd.com/api/skills/scholarly360/flowise-designer/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: scholarly360 (https://skillmd.com/u/scholarly360)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/scholarly360/flowise-designer

---


# Flowise Flow Generator

Generate production-ready Flowise **Chatflow** and **AgentFlow V2** JSON files that can be imported directly into Flowise via **Import Chatflow** or the API (`POST /api/v1/chatflows`).

## Quick Decision: Chatflow vs AgentFlow V2?

| Use **Chatflow** when… | Use **AgentFlow V2** when… |
|---|---|
| Simple LLM chain or RAG pipeline | Multi-step orchestration with branching |
| Single agent with tools | Human-in-the-loop / approval steps |
| Conversational memory + retrieval | Parallel paths / conditional logic |
| Standard LangChain pattern | Stateful flows using `$flow.state` |
| User doesn't specify | User says "agent flow", "multi-step", "branching" |

If the user doesn't specify, **default to Chatflow** for simple use cases and AgentFlow V2 for anything with branching, conditions, or multi-step orchestration.

---

## Step 1 — Understand the Request

Gather (ask if not provided):
- **Goal**: What should the flow do?
- **LLM**: Which model? (OpenAI, Anthropic, Ollama, Groq, etc.)
- **Components needed**: Memory? Vector store? Tools? Document loaders?
- **Flow type**: Chatflow or AgentFlow V2?
- **Credentials**: Which API keys will be needed (note them but leave `credential: ""`)

---

## Step 2 — Design the Architecture

Before writing JSON, sketch the node graph mentally:
1. Identify all **nodes** needed (LLM, chain/agent, memory, tools, retriever, embeddings, etc.)
2. Identify **connections** between nodes (which output plugs into which input)
3. Verify **type compatibility** — source `baseClasses` must intersect target anchor `type`
4. Assign **node IDs** following pattern `{nodeName}_{index}` (e.g. `chatOpenAI_0`, `pinecone_0`)
5. Plan **layout positions** — space nodes ~400px apart horizontally, arrange left-to-right by data flow

---

## Step 3 — Generate the JSON

### Top-Level Structure (always this shape)

```json
{
  "nodes": [ /* array of node objects */ ],
  "edges": [ /* array of edge objects */ ],
  "viewport": { "x": 0, "y": 0, "zoom": 0.75 }
}
```

### Node Object Template

```json
{
  "id": "{nodeName}_{index}",
  "position": { "x": 0, "y": 0 },
  "type": "customNode",
  "data": {
    "id": "{nodeName}_{index}",
    "label": "Human Readable Label",
    "version": 1,
    "name": "{nodeName}",
    "type": "{ComponentType}",
    "baseClasses": ["{ComponentType}", "...parent classes..."],
    "category": "{Category}",
    "description": "What this node does",
    "inputParams": [ /* form fields — see references/schema.md */ ],
    "inputAnchors": [ /* connectable input sockets */ ],
    "inputs": { /* actual values + instance references */ },
    "outputAnchors": [ /* output sockets */ ],
    "outputs": {},
    "credential": "",
    "selected": false
  },
  "width": 300,
  "height": 500,
  "selected": false,
  "positionAbsolute": { "x": 0, "y": 0 },
  "dragging": false
}
```

**Key rules:**
- `data.id` must equal the node's `id`
- `type` is `"customNode"` for Chatflow; `"agentFlow"` for AgentFlow V2
- `position` and `positionAbsolute` must be identical
- Anchor references in `inputs` use: `"{{otherNodeId.data.instance}}"`
- Leave `credential: ""` — user connects credentials in the UI

### Edge Object Template — Chatflow

```json
{
  "source": "{sourceNodeId}",
  "sourceHandle": "{sourceNodeId}-output-{outputName}-{Type1|Type2|Type3}",
  "target": "{targetNodeId}",
  "targetHandle": "{targetNodeId}-input-{inputName}-{AcceptedType}",
  "type": "buttonedge",
  "id": "{sourceNodeId}-{sourceHandle}-{targetNodeId}-{targetHandle}"
}
```

**Critical rules (Chatflow only):**
- `type` MUST be `"buttonedge"` (not `"default"`, not `"smoothstep"`)
- `sourceHandle` format: `{nodeId}-output-{name}-{BaseClass1|BaseClass2|...}`
- `targetHandle` format: `{nodeId}-input-{name}-{AcceptedBaseClass}`
- `id` = concatenation of `{source}-{sourceHandle}-{target}-{targetHandle}`
- Connection is valid only if source `baseClasses` ∩ target anchor `type` is non-empty

### Edge Object Template — AgentFlow V2

```json
{
  "source": "{sourceNodeId}",
  "sourceHandle": "{sourceNodeId}-output-{outputName}",
  "target": "{targetNodeId}",
  "targetHandle": "{targetNodeId}",
  "data": { "sourceColor": "{hexColor}", "targetColor": "{hexColor}", "isHumanInput": false },
  "type": "agentFlow",
  "id": "{sourceNodeId}-{sourceHandle}-{targetNodeId}-{targetHandle}"
}
```

**Critical rules (AgentFlow V2 only):**
- `type` MUST be `"agentFlow"` — NOT `"buttonedge"`
- `sourceHandle` format: `{nodeId}-output-{outputName}` — no type classes appended
- `targetHandle` format: just the target node ID — no `-input-` path
- `data` object is required: set `sourceColor`/`targetColor` to node hex colors (see `references/schema.md` Section 8 table); set `isHumanInput: true` only for edges from a HumanInput node
- `id` = concatenation of `{source}-{sourceHandle}-{target}-{targetHandle}`

---

## Step 4 — Output & Delivery

1. Generate the complete, valid JSON
2. Save it as `{flow-name}.json` using `create_file` to `/mnt/user-data/outputs/`
3. Present the file with `present_files`
4. Tell the user: **Flowise → Add New → Import Chatflow → select the file** (or drag-and-drop)
5. Remind them to connect their credentials in the node settings after import

---

## Reference Files

Read these when you need detailed schema information:

- **`references/schema.md`** — Full node `data` schema, all inputParam types, anchor id formats, AgentFlow V2 differences, common gotchas
- **`references/nodes.md`** — Ready-to-use node templates for every major category: Chat Models, LLMs, Chains, Agents, Tools, Vector Stores, Memory, Embeddings, Document Loaders, Text Splitters, Output Parsers, AgentFlow V2 nodes

**When to read them:**
- `references/schema.md` → when you need to verify field formats, param types, or AgentFlow V2 specifics
- `references/nodes.md` → always — copy node templates from here rather than generating from memory. Node schemas must be exact.

---

## Common Patterns (Quick Reference)

### Pattern A: Simple Conversational RAG
`ChatModel → ConversationalRetrievalQAChain ← VectorStoreRetriever ← [Embeddings + VectorStore ← DocumentLoader ← TextSplitter]`

### Pattern B: Tool Agent
`ChatModel → ToolAgent ← [Tool1, Tool2, ...] ← Memory (optional)`

### Pattern C: AgentFlow V2 Linear
`Start → LLM → DirectReply`

### Pattern D: AgentFlow V2 with Condition
`Start → Agent → Condition → [Path A: DirectReply] / [Path B: HumanInput → Agent → DirectReply]`

---

## Validation Checklist

Before outputting the final JSON, verify:
- [ ] Every `data.id` matches its node `id`
- [ ] Every `position` matches `positionAbsolute`
- [ ] Chatflow edges: `"type": "buttonedge"` with full `{nodeId}-output-{name}-{Types}` / `{nodeId}-input-{name}-{Type}` handles
- [ ] AgentFlow V2 edges: `"type": "agentFlow"`, `targetHandle` = node ID only, `data` color object present
- [ ] All edge `sourceHandle` / `targetHandle` ids are correct and consistent with their nodes' anchor ids
- [ ] All `inputs` references use `{{nodeId.data.instance}}` format
- [ ] `credential: ""` on all nodes (not a real credential value)
- [ ] No circular dependencies in Chatflows
- [ ] AgentFlow V2: `type: "agentFlow"` on node wrappers, includes a `startAgentflow_0` node
- [ ] JSON is valid (balanced brackets, proper commas, no trailing commas)
