dify-playwright
Inspect, patch, publish, run, and diagnose workflows on a user-configured Dify deployment through Playwright and Dify APIs. Use for authenticated console operations, workflow run inspection, batch execution, and vision-input debugging.
来源信息
- 仓库
- JuneQQQ/dify-playwright
- 最近来源活动
- 2026年7月22日 08:51
- 检测到的 SKILL.md 语言
- 英语
- 星标
- 2
- Forks
- 0
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
正在显示 SKILL.md
SKILL.md
来源说明 · 只读预览- name
- dify-playwright
- description
- Inspect, patch, publish, run, and diagnose workflows on a user-configured Dify deployment through Playwright and Dify APIs. Use for authenticated console operations, workflow run inspection, batch execution, and vision-input debugging.
# Dify Playwright
Use this skill when a task requires access to a Dify workflow draft, console-only execution logs, or repeatable workflow runs.
## Choose The Correct API
| Path | Authentication | Best for |
| --- | --- | --- |
| Console API | Dify email/password through Playwright | Read/write drafts, publish, inspect node executions |
| Service API | Dify app API key | Run an already published workflow |
Prefer the Service API when no draft or console-only data is needed.
## Setup
```bash
cd /path/to/dify-playwright
npm install
npx playwright install chromium
cp .env.example .env
set -a; source .env; set +a
```
The console path requires `DIFY_BASE_URL`, `DIFY_EMAIL`, and `DIFY_PASSWORD`. App-specific operations also require `DIFY_APP_ID`. Never print or commit these values.
## Console Workflow Procedure
1. Read the current draft with `npm run dify -- get-draft output/draft.json`.
2. Inspect node IDs, edges, node types, and the current workflow hash.
3. Patch a local copy while preserving unrelated graph data.
4. Save with `npm run dify -- save-draft input/save-payload.json`.
5. If Dify rejects a stale hash, fetch the draft again and reapply the patch.
6. Publish only after validating graph structure and required node references.
7. Run representative inputs and fetch node executions instead of trusting final text alone.
## Published Runs
```bash
export DIFY_APP_API_KEY='<app-api-key>'
npm run dify -- run-formal input/run.json output/result.json
```
The command forces streaming mode and extracts the final workflow event.
## Batch Runs And Logs
- Use `scripts/run_workflow_batch.mjs` for generic parallel draft or installed-app runs.
- Use `scripts/fetch_batch_node_usage.mjs` to collect LLM node model, token, latency, loop, and status fields.
- Keep input and output files out of Git when they contain private workflow data.
## Vision Workflows
Read [references/dify-vision-files.md](references/dify-vision-files.md). Verify actual LLM prompt file counts from node executions; plausible output text does not prove that an image reached the model.
## Completion Checklist
- Confirm the chosen API path matches the task.
- Confirm the intended draft hash changed before reporting a saved edit.
- Confirm publish completed when the user requested a published change.
- Fetch node executions for representative runs.
- Check image file counts for vision workflows.
- Separate HTTP/file preparation time from LLM time when diagnosing latency.
- Do not expose credentials, cookies, private URLs, or workflow payloads in logs or commits.
在 GitHub 查看