Przejdź do treści
Biblioteka skilli
AI i agenci · Budowanie i kod

dify-workflow

/dify-workflow

Projektuje i generuje DSL aplikacji Dify (workflow, advanced-chat), a następnie wdraża go na instancję Dify przez Admin API.

Licencja
MIT
Ostatnia zmiana repozytorium
19.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
28
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 19.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Projektuje i generuje DSL aplikacji Dify (workflow, advanced-chat), a następnie wdraża go na instancję Dify przez Admin API.

Oryginalny opis (EN)

设计、生成并部署 Dify 应用 DSL (workflow/advanced-chat)。当用户要求构建 Dify 工作流、生成/更新 DSL 文件或通过 Admin API 部署到 Dify 实例时使用。

Jak działa

  1. 交互原则与凭证隔离
  2. 版本锚定 (Version Anchoring)
  3. 节点路由表
  4. 任务执行路径与校验关卡
  5. DSL 结构快速参考
  6. 常见 Schema 陷阱
  7. 模板与参考示例
Sekcje z nagłówków SKILL.md, w oryginale · 126 linii, 606 słów
Podgląd SKILL.md
---
name: dify-workflow
description: 设计、生成并部署 Dify 应用 DSL (workflow/advanced-chat)。当用户要求构建 Dify 工作流、生成/更新 DSL 文件或通过 Admin API 部署到 Dify 实例时使用。
---

# Dify Workflow DSL 生成器

## 交互原则与凭证隔离

- **需求澄清**:若用户描述不足以确定节点或输入/输出流程,优先澄清输入输出变量与核心节点,确认后开始生成。
- **凭证隔离**:严格隔离敏感凭证。最终回复与导出产物中仅包含 App ID、DSL 文件路径、节点统计与部署状态,禁止泄露 `ADMIN_API_KEY`。
- **关联 Skill 约定**:涉及 Console Admin API 操作时,先读取并遵守 [dify-deploy](file:///d:/源自C盘/桌面/Aeson-skills/Skills/dify-deploy/SKILL.md)。

## 版本锚定 (Version Anchoring)

每次生成前按顺序执行:
1. 读取 `references/config.yml`,获取 `dsl_version` 与 `reference_dsl`。
2. 若 `reference_dsl` 非空,读取 `references/user-reference/<文件名>` 作为基准 schema。
3. 读取 `references/version-deltas.md` 查找版本差异。
4. 约束:输出 YAML 的 `version` 必须匹配 `dsl_version`,且仅使用目标版本支持的节点与字段。

## 节点路由表

| 节点 | 类型标识 | 用途 | 关键参数 | Schema 路径 |
|------|----------|------|----------|-------------|
| Start | `start` | 入口节点;定义输入变量 | `variables` | `references/nodes/start.md` |
| End | `end` | Workflow 模式终端;声明输出 | `outputs` | `references/nodes/end.md` |
| Answer | `answer` | Chatflow 模式流式输出 | `answer`, `variables` | `references/nodes/answer.md` |
| LLM | `llm` | 调用大语言模型 | `model`, `prompt_template`, `context`, `vision` | `references/nodes/llm.md` |
| Knowledge Retrieval | `knowledge-retrieval` | 知识库文档检索 | `query_variable_selector`, `dataset_ids`, `retrieval_mode` | `references/nodes/knowledge-retrieval.md` |
| Code | `code` | 执行 Python3/JS/JSON | `code_language`, `code`, `variables`, `outputs` | `references/nodes/code.md` |
| HTTP Request | `http-request` | HTTP API 调用 | `method`, `url`, `headers`, `body`, `authorization` | `references/nodes/http-request.md` |
| If/Else | `if-else` | 条件分支 (IF/ELIF/ELSE) | `cases` | `references/nodes/if-else.md` |
| Variable Aggregator | `variable-aggregator` | 合并多分支变量 | `output_type`, `variables` | `references/nodes/variable-aggregator.md` |
| Iteration | `iteration` | 数组循环遍历 | `iterator_selector`, `iterator_input_type`, `output_selector` | `references/nodes/iteration.md` |
| Document Extractor | `document-extractor` | 文件文本提取 (PDF/DOCX) | `variable_selector`, `is_array_file` | `references/nodes/document-extractor.md` |
| Template Transform | `template-transform` | Jinja2 模板渲染 | `template`, `variables` | `references/nodes/template-transform.md` |
| Question Classifier | `question-classifier` | LLM 意图分类 | `query_variable_selector`, `model`, `classes` | `references/nodes/question-classifier.md` |
| Parameter Extractor | `parameter-extractor` | LLM 结构化参数提取 | `query`, `model`, `parameters`, `reasoning_mode` | `references/nodes/parameter-extractor.md` |
| Tool | `tool` | 调用外部工具 | `provider_id`, `provider_type`, `tool_name`, `tool_parameters` | `references/nodes/tool.md` |

## 任务执行路径与校验关卡

### 执行路径

1. **解析与模式确定**:批处理用 `workflow` 模式(Start -> End);对话交互用 `advanced-chat` 模式(Start -> Answer)。
2. **节点选择与模板匹配**:优先匹配 `## 模板匹配` 中的预设模板;无匹配时依据路由表 schema 逐个组装。
3. **构图与边连接**:
   - 节点 ID 格式:13 位时间戳字符串(如 `"1711536487001"`)。
   - 坐标规划:起始点 `{x: 80, y: 282}`,X 轴增量 `+300px`,分支 Y 轴增量 `+200px`。
   - 边 ID 格式:`{sourceId}-{sourceHandle}-{targetId}-{targetHandle}`,`targetHandle` 统一为 `"target"`。分支 sourceHandle 分别为 `"true"`/`case_id`/`"false"` 或类别 ID。
4. **部署与更新**(如适用):覆盖更新前先导出原 DSL 保存为备份文件。API 异常卡住时报告排查建议,未获明确授权禁止直连数据库。

### 校验关卡 (Validation Gate)

交付产物前必须完成以下 4 项校验:
- [ ] **语法与命名**:默认输出为当前目录的 `<kebab-case-name>.dify.yml`(按需输出 `.dify.json`)。所有字符串节点 ID 显式加引号。
- [ ] **拓扑完整性**:所有 Edge 的 `source` 和 `target` ID 在 Graph Nodes 中真实存在,边 `type` 为 `"custom"`。
- [ ] **变量引用合法性**:节点变量引用为 `{{#nodeId.variableName#}}`,系统变量为 `sys` 前缀(`workflow` 模式严禁引用 `sys.query`)。
- [ ] **Provider 正确性**:`model.provider` 遵循 `"langgenius/<provider>/<provider>"` 格式,且使用真实模型标识(如 `gpt-4o-mini`、`deepseek-chat`)。

## DSL 结构快速参考

```yaml
version: "<dsl_version from config.yml>"
kind: app
app:
  name: "工作流名称"
  mode: "advanced-chat"           # 或 "workflow"
  description: "..."
  icon: "\U0001F916"
  icon_background: "#FFEAD5"
  icon_type: emoji
  use_icon_as_answer_icon: false
dependencies: []
workflow:
  environment_variables: []
  conversation_variables: []
  features:
    file_upload:
      enabled: false
    opening_statement: ""         # 仅 chatflow
    retriever_resource:
      enabled: false
    sensitive_word_avoidance:
      enabled: false
    speech_to_text:
      enabled: false
    suggested_questions: []       # 仅 chatflow
    suggested_questions_after_answer:
      enabled: false
    text_to_speech:
      enabled: false
  graph:
    nodes: []                     # 节点对象数组
    edges: []                     # 边对象数组
    viewport:
      x: 0
      y: 0
      zoom: 0.7
```
完整字段级规范参照 `references/dsl-format.md`。

## 常见 Schema 陷阱

1. **变量形状差异**:
   - `code` / `llm` / `template-transform` / `parameter-extractor`:`[{ variable: "arg", value_selector: ["node_id", "field"], value_type: "string" }]`
   - `variable-aggregator`:裸嵌套列表 `[["node1_id", "output"], ["node2_id", "output"]]`
   - `document-extractor`:扁平列表 `variable_selector: ["upstream_id", "field"]`
2. **Memory 作用域**:`memory` 块仅存在于 `advanced-chat` 模式的 LLM 节点,`workflow` 模式及迭代内部节点必须省略。
3. **迭代节点约束**:内层节点须包含 `parentId: <iteration_id>`、`data.isInIteration: true`、`zIndex: 1002`,坐标为相对坐标(初始约 `{x: 24, y: 68}`)。`iterator_input_type` 必须与真实元素匹配(如 `"array[file]"`)。
4. **特定节点输出形状**:End 节点 `outputs` 为列表;Code 节点 `outputs` 为字典。
5. **Edge Data 字段**:包含 `sourceType`、`targetType`、`isInIteration`、`isInLoop`。迭代内边补充 `iteration_id` 与 `zIndex: 1002`。

## 模板与参考示例

与已知模式高度匹配时优先使用预设模板,按需调整字段:

| 模板 | 路径 | 匹配条件 |
|------|------|----------|
| Chatbot | `references/templates/chatbot.yml` | 简单对话:Start -> LLM -> Answer |
| RAG | `references/templates/rag.yml` | 知识库问答:Start -> Knowledge Retrieval -> LLM -> Answer |
| Agent | `references/templates/agent.yml` | 带分类/参数提取的工具 Agent |
| Translation | `references/templates/translation.yml` | 文本转换/翻译 |

### 完整示例文件指针 (Progressive Disclosure)

- **Minimal Chatbot DSL**:对应完整 DSL 见 [`examples/simple-chatbot.yml`](file:///d:/源自C盘/桌面/Aeson-skills/Skills/dify-workflow/examples/simple-chatbot.yml)
- **RAG with Rerank DSL**:对应完整 DSL 见 [`examples/rag-with-rerank.yml`](file:///d:/源自C盘/桌面/Aeson-skills/Skills/dify-workflow/examples/rag-with-rerank.yml)
Pliki w paczce (28)
  • SKILL.md 8 KB
  • agents/openai.yaml 1 KB
  • examples/rag-with-rerank.yml 8 KB
  • examples/simple-chatbot.yml 4 KB
  • references/config.yml 1 KB
  • references/dsl-format.md 25 KB
  • references/edge-and-layout.md 10 KB
  • references/version-deltas.md 3 KB
  • references/nodes/answer.md 9 KB
  • references/nodes/code.md 3 KB
  • references/nodes/document-extractor.md 4 KB
  • references/nodes/end.md 8 KB
  • references/nodes/http-request.md 6 KB
  • references/nodes/if-else.md 6 KB
  • references/nodes/iteration.md 8 KB
  • references/nodes/knowledge-retrieval.md 9 KB
  • references/nodes/llm.md 9 KB
  • references/nodes/parameter-extractor.md 5 KB
  • references/nodes/question-classifier.md 4 KB
  • references/nodes/start.md 9 KB
  • references/nodes/template-transform.md 3 KB
  • references/nodes/tool.md 5 KB
  • references/nodes/variable-aggregator.md 4 KB
  • references/templates/agent.yml 7 KB
  • references/templates/chatbot.yml 4 KB
  • references/templates/rag.yml 5 KB
  • references/templates/translation.yml 6 KB
  • references/user-reference/README.md 1 KB

Wersje

W bazie nie ma innych skilli o nazwie dify-workflow.

Migawka bazy z 13.11.2026 · wersja paczki 60ba77d68eb0 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100validate-dify-dsl
    Sprawdza węzły główne pliku DSL Dify, czyli eksportu przepływu w YAML, i wskazuje niepoprawne pola w każdym węźle.
  • 100dify
    Pomaga z Dify: hostowanie przez Docker Compose, zmienne środowiskowe, wywołania API aplikacji i workflow, dokumenty w bazie wiedzy, eksport i import DSL, difyctl oraz aktualizacja i kopie zapasowe.
  • 100skills-to-dify-workflow
    Przekształca foldery skilli Claude Code w pliki YAML workflow Dify i tworzy podgląd React przed eksportem.
  • 100dify-chatflow-builder
    Pomaga budować wielokrotne dialogi w Dify: przepływy, maszyny stanów, węzły, zmienne i prompty, a także rozwiązywać błędy uruchomienia.
  • 100dify-knowledge-base-search
    Obsługuje API wyszukiwania w bazie wiedzy Dify (dataset retrieve): testowanie fragmentów, opcje retrieval_model i kształt odpowiedzi.
  • 100dify-knowledge-base-upload
    Wgrywa lokalne pliki do bazy wiedzy potoku Dify przez opublikowany przepływ datasource i opcjonalnie stosuje istniejące pola metadanych.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.