← 返回
未分类

dify-workflow-builder

Build, generate, validate and deploy Dify workflows locally. Use this skill whenever the user mentions Dify, wants to build an agent, chatflow, workflow, RAG pipeline, multi-LLM routing, knowledge base, vector retrieval, SMS/email/Slack/Feishu notifications, function-calling tools, code execution nodes, HTTP integrations, conditional branching, iteration loops, or any combination of these. Also trigger when the user uploads a Dify DSL YAML/JSON, asks to import DSL into Dify, wants to debug a Dif
在本地构建、生成、校验并部署 Dify 工作流。当用户提及 Dify、想要搭建智能代理、对话流程、工作流、检索增强生成(RAG)流水线、多大模型路由、知识库、向量检索,或是短信 / 邮件 / 飞书 / Slack 消息通知、函数调用工具、代码执行节点、HTTP 接口集成、条件分支、循环迭代,以及以上功能的任意组合时,均启用本能力。 若用户上传 Dify 领域特定语言(DSL)格式的 YAML/JSON 文件、要求将 DSL 导入 Dify、调试 Dify 应用,或是需要把自然语言需求转化为 Dify 应用,也需触发本能力。
user_90516f5c
未分类 community v1.0.0 1 版本 50000 Key: 无需
★ 0
Stars
📥 1
下载
💾 0
安装
1
版本
#latest

概述

Dify Workflow Builder

A skill for converting natural-language requirements into import-ready Dify 1.x DSL. Generates chatflows, workflows, completion apps, and agents with full coverage of LLM, RAG, tools, notifications, and external integrations.

When to trigger

Use this skill when the user wants to do any of the following inside Dify:

  • Build an agent with tools, function calling, or ReAct reasoning
  • Build a chatflow (multi-turn conversational app)
  • Build a workflow (single-shot automation / ETL / pipeline)
  • Build a completion app (single prompt → single output)
  • Add knowledge base / RAG with hybrid search and reranking
  • Configure multiple LLM providers (OpenAI, Claude, DeepSeek, Qwen, Ollama, etc.)
  • Send notifications (SMS / email / webhook / Slack / Feishu / DingTalk / WeCom)
  • Add conditional branches, iterations, loops, parallel execution
  • Use HTTP / code-execution nodes to integrate external APIs
  • Import, validate, debug, or extend an existing Dify DSL

Workflow — follow these steps in order

Step 1: Capture intent

Read the user's request. Identify:

  • App kind: chatflow / workflow / completion / agent
  • Primary goal: what should the app do end-to-end
  • Inputs: user messages, files, trigger source
  • Outputs: text reply, API response, notification, file
  • Integrations: which LLM(s), knowledge bases, external services, tools

Step 2: AskUserQuestion — gather missing parameters

Before writing DSL, fill these gaps. Ask in one batch of 1–4 questions, never one at a time:

  1. App kind (chatflow / workflow / completion / agent)
  2. LLM provider(s) — multi-select if user wants model routing or fallbacks
  3. Knowledge base — does it need RAG? Which documents?
  4. External integrations — multi-select: SMS, email, Slack, Feishu, HTTP API, code execution, none
  5. Trigger source — chat (web SDK / API) / schedule / webhook
  6. Output destination — chat reply / webhook / both

Skip questions the user already answered. Pick reasonable defaults and tell the user what you assumed.

Step 3: Pick template(s)

Browse templates/ and pick the closest match:

ScenarioTemplate
------
Single-turn Q&A or simple chatchatflow-basic.yml
Branching / conditional / parallelworkflow-branching.yml
Document Q&A with RAGrag-qa.yml
Agent with tools and reasoningagent-with-tools.yml
Multi-channel notification fan-outnotification-multi.yml
Multi-agent routing by intentmulti-agent-router.yml
SQL / data analysisdata-analysis.yml
Content generation pipelinecontent-generator.yml

If no template fits exactly, compose by copying blocks from 2+ templates. See references/dsl-schema.md for the underlying node grammar.

Step 4: Read the relevant references

  • Always read references/dsl-schema.md to confirm node data shapes
  • Read references/variable-syntax.md for {{sys.}} / {{conversation.}} / {{env.*}} / {{node_id.var}} references
  • Read references/node-types.md for the 17 node kinds and their required fields
  • Read the integration-specific reference for any external service used (LLM, KB, SMS, etc.)

Step 5: Generate the DSL

Output a single YAML file with:

  • Top-level app (metadata: name, mode, description, icon, icon_background)
  • Top-level kind: app-kind (chatflow / workflow / agent / completion)
  • version: 0.1.5 (or latest known to Dify 1.x)
  • workflow.graph.nodes — array of node objects
  • workflow.graph.edges — array of source→target connections
  • workflow.environment_variables — env vars (API keys, endpoints)
  • workflow.conversation_variables — chatflow-only persistence

Use proper variable references everywhere, e.g. {{#sys.query#}} for the user input, {{#conversation.history#}} for chat history, {{#node_llm.text#}} for an LLM node's output.

Step 6: Validate

Run the validator to catch common mistakes:

python scripts/validate_dsl.py <your-dsl>.yml

The script checks:

  • Every edge references existing node ids
  • Variable references resolve to declared nodes / env / conversation vars
  • Required data fields are present for each node type
  • Cycle detection (workflows must be DAG for iteration and loop only)
  • Provider credentials referenced via {{env.X}} (not hardcoded keys)

Fix any errors before continuing.

Step 7: Render the flow diagram

python scripts/render_flow.py <your-dsl>.yml

Prints an ASCII / Mermaid diagram of node connectivity. Show the user so they can verify the flow before importing.

Step 8: Output the deliverables

Always produce all three:

  1. DSL file — the YAML/JSON, ready to import
  2. Deployment guide — see references/deployment.md template; include model Key setup, knowledge base upload, external-service credentials
  3. Variable map — table of every variable, its type, source, and which nodes consume it

If the user wants to see examples, point them at examples/.

Output format — ALWAYS follow this template

# <App Name> — Dify App

## 1. Overview
<one-paragraph description of what this app does>

## 2. Flow Diagram
<ASCII or Mermaid diagram>

## 3. DSL (YAML)
<full DSL file in a ```yaml code block>

## 4. Variable Map
| Variable | Type | Source | Consumed by |
|---|---|---|---|

## 5. Deployment Steps
1. Start Dify (Docker)
2. Import DSL
3. Configure environment variables
4. Upload knowledge base documents (if any)
5. Add custom tool credentials
6. Test run

## 6. Test Cases
- Input: <sample user input>
  Expected output: <expected response>
- Input: ...

Key rules

  • YAML over JSON unless the user explicitly asks for JSON
  • Never hardcode API keys — always use {{env.YOUR_KEY}}
  • Variable references use the #…# wrapper for upstream-node outputs, e.g. {{#node_1.text#}}. Use bare {{var}} only for sys / env / conversation.
  • Each LLM node needs a model block referencing a provider the user has configured. If you don't know which model the user has, ask.
  • Conditional branches use if-else nodes with cases array; each case has case_id, logical_operator, conditions
  • Iteration is for per-element loops over a list; loop is for retry-until-condition
  • Agent nodes in Dify 1.x use agent_strategy_providers — pick ReAct or Function Calling based on the user's needs

Resources

Pointers to bundled files:

  • references/dsl-schema.md — Full Dify 1.x DSL schema
  • references/node-types.md — 17 node types with examples
  • references/variable-syntax.md — Variable reference grammar
  • references/llm-providers.md — Provider configs
  • references/knowledge-rag.md — RAG / knowledge base setup
  • references/external-services.md — SMS, email, IM, webhook configs
  • references/agent-tools.md — Function calling, ReAct, custom tools
  • references/deployment.md — Docker, env vars, import flow
  • templates/*.yml — 8 ready-to-use templates
  • scripts/validate_dsl.py — DSL validator
  • scripts/render_flow.py — ASCII flow renderer
  • examples/* — End-to-end working examples

Common pitfalls to avoid

  • Missing version field in app block — Dify refuses to import
  • Hardcoded model name in provider field — must match a configured provider
  • Referencing variables from a node that runs in parallel — order of execution isn't guaranteed
  • Using {{node_id.text}} instead of {{#node_id.text#}} for upstream-node output references
  • Forgetting conversation_variables reset in chatflows — state carries across turns
  • Code node language must be one of python3 / javascript (Dify 1.x); not just python
  • Knowledge base mode must match dataset settings (economic / high_quality / custom)
  • Agent tool schema must declare parameters as JSON Schema, not prose

版本历史

共 1 个版本

  • v1.0.0 Initial release 当前
    2026-06-11 17:00 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,349 📥 317,592
security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,210 📥 266,081
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 666 📥 323,714