Logo Flow Nodes

Flow Nodes

Tổ chức
Cognigy
flow-nodes

Use when adding, editing or debugging custom logic inside a Cognigy tool branch with manage_flow_nodes (code, HTTP Request, if/else and other nodes), or when rendering/visualizing a flow as a diagram — supported node types, config schemas, placement rules, the tool-first workflow, and the render operation.

Tổng quan

Nhà phát hànhCognigy
Kho mãcognigy-plugin
Tên kỹ năngflow-nodes
Sao
20
Bản fork
14
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Đầy đủ trong hướng dẫn

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được Cognigy công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Flow Nodes trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/Cognigy/cognigy-plugin/tree/main/plugin/skills/flow-nodes
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Cognigy/cognigy-plugin.git /tmp/cognigy-plugin
mkdir -p .claude/skills
cp -r /tmp/cognigy-plugin/plugin/skills/flow-nodes .claude/skills/flow-nodes
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Flow Nodes trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Flow Nodes ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Flow Nodes không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Flow Node Reference

Flow nodes belong to legacy AI Agents and other flows. AI Agents built with manage_agent have no flow to edit; their custom logic goes into tools and skills (manage_agent_components).

Use manage_flow_nodes to add logic nodes inside tool branches only. Nodes are helpers for tools — they must ALWAYS be created under a tool, never as standalone pre-agent nodes.

CRITICAL: NEVER add nodes before the AI Agent Job node. Pre-agent nodes cause conversation loops and break the agent's ability to orchestrate. ALL logic — including authentication, data collection, greetings, and conditional behavior — must be implemented as agent tools.

Voice exception — Set Session Config: The one node that should run before the AI Agent node is a setSessionConfig (Set Session Config) node, and only in voice flows. It applies per-session speech settings (barge-in, ASR, STT/TTS, input timeouts) and must be the first node. The audit_voice_agent tool checks for this and can create it by prepending before the AI Agent node. Do not add any other pre-agent nodes.

LLM Prompt exception: llmPrompt (llmPromptV2) is a top-level raw LLM node for flows with no AI Agent node. Create it only when the user asks for an LLM Prompt node by name; otherwise use the AI Agent default. Reading or updating existing llmPromptV2 nodes is fine. See the LLM Prompt section.

Quick Start (tool-first workflow)

1. Create a tool — create_tool { aiAgentId, toolType: 'tool', name: 'Process Order', config: { toolId: 'process_order', description: 'Process a customer order' } } → returns toolNodeId
2. Get the flowId — from create_ai_agent response, or list_resources { resourceType: 'flow', projectId }
3. Add a node inside the tool — manage_flow_nodes { operation: 'create', flowId, parentNodeId: '<toolNodeId>', mode: 'appendChild', nodeType: 'code', label: 'Validate Order', config: { code: '...' } }
4. Add more nodes — manage_flow_nodes { operation: 'create', flowId, parentNodeId: '<previousNodeId>', mode: 'append', nodeType: 'say', label: 'Confirm', config: { text: 'Order processed!' } }
5. List all nodes — manage_flow_nodes { operation: 'list', flowId } (id, type, label, parentId, isDisabled when true — no config)
   Read one node with its config before editing — manage_flow_nodes { operation: 'get', flowId, nodeId: '<id>' }
6. Update a node — manage_flow_nodes { operation: 'update', flowId, nodeId: '<id>', config: { text: 'Updated!' } }
7. Delete a node — manage_flow_nodes { operation: 'delete', flowId, nodeId: '<id>' }

Placement

Nodes MUST be placed inside tool branches using parentNodeId and mode.

  • Inside a tool (primary use case): Set parentNodeId to the tool node ID (from create_tool) and mode to appendChild. The handler automatically places the node in the correct execution chain (before the Resolve Tool Action node). Both appendChild and append work correctly when targeting a tool node.
  • After a sibling: Set parentNodeId to an existing node within the branch and mode to append to place after it.

Supported Node Types

xApp nodes (initAppSession, showXAppAdaptiveCard, showXAppHtml, setXAppState, getXAppSessionPin) are also available via manage_flow_nodes. They build interactive HTML / Adaptive Card mini-apps. initAppSession must precede any other xApp node. See the xapps guide for details.

say — Send Message

Category: message

Send a text message to the user. Supports rich output types.

Config:

FieldTypeRequiredDescription
textstringYesMessage text. Supports CognigyScript: {{context.name}}
quickRepliesarrayNoQuick reply buttons: [{ title, payload }]. contentType defaults to postback (sends payload as the user's text). For a Trigger Intent reply use { title, contentType: "trigger_intent", intentName: "<Intent name>" } with no payload — intentName is the plain intent name (also for an intent in an attached flow), and clicking it sets input.intent
buttonsarrayNoPersistent buttons: [{ title, type, value }]
galleryobjectNoImage gallery/carousel
listobjectNoList output
audioobjectNoAudio output { url }
videoobjectNoVideo output { url }
imageobjectNoImage output { url }
adaptiveCardobjectNoMicrosoft Adaptive Card JSON (the card object itself — the plugin wraps it for the Designer). text is still required; pass "" for a card-only message
dataobjectNoCustom data payload attached to the message

Example:

json
{
  "operation": "create",
  "flowId": "<flowId>",
  "nodeType": "say",
  "label": "Welcome Message",
  "config": {
    "text": "Welcome! How can I help you today?",
    "quickReplies": [
      { "title": "Check order status", "payload": "check_order" },
      { "title": "Talk to human", "payload": "handover" }
    ]
  }
}

continueToAgent — Continue to AI Agent

Category: service

The last node of an AI Agent's pre-turn hook Flow (agent-creation skill, "Pre-turn hook"). It hands the message back to the agent; without it the agent gives no answer. Only allowed in a Flow of kind preTurnFlow. manage_agent { operation: "create_flow", flowType: "preTurn" } places it already; add the nodes that prepare the turn before it (mode: "append" on Start or the previous node).

Config (all optional):

  • text — the message the agent gets (default {{input.text}})
  • dataMode — "forward" (default, passes input.data on) or "custom" (sends customData)
  • turnContext — label → value pairs the agent sees with the message, e.g. { "customer_tier": "{{context.tier}}" } (max 20, values up to 500 characters)
json
{
  "operation": "create",
  "flowId": "<pre-turn flowId>",
  "parentNodeId": "<startNodeId>",
  "mode": "append",
  "nodeType": "continueToAgent",
  "label": "Continue to AI Agent",
  "config": { "turnContext": { "customer_tier": "gold" } }
}

toolResult — Tool Result

Category: service

Ends a Flow that an AI Agent runs through its Execute Tool Flow tool (agent-creation skill, "A Flow as a tool"): its answer is what the tool call returns. The call's arguments are in input.data.toolArgs. Only allowed in a Flow of kind flowExecutionTool; manage_agent { operation: "create_flow", flowType: "tool" } places it already. The first Tool Result that runs answers and stops the Flow.

Config:

  • answer (required) — CognigyScript, e.g. "Order {{input.data.toolArgs.orderId}} ships on {{context.shipDate}}"
  • shareConversationHistory — what the agent sees of the Flow's own messages: "lastExchangeOnly" (default), "fullConversation" or "none"
json
{
  "operation": "update",
  "flowId": "<tool flowId>",
  "nodeId": "<closingNodeId>",
  "config": { "answer": "Order {{input.data.toolArgs.orderId}}: {{context.status}}" }
}

wait — Wait for Input

Category: logic

Stops the flow and waits for the next input, with no timeout. On that input the flow continues at the node after wait, using the same per-session mechanism as question. Unlike question, it stores no answer at input.result: read the incoming message directly (input.text, or input.data for a data payload such as a submitted Adaptive Card).

It only resumes if the session's flow state survives until the next input. It does not resume, and the next input starts the flow at Start, when:

  • the flow is a Tool Flow, which runs once per tool call and keeps no state between turns. Tool branches under an AI Agent node run in the normal session, so they are expected to resume (not yet verified live)
  • the flow is reset between turns. For example, a REST endpoint resets when the user's last flow, entrypoint or locale differs, and a new sessionId also starts fresh

Intended Copilot pattern: say (Adaptive Card with actions) → wait → nodes that read the submission from input.data. Resumption has not been verified end-to-end on the Copilot channel, so test the flow there (or in the Interaction Panel) before relying on it.

Config: none.

json
{
  "operation": "create",
  "flowId": "<flowId>",
  "parentNodeId": "<adaptiveCardSayNodeId>",
  "mode": "append",
  "nodeType": "wait",
  "label": "Wait for Input"
}

cxOneSendCopilotStatus — Send Status to CXone Copilot

Category: handover (extension @cognigy/cxone, beta; only available when the CXone Send Copilot Status feature is enabled for the organisation)

Reports the workflow outcome to CXone Agent Copilot. Without it Copilot never learns that the workflow finished or failed.

Config:

FieldTypeRequiredDescription
statusstringYesComplete or Failed (case-sensitive)
dataobjectNoOptional JSON object sent with the status
json
{
  "operation": "create",
  "flowId": "<flowId>",
  "parentNodeId": "<precedingNodeId>",
  "mode": "append",
  "nodeType": "cxOneSendCopilotStatus",
  "label": "Send Status - Complete",
  "config": { "status": "Complete" }
}

question — Ask Question

Category: message

Ask the user a question. The answer is captured and stored.

Config:

FieldTypeRequiredDescription
textstringYesQuestion text
typestringYesExpected answer type: text, yesNo, email, number, date, intent, regex, data
quickRepliesarrayNoSuggested answers. Same item shape as the say node, including Trigger Intent replies
storeResultInContextbooleanNoUI: Result storage → Context. Also store the answer in context under contextKey
contextKeystringNoContext key for the answer (platform default result). Dot paths work, e.g. temp.dataCapture.memberId
storeInContactProfilebooleanNoUI: Result storage → Contact Profile. Also store the answer in the contact profile under profileKey
profileKeystringNoContact profile field for the answer, e.g. age
resultLocationstringNoUI: Advanced → Result Location — where the node reads the answer from, overriding the user's input. Leave it unset; it is not where the answer is stored. A value such as context.first makes the question reject valid answers and reprompt

The answer is always available in input.result. To keep it for later turns, set storeResultInContext: true and contextKey, not resultLocation.

Example:

json
{
  "operation": "create",
  "flowId": "<flowId>",
  "nodeType": "question",
  "label": "Ask Email",
  "config": {
    "text": "What is your email address?",
    "type": "email",
    "storeResultInContext": true,
    "contextKey": "email"
  }
}

ifThenElse — Conditional Branch

Category: logic

Branch the flow based on a CognigyScript condition. Auto-creates then and else child nodes.

Config:

FieldTypeRequiredDescription
conditionstringYesCognigyScript expression (without {{ }}), e.g. input.intent === "order_status" or context.isVIP === true

Example:

json
{
  "operation": "create",
  "flowId": "<flowId>",
  "nodeType": "ifThenElse",
  "label": "Check VIP",
  "config": {
    "condition": "context.isVIP === true"
  }
}

Adding nodes inside branches: See Branching nodes below.


lookup — Switch / Multi-Branch

Category: logic

Switch on intent, state, type, or a CognigyScript expression. Auto-creates case and default child nodes.

Config:

FieldTypeRequiredDescription
typestringYesLookup type: intent, state, type, cognigyScript
conditionstringNoCognigyScript expression (when type is cognigyScript)

Updating case values: Use the cases convenience array on the parent switch node update — see Updating case values below.

Adding nodes inside branches: See Branching nodes below.


setSessionContext — Set Context

Category: data

Store a key-value pair in the persistent session context. Each node stores one entry. To store multiple values, create multiple setSessionContext nodes.

Config:

FieldTypeRequiredDescription
keystringYesContext key name
valuestringYesValue to store. Supports CognigyScript: {{input.result}}
modestringNosimple (default) sets context[key] to value. array (the UI's Array mode) adds value to an array at context[key]; value can be a plain value or a JSON string, e.g. { "key": "items", "value": "item", "mode": "array" }
contextEntriesarrayNoConvenience alias — [{ key, value }]. Only the first entry is used; create separate nodes for additional entries. Always uses mode: "simple"; pass key/value/mode directly for Array mode.

Example — using key/value directly (preferred):

json
{
  "operation": "create",
  "flowId": "<flowId>",
  "nodeType": "setSessionContext",
  "label": "Save User Name",
  "config": {
    "key": "userName",
    "value": "{{input.result}}"
  }
}

Example — using contextEntries alias:

json
{
  "operation": "create",
  "flowId": "<flowId>",
  "nodeType": "setSessionContext",
  "label": "Save User Name",
  "config": {
    "contextEntries": [{ "key": "userName", "value": "{{input.result}}" }]
  }
}

Note: Only one key-value pair is stored per node. If you pass multiple entries in contextEntries, only the first is used. Create separate setSessionContext nodes for each value you need to store.


code — Execute Code

Category: data

Run custom TypeScript (a single source string — not multiple files, not HTML). The Cognigy backend transpiles it to JavaScript at save time.

Runtime objects available inside the code:

ObjectWhat it is
inputThe current input — read/write. input.text, input.data, etc.
contextSession-persistent store. Read/write values that survive across turns — context.x = value persists for the session, as does api.addToContext().
profileThe contact profile.
apiThe platform API — api.say(), api.output(), api.addToContext(), api.log(), api.setNextNode(), … (reference). actions.* is the legacy alias of api.*; only api is supported.
modulesPreinstalled modules are globals, not imports: moment, _ (Lodash), xmljs, getTextCleaner() (reference).

Runtime constraints — the Code Node runtime does not have these. manage_flow_nodes and create_tool/update_tool write the code anyway and flag them in _hints.warning; don't use them:

  • api.httpRequest() — exists only in Cognigy Functions, not Code Nodes. Use an HTTP Request node and read input.httprequest.
  • fetch() / XMLHttpRequest — not available in the runtime. Same alternative.
  • require() / import — no module loading; use the globals above.
  • api.setState() / api.getState() / api.resetState() — States are deprecated since 2026.7 and removed in 2026.12. Use Intent Conditions.

Documented footguns (not flagged — just know them):

  • No top-level return — Code nodes are not full functions and the engine rejects it. Mutate input (or context) directly: input.foo = bar; instead of return { foo: bar };.
  • api.deleteContext("a.b") — only removes top-level keys; a dot-path silently does nothing. Use delete context.a.b;.
  • More than 100 api.* calls per execution — the platform aborts the node (limits).

Anything the platform supports is not gated: there is no required code shape, no api.* allowlist, and Date.prototype.toLocaleString() and friends work (the editor's red underline on Date is the browser's type checker, not a runtime error).

Config:

FieldTypeRequiredDescription
codestringYesTypeScript source to execute (the backend enforces a large upper size limit)

Server-computed, read-only (do NOT send these): transpiled (compiled JS output) and hasError (true if the code failed to transpile). get omits transpiled and surfaces hasError.

Read before you edit. list returns no config. To see a node's current code, use get:

json
{ "operation": "get", "flowId": "<flowId>", "nodeId": "<nodeId>" }

Then send the full new code string on update (config is merged; code is replaced wholesale). After a write, a _hints.warning with hasError means the code did not compile — get, fix, and update again.

Create example:

json
{
  "operation": "create",
  "flowId": "<flowId>",
  "nodeType": "code",
  "label": "Format Response",
  "config": {
    "code": "const items = context.cartItems || [];\ninput.cartSummary = items.map((i: { name: string; price: number }) => `${i.name}: $${i.price}`).join('\\n');"
  }
}

goTo — Go To Node/Flow

Category: logic

Jump execution to another flow or a specific node.

Config:

FieldTypeRequiredDescription
flowIdstringNoTarget flow reference ID (for cross-flow jumps)
nodeIdstringNoTarget node ID within the flow
executionModestringNoexecute (default) or goAndDontReturn

sleep — Wait

Category: logic

Pause execution for a duration.

Config:

FieldTypeRequiredDescription
millisecondsnumberYesMilliseconds to wait
delaynumberNoAlias for milliseconds (supported for backward compatibility)

httpRequest — HTTP Request

Category: service

Call an external API.

Config:

FieldTypeRequiredDescription
urlstringYesRequest URL. Supports CognigyScript: https://api.example.com/{{context.endpoint}}
typestringNoHTTP method: GET, POST, PUT, PATCH, DELETE (default: GET)
headersobject or stringNoHeaders as object {"Authorization": "Bearer xxx"} or JSON string
payloadTypestringNojson or text
payloadJSONobjectNoJSON body (when payloadType is json)
payloadTextstringNoText body (when payloadType is text)
contextStorestringNoContext key to store the response (auto-sets storage to context)
inputStorestringNoInput key to store the response (auto-sets storage to input)

Example:

json
{
  "operation": "create",
  "flowId": "<flowId>",
  "nodeType": "httpRequest",
  "label": "Fetch Order",
  "config": {
    "url": "https://api.example.com/orders/{{context.orderId}}",
    "type": "GET",
    "headers": { "Authorization": "Bearer {{context.apiToken}}" },
    "contextStore": "orderData"
  }
}

llmPrompt — LLM Prompt

Category: service

A raw LLM call driven by a freeform system prompt (config.prompt). Supports tools, streaming/storage options, image handling, and custom model options.

STEERING — read first:

  • Create only when the user explicitly asks for an "LLM Prompt" node; otherwise use the AI Agent default. Do not offer it, fall back to it, or ask the user to choose.
  • For a new LLM Prompt agent, use create_ai_agent { agentNodeType: "llmPrompt", systemPrompt }; it provisions project, flow, node, and endpoint. Use manage_flow_nodes create only for existing flows.
  • llmPrompt is top-level, placed after start via mode: "append", and can drive a flow without an aiAgentJob node.
  • prompt is the full persona, job, and guardrail definition. Put required constraints in the prompt itself.
  • The backend auto-creates a non-deletable llmPromptDefault branch and a placeholder tool; the plugin removes the placeholder.
  • These flows have no agent resource: update prompts via manage_flow_nodes update, and address tools with flowId. Only tool, mcp, and http tools are supported.

Config (key fields — get the node for the full set):

FieldTypeRequiredDescription
promptstringYesFreeform system prompt. Supports CognigyScript and the @cognigyRecentConversation / @cognigyRecentUserInputs transcript tags (optionally with a turn limit, e.g. @cognigyRecentConversation:3)
llmProviderReferenceIdstringNoLLM referenceId, or "default" for the project's Generative AI default
storeLocationstringNostream (stream to output), input, or context
immediateOutputbooleanNoOutput the result immediately — applies only with storeLocation: "input" or "context"; with "stream" the result already streams, so the flag is meaningless and must not be sent
inputKey / contextKeystringNoWhere to store the result for input/context storage (default promptResult)
chatTranscriptStepsnumberNoPrevious conversation turns included in the request (default 50)
usePromptModebooleanNoSingle-prompt mode — no conversation context; prompt must be non-empty
temperature / topP / maxTokens / frequencyPenalty / presencePenalty / seednumberNoSampling controls (samplingMethod picks temperature vs topP)
responseFormatstringNodefault, text, or json
toolChoicestringNoauto, required, or none — how tools are selected
useStrictbooleanNoStrict mode for tool argument schemas
processImages / transcriptImageHandlingboolean / stringNoImage attachment handling (minify, drop, keep)
customModelOptions / customRequestOptionsobjectNoProvider-specific overrides (e.g. { "model": "..." }, { "stream": true })
errorHandling / errorMessage / logErrorToSystemstring / string / booleanNocontinue (default), stop, or go-to error handling

Example (only after an explicit user request):

json
{
  "operation": "create",
  "flowId": "<flowId>",
  "nodeType": "llmPrompt",
  "label": "Summarize Conversation",
  "parentNodeId": "<startNodeId or preceding top-level node>",
  "mode": "append",
  "config": {
    "prompt": "A user talked to a chatbot:\n@cognigyRecentConversation\n\nSummarize the conversation in two sentences.",
    "storeLocation": "context",
    "contextKey": "summary"
  }
}

Branching nodes

ifThenElse and lookup nodes auto-create child branch nodes when created:

  • ifThenElse creates then and else child nodes
  • lookup creates case and default child nodes

Placing nodes inside a branch

To add logic inside a branch (e.g. inside the "then" branch of an if/else):

  1. Create the branching node (ifThenElse or lookup)
  2. List nodes to find the auto-created child IDs: manage_flow_nodes { operation: "list", flowId }
  3. Use mode: "append" with parentNodeId set to the branch child node ID

CRITICAL: Do NOT use mode: "appendChild" on branch children (then, else, case, default). It creates orphaned nodes with parentId: null. Always use mode: "append" instead. The handler auto-corrects this when possible, but using append directly is the reliable approach.

Example — add a Say node inside the "then" branch of an ifThenElse

Step 1: Create the ifThenElse node
manage_flow_nodes {
  operation: "create", flowId: "<flowId>",
  parentNodeId: "<toolNodeId>", mode: "appendChild",
  nodeType: "ifThenElse", label: "Check VIP",
  config: { condition: "context.isVIP === true" }
}
→ returns nodeId: "if123..."

Step 2: List nodes to find the auto-created then/else child IDs
manage_flow_nodes { operation: "list", flowId: "<flowId>" }
→ find the "then" child node with parentId matching "if123..."
→ thenNodeId: "then456..."

Step 3: Add a node inside the "then" branch using mode: "append"
manage_flow_nodes {
  operation: "create", flowId: "<flowId>",
  parentNodeId: "then456...", mode: "append",
  nodeType: "say", label: "VIP Greeting",
  config: { text: "Welcome back, VIP!" }
}

Example — add nodes inside a lookup case branch

Step 1: Create the lookup node
manage_flow_nodes {
  operation: "create", flowId: "<flowId>",
  parentNodeId: "<toolNodeId>", mode: "appendChild",
  nodeType: "lookup", label: "Route by Type",
  config: { type: "cognigyScript", condition: "input.category" }
}
→ returns nodeId: "switch123..."

Step 2: List nodes to find the auto-created case/default child IDs
manage_flow_nodes { operation: "list", flowId: "<flowId>" }
→ find case children with parentId matching "switch123..."
→ caseNodeId: "case456...", defaultNodeId: "default789..."

Step 3: Update case values
manage_flow_nodes {
  operation: "update", flowId: "<flowId>",
  nodeId: "switch123...",
  config: { cases: [{ id: "case456...", value: "billing" }] }
}

Step 4: Add a node inside the case branch using mode: "append"
manage_flow_nodes {
  operation: "create", flowId: "<flowId>",
  parentNodeId: "case456...", mode: "append",
  nodeType: "say", label: "Billing Help",
  config: { text: "Let me help with your billing question." }
}

Updating case values

When you create a lookup (switch) node, the case child nodes start with empty values. To set what each case matches:

Option 1 — Update via parent switch with cases array (recommended):

json
{
  "operation": "update",
  "flowId": "<flowId>",
  "nodeId": "<switchNodeId>",
  "config": {
    "cases": [
      { "id": "<caseNodeId1>", "value": "billing" },
      { "id": "<caseNodeId2>", "value": "shipping" }
    ]
  }
}

Option 2 — Update individual case nodes directly:

json
{
  "operation": "update",
  "flowId": "<flowId>",
  "nodeId": "<caseNodeId>",
  "config": { "value": "billing" }
}

The handler sends the correct API format ({ config: { case: { value: "..." } } }) automatically.


Visualizing a flow (render)

manage_flow_nodes { operation: "render", flowId } deterministically serializes the whole flow into a diagram. It is read-only. The engine builds the picture in code, so you never re-derive the graph (no hallucinated edges, ~0 tokens).

Returned fields:

  • ascii — a text tree of the flow (next chain top-to-bottom, children nested). Display it inline in any client, including a terminal.
  • mermaid — a flowchart TD string. Deliver it ONLY as a native Mermaid/diagram artifact (the "Download and open · MERMAID" card). This is the one form that renders zoomably and works on phones.
    • Do NOT wrap it in an HTML page/widget or a generic HTML "visualize" connector — an HTML-embedded diagram is not mobile-friendly.
    • Do NOT paste it as an inline ```mermaid fenced code block — it renders as plain text or a tiny thumbnail.
    • Keep commentary, the legend, and the ascii tree outside the artifact.
  • legend — a key of only the shapes/edges present in this flow (also drawn inside the mermaid as a compact strip and in the HTML panel). Toggle with legend: false.

Options:

  • focus: "<nodeId>" or focus: ["<id1>", "<id2>"] — highlight one or more nodes (e.g. ones you just created/edited) so the user sees how the change fits.
  • format: "ascii" | "mermaid" | "both" (default both).
  • writeHtml: true — also write a self-contained, offline rich HTML graph to a tmp file on the user's own machine (this MCP server runs locally) and open it in the browser automatically. Returns htmlUrl (a file:// link) and htmlPath. The file is already complete on that machine — just hand the user the link; do NOT try to fetch, upload, or regenerate it. Pass openInBrowser: false to only get the link back without opening.

After a node create/update/delete, offer a render once, in one short line (do not render unprompted, do not repeat the offer).


Notes

  • Tool parameters: Inside AI Agent tool branches, the LLM's tool call parameters are available at input.aiAgent.toolArgs, NOT input.data. For example, if the tool defines a city parameter, access it as input.aiAgent.toolArgs.city in Code nodes or {{input.aiAgent.toolArgs.city}} in CognigyScript fields. Under an LLM Prompt (llmPromptV2) node the parameters live at input.llmPrompt.toolArgs instead — input.aiAgent is null there, so reading input.aiAgent.toolArgs returns undefined and the tool runs with no arguments (a silent fallback, no error). For a tool that may run under either node type, read defensively: const args = (input.llmPrompt && input.llmPrompt.toolArgs) || (input.aiAgent && input.aiAgent.toolArgs) || {};.
  • CognigyScript: Use {{expression}} syntax in text/message fields to reference runtime data (input, context, profile). For condition fields (ifThenElse, lookup), use plain expressions without {{ }} — e.g. context.isVIP === true.
  • Node IDs: All node IDs are 24-char hex strings. Get them from manage_flow_nodes { operation: 'list' }.
  • Ordering: Nodes execute top-to-bottom within a branch. Use parentNodeId to control placement.
  • Nodes belong inside tools: ALWAYS create a tool first (create_tool { toolType: "tool" }), then add nodes inside the tool branch using parentNodeId = toolNodeId and mode = appendChild. NEVER add standalone nodes before the AI Agent Job node — this is an anti-pattern that breaks conversations.

Câu hỏi thường gặp

Kỹ năng AI Flow Nodes làm được gì?

Use when adding, editing or debugging custom logic inside a Cognigy tool branch with manage_flow_nodes (code, HTTP Request, if/else and other nodes), or when rendering/visualizing a flow as a diagram — supported node types, config schemas, placement rules, the tool-first workflow, and the render operation.

Vì sao nên dùng Flow Nodes trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Flow Nodes là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Flow Nodes trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/Cognigy/cognigy-plugin/tree/main/plugin/skills/flow-nodes. TypingMind đọc tệp SKILL.md và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Flow Nodes?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Flow Nodes với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Flow Nodes với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Flow Nodes có miễn phí không?

Có. Kỹ năng này được Cognigy phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇