dify-flow-access
/install dify-flow-access
Dify Workflow - OpenClaw CLI for Dify API
Use OpenClaw to query company knowledge base or execute workflows via Dify API. Supports multi-turn conversation and streaming responses.
Trigger Conditions
When users need to access internal knowledge bases, documentation queries, Q&A systems, or execute specific workflows, this skill handles those requests such as "help me check the knowledge base" or "query Dify workflow".
Features
- ✅ Call Dify Workflow API (workflow mode)
- ✅ Call Dify ChatApp API (chat mode)
- ✅ Multi-turn conversation context management
- ✅ Streaming response support (show results incrementally)
- ✅ Automatic timeout and error handling
- ✅ Configurable request parameters
Quick Start
# Basic ChatApp mode query (recommended, no workflow ID needed)
/dify-workflow "如何部署项目?" --chat
# Workflow mode query (requires specifying workflow ID)
/dify-workflow "查询 AI 助手信息" --wf wf_123456abcdef
# Multi-turn conversation (use conversation_id from previous response)
/dify-workflow "那退款流程呢?" --conv conv_xyz789
# Streaming response (show results incrementally)
/dify-workflow "解释一下这个概念" --stream
# Combined usage
/dify-workflow "查询中电港 AI 助手相关信息" --chat
Configuration
Base URL: http://10.10.10.159/v1
API Key: app-jUhDcPj3lcnEG04JW4gRsfyy
Environment Variables (Optional Overrides)
You can override defaults via environment variables:
export DIFY_BASE_URL="http://your-dify-server/v1"
export DIFY_API_KEY="your-api-key-here"
export DEFAULT_TIMEOUT=120
Command Line Options
| Option | Description | Example |
|---|---|---|
--chat |
Use ChatApp mode (default for most apps) | --chat |
--wf ID |
Specify workflow ID for Workflow mode | --wf wf_xxx |
--conv ID |
Specify conversation ID for multi-turn | --conv conv_xxx |
--stream |
Enable streaming response mode | --stream |
API Endpoints
- Workflow:
POST /v1/workflows/run- Execute predefined workflows - ChatApp:
POST /v1/chat-messages- Chat interface with knowledge base
Request Format Examples
ChatApp Mode
{
"inputs": {},
"query": "user query",
"conversation_id": "conv_xxx", // Optional for multi-turn
"response_mode": "blocking", // or "streaming"
"user": "openclaw-user",
"files": []
}
Workflow Mode
{
"workflow_id": "wf_xxx",
"inputs": {
"query": "user query"
},
"response_mode": "blocking",
"user": "openclaw-user"
}
Response Extraction
The script automatically extracts answers from different Dify response formats:
- ChatApp:
.data.answer - Workflow:
.data.outputs.answeror.data.outputs.* - Advanced Chat:
.answer(top-level)
Common Use Cases
1. Knowledge Base Query
/dify-workflow "员工手册中的报销政策是什么?" --chat
2. Multi-turn Conversation
# First query returns conversation_id: conv_abc123
/dify-workflow "那加班制度呢?" --conv conv_abc123
3. Execute Specific Workflow
/dify-workflow "生成月度报告" --wf wf_report_gen_xyz
4. Streaming Large Outputs
/dify-workflow "分析这个数据集" --stream
Troubleshooting
Common Errors and Solutions
-
"not_workflow_app"
- Cause: Using Workflow mode for a ChatApp
- Solution: Use
--chatflag:/dify-workflow "query" --chat
-
"conversation_id_invalid"
- Cause: Expired or incorrect conversation ID
- Solution: Start fresh without
--convoption
-
"workflow_not_found"
- Cause: Invalid workflow ID
- Solution: Verify the workflow ID exists in your Dify app (should start with
wf_)
-
"query missing parameter"
- Cause: Query parameter not included in payload
- Solution: Ensure query is properly specified
Getting IDs from Dify Dashboard
ChatApp Mode:
- No additional setup needed
- Conversation IDs are automatically returned in responses
Workflow Mode:
- Open your Workflow app in Dify dashboard
- Go to "API Access" or check the URL
- Look for IDs starting with
wf_
Technical Details
Unicode Support
- Automatic decoding of Unicode escape sequences (e.g.,
\u4f60\u597d→你好) - Supports Chinese and other multi-language responses
Error Handling
- Clear error messages with actionable suggestions
- Timeout protection (default 120 seconds)
- Graceful fallback for missing dependencies
Dependencies
- Python 3.x (for JSON parsing and Unicode decoding)
- curl (for HTTP requests)
- jq (optional, for advanced output formatting)
Version Information
- Version: 1.0.0
- Last Updated: 2026-05-20
- Author: OpenClaw Team
- License: Internal use only
Support
For issues or questions:
- Check the troubleshooting section above
- Verify your Dify API credentials and configuration
- Ensure network connectivity to Dify server at
http://10.10.10.159/v1
Note: Default timeout is 120 seconds to accommodate complex workflow executions. Adjust via DEFAULT_TIMEOUT environment variable if needed.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install dify-flow-access - 安装完成后,直接呼叫该 Skill 的名称或使用
/dify-flow-access触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
dify-flow-access 是什么?
Query and interact with company knowledge bases or workflows using Dify API with multi-turn context and streaming response support. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 52 次。
如何安装 dify-flow-access?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install dify-flow-access」即可一键安装,无需额外配置。
dify-flow-access 是免费的吗?
是的,dify-flow-access 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
dify-flow-access 支持哪些平台?
dify-flow-access 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 dify-flow-access?
由 whswhs1128(@whswhs1128)开发并维护,当前版本 v1.0.0。