นำเข้า chatflow ของ Flowise
บท
ร่างตัวอย่าง
คุณ
เขียน
aggrega draft --example import-flowiseจากsource ของsupport-chat.json ซึ่ง
cd import-flowise
chatflow
support-chat.json ที่gpt-4o-mini โหนด Buffer Memory และ
ข้าง.aggrega-config.yaml ที่
# The workspace key marks this directory as the workspace root, so an import run# here writes its drafts beside support-chat.json.workspace: {}# The registry the importer is fetched from the first time an import needs it.default_registry: hub.aggrega.aiและ import-answers.yaml เก็บ
# Values the import could not draft from the source, keyed by the drafted file and the key path inside# it. Write each one beside its key; an import of the same source, and a sync, read them from here and# ask nothing. A secret is never written here: its key asks where the secret comes from — a variable# name, ${NAME}, or the name of a Kubernetes Secret.release.yaml: # Email address of the platform's owner account, read only when values.flow_definition is set. The # step that seeds the chatflow registers this account when the instance has no owner yet, which makes # it the owner, and signs in as it; on an instance that already has one, it names an account allowed # to import chatflows, and the password attached to the owner_password slot is that account's. # Required when values.flow_definition is set: the build halts when it is empty. It has no default. spec.components.flowise.infra.owner_email: "owner@example.com" # The origin of the secret value, written by the operator in the Release. Read exactly as # values.origin is. Write it here or in values.origin, never in both. A secret: name where it comes # from, never the value. spec.components.flowise.features.owner_password.infra.origin: "flowise-owner" # The origin of the secret value, written by the operator in the Release. Read exactly as # values.origin is. Write it here or in values.origin, never in both. A secret: name where it comes # from, never the value. spec.components.flowise.uses.model.chatopenai-0.features.credential.infra.origin: "openai-api-key"owner@example.com แทน
การนำ--target ร่าง Manifest จาก Recipes ของAGGREGA_CATALOG_DIRS หรือworkspace.catalog_dirs — จะsource:
cd sourceรันการนำเข้า
aggrega import support-chat.json --target composeที่
wrote aggregate.yamlwrote release.yamlwrote manifest.yamlwrote .aggrega-import.jsonที่<workspace> แทน
[… omitted: a warning that the importer runs unverified, printed where its module is read from beside its Plugin entity in a catalog folder rather than fetched]read as the flowise format, with drafted paths relative to <workspace>warn: node chatOpenAI_0 reaches chatopenai-0 through the model connection chatopenai-0 of core/ai-agent/flowise: its Base Path is empty, so the OpenAI client Flowise runs it on reads the address the platform delivers for this connection, OPENAI_BASE_URL, and, since it selects no credential, the key delivered as OPENAI_API_KEYinfo: the answers file <workspace>/import-answers.yaml also answers spec.components.flowise.features.owner_password.infra.origin in release.yaml, spec.components.flowise.uses.model.chatopenai-0.features.credential.infra.origin in release.yaml, which these drafts do not leave empty; those answers are kept there and not appliedmapped chatOpenAI_0 (chatOpenAI) to core/ai-model/openai as a reference, HIGH at 0.9made no choice for bufferMemory_0 (bufferMemory)made no choice for conversationChain_0 (conversationChain) warning: node "flowise" (provider "compose"): artifact "flowise-flow/flowise-flow.yaml": skipped provenance label injection — the fragment declares no compose service. Compose carries build provenance as service labels, so a fragment contributing only top-level networks, volumes or configs carries none; the services this component emits elsewhere carry the full set.Pull complete: <workspace>/release.lock (entities=8, source_artifacts=0, external_inputs=0)
- บรรทัด
mappedบอกว่า โหนด ChatOpenAI กลาย เป็น โมเดล OpenAI ของ ไลบรารี มาตรฐาน คือ core/ai-model/openaiซึ่งอ้างอิง แทน การ ร่าง เพราะ ตรง กัน ใน ระดับ สูง ที่ 0.9 โดย เป็น ส่วน ประกอบ ของ ตนเอง เชื่อม โยง กับ ซ็อกเก็ต modelของแพลตฟอร์ม - บรรทัด
warnบอกว่า chatflow เข้า ถึง โมเดล นั้น อย่างไร โหนด อ่าน ที่ อยู่ และ คีย์ ที่ แพลตฟอร์ม ส่ง มอบ สำหรับ การ เชื่อม ต่อ ของ โมเดล คีย์ ที่ Release แนบ กับ การ เชื่อม ต่อ จึง เป็น คีย์ ที่ chatflow ใช้ - บรรทัด
infoเกี่ยวกับ ไฟล์ คำ ตอบ ไฟล์ คำ ตอบ ตอบ อีเมล ของ เจ้าของ ที่ ฉบับ ร่าง ปล่อย ว่าง ไว้ ส่วน ชื่อ Secret สอง ชื่อ ตอบ สิ่ง ที่ มี เพียง การนำ เข้า สำหรับ Kubernetes ที่ ปล่อย ว่าง จึง ยัง อยู่ ใน ไฟล์ โดย ไม่ ได้ ใช้ ที่ นี่ - บรรทัด
made no choiceบอกว่า หน่วย ความ จำ และ chain ยัง อยู่ ภายใน chatflow ไม่มี ซ็อกเก็ต ของ แพลตฟอร์ม ใด รับ สิ่ง เหล่า นั้น - สอง
บรรทัด คือสุดท้าย ขั้น ตอน pull เมื่อ ทุก ค่า ได้ คำ ตอบ การนำ เข้า pull การ พึ่งพา ของ Release ที่ ร่าง ไว้ เหมือน ที่ aggrega pullทำ และเขียน release.lockบิลด์ด้าน ล่าง ไม่ ต้อง ใช้ สิ่ง ใด เพิ่ม บรรทัด warningเป็นบรรทัด ตรวจที่ บิลด์ พิมพ์ ด้วย เช่น กัน และ สอบ อธิบายความ ถูก ต้อง และ บิลด์ บรรทัด นั้น
สิ่งที่การนำเข้าเขียน
Aggregate, Release และ Manifest ตั้งimported/support-chat ตามsupport-chat.json เพราะtarget_namespace ของimported เว้น
aggregate.yaml — อินสแตนซ์core/ai-agent/flowise ที่model ของ
apiVersion: aggrega.ai/v1beta1kind: Aggregatemetadata: name: imported/support-chat version: 0.1.0 description: Draft Aggregate imported from a source in the flowise format.spec: components: flowise: type: core/ai-agent/flowise features: # For the compose target, the lines below declare owner_password on flowise: a secret the Release alone attaches arrives under the key value, so each is declared with a key of its own and no two arrive under one; the Release attaches its origin, naming this type or none. owner_password: type: core/secret-value values: key: OWNER_PASSWORD values: # chatflow_id is derived from the exported flow, which gives no identifier of its own. chatflow_id: '40d9f5c5-5187-54c1-a9f5-a8dac92f88bb' flow_definition: | { "nodes": [ [… omitted: the chatflow's nodes, as exported, up to the Conversation Chain's inputs] "inputs": { "model": "{{"{{"}}chatOpenAI_0.data.instance}}", "memory": "{{"{{"}}bufferMemory_0.data.instance}}", [… omitted: the rest of the chatflow, as exported] } uses: model: chatopenai-0: target: chatopenai-0 # For the compose target, the lines below declare credential on chatopenai-0: a secret the Release alone attaches arrives under the key value, so each is declared with a key of its own and no two arrive under one; the Release attaches its origin, naming this type or none. features: credential: type: core/secret-value values: key: OPENAI_API_KEY # swap to core/ai-model/azure-openai (score 0.4000) by setting type: core/ai-model/azure-openai chatopenai-0: type: core/ai-model/openai values: model: |- gpt-4o-mini- โมเดล คือ
core/ai-model/openaiพร้อมโมเดล ที่ โหนด เลือก คือ gpt-4o-miniความคิด เห็น ด้าน บน ระบุ Component อีก รายการ ของ แค็ตตาล็อก ที่ โหนด คล้าย พร้อม คะแนน - ข้อมูล
ลับ — รหัสสอง รายการ ผ่าน ของ บัญชี เจ้าของ ที่ ใช้ เริ่ม ต้น chatflow และ คีย์ OpenAI ที่ แพลตฟอร์ม แสดง ต่อ โมเดล — ประกาศ ไว้ ที่ นี่ พร้อม ตัวแปร ที่ แต่ละ รายการ มา ถึง ภาย ใต้ สภาพ แวดล้อม ของ Flowise คือ OWNER_PASSWORDและOPENAI_API_KEYบน Docker Compose ข้อมูลลับ ที่ มี เพียง Release แนบ จะ มา ถึง ภาย ใต้ คีย์ valueและทั้ง สอง จะ ชน กัน เมื่อ ประกาศ ไว้ ที่ นี่ แต่ละ รายการ จึง มี คีย์ ของ ตนเอง Release บอก ว่า แต่ละ รายการ มา จาก ที่ ใด chatflow_idสร้างจาก chatflow เพราะ ไฟล์ ส่ง ออก จาก ตัว แก้ไข ของ Flowise ไม่มี ตัว ระบุ ของ ตนเอง chatflow หนึ่ง จึง ให้ ตัว ระบุ เดียว เสมอ chatflow ของ Flowise เขียน {{<node id>.data.instance}}สำหรับทุก การ เชื่อม ต่อ ระหว่าง สอง โหนด และ ข้อความ ของ Aggregate ถูก อ่าน เป็น เทมเพลต ฉบับ ร่าง จึง เขียน {{แต่ละตัว เป็น {{"{{"}}ซึ่งบิลด์ เปลี่ยน กลับ เป็น ปีกกา สอง ตัว
release.yaml — Release ซึ่ง
apiVersion: aggrega.ai/v1beta1kind: Releasemetadata: name: imported/support-chat # environment is a drafted default, since no source names the environment this Release deploys to; change it to name the one it deploys to. environment: development version: 0.1.0 description: Draft Release imported from a source in the flowise format.spec: aggregate: imported/support-chat manifest: imported/support-chat components: flowise: infra: # The image running core/ai-agent/flowise, at the version this importer drafts, which the catalog's Recipes for it are known to run; the import does not raise or lower it to follow the source. image: "flowiseai/flowise:3.1.3" # Left for the Release, since the source cannot supply it: infra.owner_email, the email address of the platform's owner account, required while values.flow_definition is set owner_email: "owner@example.com" # Published on this machine's loopback address, 127.0.0.1: reachable from this machine only, by any process running on it. Delete this line to keep the service internal. published_port: 3000 features: owner_password: type: core/secret-value infra: # Attached by reference, never as a value: the owner account's password, required while values.flow_definition is set, read from the variable FLOWISE_OWNER_PASSWORD, which a target substituting variable references, as Docker Compose does when the stack starts, reads from the environment, so no file carries the value. origin: "${FLOWISE_OWNER_PASSWORD}" uses: model: chatopenai-0: features: credential: type: core/secret-value infra: # Attached by reference, never as a value: the credential flowise presents to chatopenai-0 on its model connection, read from the variable OPENAI_API_KEY, which a target substituting variable references, as Docker Compose does when the stack starts, reads from the environment, so no file carries the value. origin: "${OPENAI_API_KEY}" chatopenai-0: {}environmentคือdevelopmentซึ่งเป็น ค่า เริ่ม ต้น ที่ ความ คิด เห็น ด้าน บน บอก ให้ เปลี่ยน เป็น สภาพ แวดล้อม ที่ Release ปรับ ใช้ - อิมเมจ คือ Flowise 3.1.3 ซึ่ง
เป็น เวอร์ชัน ที่ Recipes ของ แค็ตตาล็อก สำหรับ Flowise รัน published_portคือ 3000 ซึ่งเป็น พอร์ต ที่ Flowise ให้ บริการ จึง ตอบ ที่ http://127.0.0.1:3000บนเครื่อง ของ คุณ ตาม ที่ ความ คิด เห็น ของ บรรทัด นั้น บอก กระบวนการ ใด ก็ตาม บน เครื่อง นี้ เข้า ถึง ได้ที่ นั่น และ ไม่มี สิ่ง อื่น เข้า ถึง ได้ ลบ บรรทัด นั้น เพื่อ ให้ Flowise อยู่ บน เครือข่าย ของ สแตก เท่านั้น owner_emailคือคำ ตอบ จาก ไฟล์ คำ ตอบ ความ คิด เห็น ด้าน บน บอก ว่า เหตุ ใด การนำ เข้า จึง ร่าง ค่า นี้ ไม่ ได้ - ข้อมูล
ลับ เป็นการสอง รายการ อ้างอิง ตัวแปร คือ ${FLOWISE_OWNER_PASSWORD}และ${OPENAI_API_KEY}ซึ่ง Docker Compose เติมจาก shell ของ คุณ เมื่อ สแตก เริ่ม ทำงาน จึง ไม่มี ไฟล์ ใด เก็บ ค่า ทั้ง สอง ไว้
manifest.yaml — Recipes ของ Compose สำหรับ
apiVersion: aggrega.ai/v1beta1kind: Manifestmetadata: name: imported/support-chat version: 0.1.0spec: mappings: components: type: core/ai-agent/flowise: compose/flowise core/ai-model/openai: compose/openai features: type: core/secret-value: compose/dotenv-secret.aggrega-import.json คือaggrega import --sync ครั้งrelease.lock ปัก
ตรวจสอบความถูกต้องและบิลด์
aggrega validate --release release.yamlaggrega build --release release.yaml

การ
notice: LINT: Feature "core/secret-value" at core/secret-value:1.0.0 declares property "origin" in both values: and infra: pillars (path: origin)release dependency validation passed: release.yaml (schema-pillar + dependency pillars)และ<workspace> แทน
warning: node "flowise" (provider "compose"): artifact "flowise-flow/flowise-flow.yaml": skipped provenance label injection — the fragment declares no compose service. Compose carries build provenance as service labels, so a fragment contributing only top-level networks, volumes or configs carries none; the services this component emits elsewhere carry the full set. notice: LINT: Feature "core/secret-value" at core/secret-value:1.0.0 declares property "origin" in both values: and infra: pillars (path: origin)[… omitted: a total build time, which differs per run]Build completed: 1 file written to <workspace>/distบรรทัด warning เกี่ยวconfigs ระดับnotice เป็นorigin จาก values ของ Aggregate หรือ infra ของ Release และ
dist/compose/docker-compose.yaml มี
flowise: image: flowiseai/flowise:3.1.3 environment: DATABASE_PATH: /home/node/.flowise SECRETKEY_PATH: /home/node/.flowise OPENAI_BASE_URL: https://api.openai.com/v1 OPENAI_API_KEY: ${OPENAI_API_KEY} ports: - 127.0.0.1:3000:3000 [… omitted: the labels the build writes on every service, naming the Aggregate, the component, the environment and the compiler's version] volumes: - type: volume source: flowise--data target: /home/node networks: - compose [… omitted: the service's health check]และ
flowise-flow-seed: image: flowiseai/flowise:3.1.3 entrypoint: - node - /seed/seed.js environment: FLOWISE_URL: http://127.0.0.1:3000 OWNER_EMAIL: owner@example.com OWNER_PASSWORD: ${FLOWISE_OWNER_PASSWORD} CHATFLOW_ID: 40d9f5c5-5187-54c1-a9f5-a8dac92f88bb CHATFLOW_NAME: 40d9f5c5-5187-54c1-a9f5-a8dac92f88bb [… omitted: the labels the build writes on every service] network_mode: service:flowise depends_on: flowise: condition: service_healthy restart: "no" configs: - source: flowise-flow target: /seed/flow.json - source: flowise-flow-seed target: /seed/seed.jsบริการchatflow_id คีย์published_port ไว้infra ของ Flowise และ
กับผู้ช่วย AI
ผู้
ใช้เฉพาะเครื่องมือของ Aggrega และอย่าสร้างโฟลเดอร์เอง ถ้าโฟลเดอร์ Workspace ยังไม่มีโฟลเดอร์ `import-flowise` เรียกเครื่องมือ `draft` หนึ่งครั้ง โดยตั้ง `example` เป็น `import-flowise` และไม่ระบุ `dir`: เครื่องมือจะเขียนตัวอย่างลงในโฟลเดอร์ `import-flowise` ใหม่ ซึ่งโฟลเดอร์ `source` ของโฟลเดอร์นั้นเก็บสิ่งที่หน้านี้นำเข้า จากนั้นเรียกเครื่องมือ `import` โดยตั้ง `workspace_root` เป็น `import-flowise/source` ตั้ง `source` เป็น `support-chat.json` และตั้ง `target` เป็น `compose`: เครื่องมืออ่านคำตอบที่ต้องใช้จาก `import-answers.yaml` ข้าง `support-chat.json` เขียนร่างลงใน `import-flowise/source` และ pull สิ่งที่ร่างเหล่านั้นต้องใช้ จากนั้นเรียกเครื่องมือ `validate` โดยตั้ง `workspace_root` เป็น `import-flowise/source` และตั้ง `release` เป็น `release.yaml` และเรียกเครื่องมือ `build` โดยตั้ง `workspace_root` เป็น `import-flowise/source` ตั้ง `release` เป็น `release.yaml` และตั้ง `write` เป็น true บอกฉันว่าบิลด์เขียนไฟล์ใดบ้าง ไฟล์เหล่านั้นอยู่ใต้ `import-flowise/source/dist/`เปิดใน VS Code
เมื่อimport-flowise/source ใน VS Code ซึ่งrelease.yaml ที่dist/ ของ
วิธีรัน
ตั้ง
export OPENAI_API_KEY='your OpenAI key'export FLOWISE_OWNER_PASSWORD='a password of your own'docker compose -p support-chat -f dist/compose/docker-compose.yaml up -d --wait flowisedocker compose -p support-chat -f dist/compose/docker-compose.yaml up flowise-flow-seed-p ระบุ--wait คืนflowise เพียง
flowise-flow-seed-1 | registered the owner account owner@example.comflowise-flow-seed-1 | imported chatflow 40d9f5c5-5187-54c1-a9f5-a8dac92f88bb as "40d9f5c5-5187-54c1-a9f5-a8dac92f88bb"flowise-flow-seed-1 exited with code 0ถ้าfailed to bind host port 127.0.0.1:3000/tcp: address already in use ตั้ง published_port เป็น
ทดสอบ
เปิด http://127.0.0.1:3000 ซึ่งpublished_port เผย
chatflow ที่
curl -sS -X POST http://127.0.0.1:3000/api/v1/prediction/40d9f5c5-5187-54c1-a9f5-a8dac92f88bb \ -H 'Content-Type: application/json' -d '{"question": "In one short sentence: what is Docker Compose?"}'การ
{"statusCode":500,"success":false,"message":"401 Unauthorized – check your API key and ensure it has access to the requested model.","stack":{}}เมื่อtext
บน Kubernetes เมื่อflowise-default ใน
kubectl port-forward -n <namespace> svc/flowise-default 3000:3000จาก
หยุด-v ยัง
docker compose -p support-chat -f dist/compose/docker-compose.yaml down -vบน Kubernetes
chatflow เดียวกันhelm ร่างsource แล้ว และ--output-dir แล้ว
aggrega import support-chat.json --target helm --output-dir helmcd helmaggrega validate --release release.yamlaggrega build --release release.yamlร่างhelm/flowise แมปhelm/openai และhelm/k8s-existing-secret ซึ่งcore/referenced-secret โดยflowise-owner และ openai-api-key
บิลด์dist/helm/ ที่source ซึ่งhelm คือ ../dist/helm/ สร้าง Secrets สองvalue แล้ว