| 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
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
- Read the current draft with
npm run dify -- get-draft output/draft.json.
- Inspect node IDs, edges, node types, and the current workflow hash.
- Patch a local copy while preserving unrelated graph data.
- Save with
npm run dify -- save-draft input/save-payload.json.
- If Dify rejects a stale hash, fetch the draft again and reapply the patch.
- Publish only after validating graph structure and required node references.
- Run representative inputs and fetch node executions instead of trusting final text alone.
Published Runs
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. 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.