diff --git a/.claude/skills/dify-docs-env-vars/SKILL.md b/.claude/skills/dify-docs-env-vars/SKILL.md index 315e92a56..59c75aa39 100644 --- a/.claude/skills/dify-docs-env-vars/SKILL.md +++ b/.claude/skills/dify-docs-env-vars/SKILL.md @@ -17,6 +17,18 @@ Read these shared guides: 2. `writing-guides/formatting-guide.md` 3. `writing-guides/glossary.md` +## Source of Truth: `docker/.env.example` + +The doc mirrors `docker/.env.example`, the supported self-host knob surface. + +| Var location | Action | +|---|---| +| In `.env.example`, uncommented | Document. | +| In `.env.example`, commented (`#FOO=bar`) | Document; add to **Verifier false positives** in `ignored-vars.md` (the verifier can't parse defaults from comments). | +| Only in `api/configs/` Pydantic, not in `.env.example` | **Don't document.** Upstream-deferred; file a PR adding it to `.env.example` first. | + +The verifier's "extra in docs" signal is not an escape hatch. Never suppress it for Pydantic-only vars via `ignored-vars.md`. + ## Four-Step Process **Pull the latest Dify code** before tracing. In the Dify codebase directory: @@ -143,7 +155,7 @@ Some variables in `.env.example` are deliberately not documented (Cloud-only, ex - Remove a variable from the docs as Cloud-only → add it under **Cloud-only (SaaS)** in `ignored-vars.md`. - Skip documenting an experimental or internal flag → add it under **Experimental / internal**. -- Document a supported variable whose `.env.example` entry is commented out → add it under **Verifier false positives**. +- Document a supported variable whose `.env.example` entry is **commented out** (e.g., `#FOO=bar`) → add it under **Verifier false positives**. This bucket is **only** for vars that exist in `.env.example` in commented form. Do not use it to suppress verifier signal for vars that are absent from `.env.example` entirely — those are upstream-deferred (see [Source of Truth](#source-of-truth-docker-env-example)) and must not be documented. Every entry must include a source reference (PR, commit, or audit date). diff --git a/.claude/skills/dify-docs-env-vars/deep-dive.md b/.claude/skills/dify-docs-env-vars/deep-dive.md index a63628935..3f0557928 100644 --- a/.claude/skills/dify-docs-env-vars/deep-dive.md +++ b/.claude/skills/dify-docs-env-vars/deep-dive.md @@ -287,9 +287,9 @@ This is primarily a developer/debugging tool. Not recommended for production due **Key code locations:** - Definition: `api/configs/deploy/__init__.py` -- Workflow debug: `api/core/workflow/workflow_entry.py` +- Workflow debug: `api/core/workflow/workflow_entry.py` (entry); `graphon/src/graphon/graph_engine/layers/debug_logging.py` (DebugLoggingLayer; lives in the graphon repo) - Tool callbacks: `api/core/callback_handler/agent_tool_callback_handler.py` -- LLM logging: `api/dify_graph/model_runtime/model_providers/__base/large_language_model.py` +- LLM logging: `graphon/src/graphon/model_runtime/model_providers/base/large_language_model.py` (graphon repo) --- @@ -1479,3 +1479,35 @@ The existing entry near line 937 describes behavior correctly, but the stated de ### POSTGRES_MAX_CONNECTIONS — default correction Covered in the "PostgreSQL / MySQL Performance Tuning Variables" section. `docker/.env.example` bumped the default from `100` to `200` upstream (`docker-compose.yaml` passes it as `-c max_connections=${POSTGRES_MAX_CONNECTIONS:-200}` to the Postgres container). The higher default is safer for Dify's multi-worker + Celery + async-task traffic shape; operators can still lower it on constrained hosts. + +--- + +### CREATORS_PLATFORM_FEATURES_ENABLED, CREATORS_PLATFORM_API_URL, CREATORS_PLATFORM_OAUTH_CLIENT_ID + +Creator Center is the submission portal where users upload Dify apps as DSL templates. Submitted templates are reviewed and, once approved, listed on Dify Marketplace. The console's **Publish to Marketplace** button (i18n key `common.publishToMarketplace` in `web/i18n/{en-US,zh-Hans,ja-JP}/workflow.json`) drives this flow. + +**Flow:** + +1. User clicks **Publish to Marketplace** in the app builder. The button is gated on `systemFeatures.enable_creators_platform` (frontend: `web/app/components/app/app-publisher/index.tsx`). +2. Frontend calls `POST /apps/{app_id}/publish-to-creators-platform`. +3. Endpoint (`api/controllers/console/app/app.py: AppPublishToCreatorsPlatformApi`) returns 403 when `CREATORS_PLATFORM_FEATURES_ENABLED` is false. Otherwise it exports the app DSL via `AppDslService.export_dsl(include_secret=False)`. +4. `core/helper/creators.upload_dsl()` POSTs the DSL to `{CREATORS_PLATFORM_API_URL}/api/v1/templates/anonymous-upload` and receives a `claim_code`. +5. `get_redirect_url()` builds the redirect with `?dsl_claim_code=...`. If `CREATORS_PLATFORM_OAUTH_CLIENT_ID` is non-empty, it also signs an OAuth authorization code via `OAuthServerService.sign_oauth_authorization_code(client_id, user_account_id)` and adds `&oauth_code=...`. +6. Frontend opens the redirect URL in a new tab, taking the user into Creator Center to fill in template details. + +**Behavior by var state:** + +- `CREATORS_PLATFORM_FEATURES_ENABLED=false`: button hidden, console API returns 403. Self-hosters use this to remove the one-click publish path. +- `CREATORS_PLATFORM_API_URL` overridden: only meaningful with a self-hosted Creator Center instance. Default `https://creators.dify.ai`. +- `CREATORS_PLATFORM_OAUTH_CLIENT_ID` empty (default): anonymous upload — the receiving Creator Center cannot attribute the template to the publishing user. + +**Key code locations:** + +- Pydantic config: `api/configs/feature/__init__.py` (`CreatorsPlatformConfig`) +- Service exposure: `api/services/feature_service.py` (`enable_creators_platform`) +- Console controller: `api/controllers/console/app/app.py` (`AppPublishToCreatorsPlatformApi`) +- Upload helper: `api/core/helper/creators.py` +- Frontend trigger: `web/app/components/app/app-publisher/index.tsx` +- UI labels: `common.publishToMarketplace` in `web/i18n/{en-US,zh-Hans,ja-JP}/workflow.json` + +**Naming note:** Env var prefix is `CREATORS_PLATFORM_*` and the backend Pydantic class is `CreatorsPlatformConfig`, but the user-facing product name is **Creator Center** and the UI button reads "Publish to Marketplace" (templates appear on Marketplace after Creator Center review). Use "Creator Center" in user-facing prose; the prefix is a backend-only artifact. diff --git a/.claude/skills/dify-docs-feature-research/SKILL.md b/.claude/skills/dify-docs-feature-research/SKILL.md index 4b9e434c8..978b21319 100644 --- a/.claude/skills/dify-docs-feature-research/SKILL.md +++ b/.claude/skills/dify-docs-feature-research/SKILL.md @@ -10,18 +10,30 @@ Pre-writing research that combines codebase analysis with community feedback to ## Before Starting 1. Ask the user which feature, node, or area to research. -2. Confirm which branch of the Dify codebase to investigate (default: `main`). +2. Confirm which branch to investigate (default: `main` for both repos). 3. Check if the user has a specific doc page in mind for the rewrite. -**Codebase location**: The Dify codebase is typically available as an additional working directory. If not, ask the user for the path. +**Codebase location**: Dify's backend logic is split across two repos. -**Pull latest code** before investigating. In the Dify codebase directory: +| Repo | Local path (typical) | GitHub | Owns | +|:-----|:---------------------|:-------|:-----| +| dify | `~/Documents/Work/Dify Repo/dify` | `langgenius/dify` | API, web, orchestration, integration nodes (Agent, Knowledge, Datasource, Trigger), Celery tasks | +| graphon | `~/Documents/Work/Dify Repo/graphon` | `langgenius/graphon` | Graph engine, runtime, model_runtime, built-in workflow nodes, HTTP/file/protocols | + +If either is missing as a working directory, ask the user for the path. + +**Pull latest code** before investigating. Run in each repo directory: ```bash git fetch origin && git checkout main && git pull origin main ``` -If the user specified a different branch, substitute accordingly. +If the user specified a different branch for either repo, substitute accordingly. -**GitHub repo**: `langgenius/dify` +**Version pinning matters.** dify pins graphon to a specific version. Before reading graphon code, check the pinned version and verify against that tag, not graphon `main`: +```bash +grep '"graphon' ~/Documents/Work/Dify\ Repo/dify/api/pyproject.toml +# e.g. "graphon~=0.2.2" → check out v0.2.2 in graphon, not main +``` +If you read graphon `main` and document behavior that ships only in an unreleased graphon version, the docs will not match what users see. When in doubt, ask the user whether to verify against the pinned version or graphon `main` (the latter is appropriate when documenting something the user knows is about to ship). ## Research Process @@ -29,19 +41,31 @@ Run Phase 1 and Phase 2 in parallel using subagents where possible. ### Phase 1: Codebase Investigation -Locate and read the source code for the feature. Cover all three layers: +First decide which repo owns the backend implementation: -**Backend implementation** — Find the core logic. For workflow nodes, check `api/dify_graph/nodes//`. Read: +| Feature class | Repo | Path | +|:--------------|:-----|:-----| +| Built-in workflow nodes (LLM, Code, HTTP Request, If/Else, Loop, Iteration, Parameter Extractor, Document Extractor, List Operator, Variable Aggregator/Assigner, Question Classifier, Template Transform, Tool, Start/End/Answer, Human Input) | graphon | `src/graphon/nodes//` | +| Integration nodes (Agent, Knowledge Retrieval, Knowledge Index, Datasource, Trigger Plugin/Schedule/Webhook) | dify | `api/core/workflow/nodes//` | +| Graph engine, runtime state, variable pool, command channels, layers | graphon | `src/graphon/graph_engine/`, `src/graphon/runtime/` | +| Model runtime, model providers, LLM/embedding/rerank invocation | graphon | `src/graphon/model_runtime/` | +| Workflow orchestration in Flask routes and Celery tasks | dify | `api/controllers/`, `api/tasks/`, `api/services/` | +| RAG and knowledge retrieval logic | dify | `api/core/rag/` | +| Tool plugins | dify | `api/core/tools/` | + +Then locate and read the source code, covering all three layers: + +**Backend implementation** — Find the core logic in the repo identified above. Read: - The main node class (execution logic, `_run()` method) - Entity definitions (data models, enums, supported types) - Any template or streaming logic -**Frontend UI** — Find the React components. For workflow nodes, check `web/app/components/workflow/nodes//`. Read: +**Frontend UI** — Find the React components in the dify repo (the web frontend was not split out). For workflow nodes, check `web/app/components/workflow/nodes//`. Read: - Panel component (what configuration options users see) - Type definitions (data shape) - Default values and validation rules -**API surface** — Trace how the feature's output reaches the API response. Check controllers, response converters, and serialization. +**API surface** — Trace how the feature's output reaches the API response. Check controllers, response converters, and serialization (all in dify). Produce a summary of: - What the feature does (based on code, not existing docs) @@ -56,13 +80,19 @@ Flag any behavior inferred from code rather than observed in the running product Search for user-reported problems and questions across these channels: -**GitHub Issues** — Run multiple searches with varied terms: +**GitHub Issues** — Run multiple searches with varied terms. Always search dify; also search graphon when the feature is a built-in workflow node, the graph engine, runtime, or model_runtime: ```bash gh issue list --repo langgenius/dify --search "" --limit 30 gh issue list --repo langgenius/dify --search "" --limit 30 gh search issues " " --repo langgenius/dify --limit 20 + +# For built-in nodes, engine, runtime, or model_runtime, also: +gh issue list --repo langgenius/graphon --search "" --limit 30 +gh search issues " " --repo langgenius/graphon --limit 20 ``` +End users typically file in dify even for graphon-owned behavior; graphon's tracker tends to hold engineering-side reports. Check both to avoid missing pain points. + **GitHub Discussions** — Search for related discussion topics: ```bash gh api "repos/langgenius/dify/discussions?per_page=30" --jq '.[] | select(.title | test(""; "i"))' diff --git a/.claude/skills/dify-docs-release-sync/SKILL.md b/.claude/skills/dify-docs-release-sync/SKILL.md index a65b0a147..6894eba50 100644 --- a/.claude/skills/dify-docs-release-sync/SKILL.md +++ b/.claude/skills/dify-docs-release-sync/SKILL.md @@ -102,17 +102,21 @@ Also check: Pydantic models and `fields/` serializers used by Service API contro Read the PR description for context. Map changed source paths to likely doc areas: -| Source path pattern | Likely doc area | -|---|---| -| `api/core/workflow/nodes/` | `en/use-dify/workflow/nodes/` | -| `api/core/rag/` | `en/use-dify/knowledge/` | -| `api/core/model_runtime/` | `en/use-dify/model-providers/` | -| `api/core/tools/` | `en/use-dify/tools/` or workflow tool node docs | -| `api/core/agent/` | `en/use-dify/build-apps/agent.mdx` | -| `api/core/app/` | `en/use-dify/build-apps/` | -| `web/app/components/` | UI-related docs (check PR description for specifics) | -| `docker/`, deployment configs | `en/getting-started/install/` | -| `api/configs/` | Configuration/environment variable docs | +| Repo | Source path pattern | Likely doc area | +|---|---|---| +| dify | `api/core/workflow/nodes/` (integration nodes only: agent, knowledge, datasource, trigger) | `en/use-dify/workflow/nodes/` | +| dify | `api/core/rag/` | `en/use-dify/knowledge/` | +| dify | `api/core/tools/` | `en/use-dify/tools/` or workflow tool node docs | +| dify | `api/core/agent/` | `en/use-dify/build-apps/agent.mdx` | +| dify | `api/core/app/` | `en/use-dify/build-apps/` | +| dify | `web/app/components/` | UI-related docs (check PR description for specifics) | +| dify | `docker/`, deployment configs | `en/getting-started/install/` | +| dify | `api/configs/` | Configuration/environment variable docs | +| graphon | `src/graphon/nodes/` (built-in nodes: llm, code, http_request, if_else, loop, iteration, parameter_extractor, document_extractor, list_operator, variable_aggregator/assigner, question_classifier, template_transform, tool, start/end/answer, human_input) | `en/use-dify/workflow/nodes/` | +| graphon | `src/graphon/model_runtime/` | `en/use-dify/model-providers/` | +| graphon | `src/graphon/graph_engine/`, `src/graphon/runtime/` | workflow engine behavior, execution semantics | + +When checking dify PRs, also scan recent merges in `langgenius/graphon` for the same release window. A user-visible workflow change may ship as a graphon release plus a dify pin bump (look for changes to `api/pyproject.toml` and `api/uv.lock`). **Important**: These mappings are heuristic. For every candidate match: diff --git a/AGENTS.md b/AGENTS.md index 75cbbb8c8..30866ea6d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -15,7 +15,7 @@ For task-specific guidance, see `writing-guides/index.md`. - Write in English only, except when specifically optimizing Chinese or Japanese translations. - Only edit the English section in `docs.json`. Translation sections sync automatically. - MDX files require `title` and `description` in YAML frontmatter. -- When writing about a feature, verify behavior against the Dify codebase, not just existing docs. Existing docs may be outdated or completely wrong. When rewriting a page, treat every claim in the original as unverified. Check field names, types, required/optional status, and behavior descriptions against the current code. Never carry forward details from legacy docs without independent verification. +- When writing about a feature, verify behavior against the Dify codebase, not just existing docs. Existing docs may be outdated or completely wrong. When rewriting a page, treat every claim in the original as unverified. Check field names, types, required/optional status, and behavior descriptions against the current code. Never carry forward details from legacy docs without independent verification. The backend is split across two repos: built-in workflow nodes, the graph engine, runtime, and model_runtime live in the `graphon` repo (version-pinned in `dify/api/pyproject.toml`); integration nodes (Agent, Knowledge, Datasource, Trigger), orchestration, RAG, and tools stay in `dify`. Verify against the graphon version actually pinned by dify, not graphon `main`. - For new features, the user may specify a development branch. Code on development branches may be in flux—when behavior is ambiguous, ask rather than assume. - When adding or updating internal-only instructions, tooling, configs, or other non-public files, ensure all paths that should not be exposed by Mintlify are covered in `.mintignore`. - Never use `--no-verify` when committing. diff --git a/en/api-reference/openapi_chatflow.json b/en/api-reference/openapi_chatflow.json index 1cb8e7b15..a93aeb296 100644 --- a/en/api-reference/openapi_chatflow.json +++ b/en/api-reference/openapi_chatflow.json @@ -29,7 +29,7 @@ "description": "Send a request to the chat application.", "operationId": "sendAdvancedChatMessage", "tags": [ - "Chats" + "Chatflows" ], "requestBody": { "description": "Request body to send a chat message.", @@ -304,14 +304,14 @@ "description": "Stops a chat message generation task. Only supported in `streaming` mode.", "operationId": "stopAdvancedChatMessageGeneration", "tags": [ - "Chats" + "Chatflows" ], "parameters": [ { "name": "task_id", "in": "path", "required": true, - "description": "Task ID, can be obtained from the streaming chunk return of the [Send Chat Message](/api-reference/chats/send-chat-message) API.", + "description": "Task ID, can be obtained from the streaming chunk return of the [Send Chat Message](/api-reference/chatflows/send-chat-message) API.", "schema": { "type": "string" } @@ -374,7 +374,7 @@ "description": "Get next questions suggestions for the current message.", "operationId": "getAdvancedSuggestedQuestions", "tags": [ - "Chats" + "Chatflows" ], "parameters": [ { @@ -2550,7 +2550,7 @@ "description": "Retrieve the current execution results of a workflow task based on the workflow execution ID.", "operationId": "getChatflowWorkflowRunDetail", "tags": [ - "Workflow Runs" + "Chatflows" ], "parameters": [ { @@ -2639,7 +2639,7 @@ "description": "Retrieve paginated workflow execution logs with filtering options.", "operationId": "listChatflowWorkflowLogs", "tags": [ - "Workflow Runs" + "Chatflows" ], "parameters": [ { @@ -2788,7 +2788,7 @@ "schema": { "type": "string" }, - "description": "Access token for the paused form, returned in the `human_input_required` event from [Send Chat Message](/api-reference/chats/send-chat-message) in streaming mode." + "description": "Access token for the paused form, returned in the `human_input_required` event from [Send Chat Message](/api-reference/chatflows/send-chat-message) in streaming mode." } ], "responses": { @@ -2967,7 +2967,7 @@ "Human Input" ], "summary": "Submit Human Input Form", - "description": "Submit the recipient's response to a paused Human Input form. The workflow resumes on acceptance; use [Stream Workflow Events](/api-reference/human-input/stream-workflow-events) to follow subsequent events. Requires **WebApp** delivery.", + "description": "Submit the recipient's response to a paused Human Input form. The workflow resumes on acceptance; use [Stream Workflow Events](/api-reference/chatflows/stream-workflow-events) to follow subsequent events. Requires **WebApp** delivery.", "operationId": "submitChatflowHumanInputForm", "parameters": [ { @@ -2977,7 +2977,7 @@ "schema": { "type": "string" }, - "description": "Access token for the paused form, returned in the `human_input_required` event from [Send Chat Message](/api-reference/chats/send-chat-message) in streaming mode." + "description": "Access token for the paused form, returned in the `human_input_required` event from [Send Chat Message](/api-reference/chatflows/send-chat-message) in streaming mode." } ], "requestBody": { @@ -3114,7 +3114,7 @@ "/workflow/{task_id}/events": { "get": { "tags": [ - "Human Input" + "Chatflows" ], "summary": "Stream Workflow Events", "description": "Resume the Server-Sent Events stream for a workflow run after a pause or a dropped SSE connection. For runs that have already finished, the stream emits a single `workflow_finished` event and closes.", @@ -3128,7 +3128,7 @@ "type": "string", "format": "uuid" }, - "description": "Workflow run ID returned by the original [Send Chat Message](/api-reference/chats/send-chat-message) request." + "description": "Workflow run ID returned by the original [Send Chat Message](/api-reference/chatflows/send-chat-message) request." }, { "name": "user", @@ -3930,7 +3930,7 @@ "external_user_id": { "type": "string", "nullable": true, - "description": "The `user` identifier provided in API requests (e.g., the `user` field in [Send Chat Message](/api-reference/chats/send-chat-message))." + "description": "The `user` identifier provided in API requests (e.g., the `user` field in [Send Chat Message](/api-reference/chatflows/send-chat-message))." }, "name": { "type": "string", @@ -5898,6 +5898,10 @@ { "type": "object", "properties": { + "workflow_run_id": { + "type": "string", + "description": "Workflow execution run ID." + }, "data": { "type": "object", "properties": { @@ -6024,7 +6028,7 @@ "workflow_run_id": { "type": "string", "format": "uuid", - "description": "Persistent identifier for this workflow run record. Use this with [Get Workflow Run Detail](/api-reference/workflows/get-workflow-run-detail) to retrieve results after execution." + "description": "Persistent identifier for this workflow run record. Use this with [Get Workflow Run Detail](/api-reference/chatflows/get-workflow-run-detail) to retrieve results after execution." }, "paused_nodes": { "type": "array", @@ -6085,6 +6089,10 @@ { "type": "object", "properties": { + "workflow_run_id": { + "type": "string", + "description": "Workflow execution run ID." + }, "data": { "type": "object", "properties": { @@ -6125,6 +6133,10 @@ { "type": "object", "properties": { + "workflow_run_id": { + "type": "string", + "description": "Workflow execution run ID." + }, "data": { "type": "object", "properties": { @@ -6654,8 +6666,8 @@ }, "tags": [ { - "name": "Chats", - "description": "Operations related to chat messages and interactions." + "name": "Chatflows", + "description": "Operations for Chatflow apps, including chat messaging, workflow run details, and event streaming." }, { "name": "Files", @@ -6685,13 +6697,9 @@ "name": "Annotations", "description": "Operations related to managing annotations for direct replies." }, - { - "name": "Workflow Runs", - "description": "Operations related to workflow execution details and logs." - }, { "name": "Human Input", - "description": "Endpoints for resuming paused workflows that require human input and for streaming workflow events." + "description": "Endpoints for resuming paused workflows that require human input." } ] } diff --git a/en/api-reference/openapi_workflow.json b/en/api-reference/openapi_workflow.json index e227f565d..1327c257c 100644 --- a/en/api-reference/openapi_workflow.json +++ b/en/api-reference/openapi_workflow.json @@ -1745,7 +1745,7 @@ "Human Input" ], "summary": "Submit Human Input Form", - "description": "Submit the recipient's response to a paused Human Input form. The workflow resumes on acceptance; use [Stream Workflow Events](/api-reference/human-input/stream-workflow-events) to follow subsequent events. Requires **WebApp** delivery.", + "description": "Submit the recipient's response to a paused Human Input form. The workflow resumes on acceptance; use [Stream Workflow Events](/api-reference/workflows/stream-workflow-events) to follow subsequent events. Requires **WebApp** delivery.", "operationId": "submitWorkflowHumanInputForm", "parameters": [ { @@ -1892,7 +1892,7 @@ "/workflow/{task_id}/events": { "get": { "tags": [ - "Human Input" + "Workflows" ], "summary": "Stream Workflow Events", "description": "Resume the Server-Sent Events stream for a workflow run after a pause or a dropped SSE connection. For runs that have already finished, the stream emits a single `workflow_finished` event and closes.", @@ -4343,7 +4343,7 @@ }, { "name": "Human Input", - "description": "Endpoints for resuming paused workflows that require human input and for streaming workflow events." + "description": "Endpoints for resuming paused workflows that require human input." } ] } diff --git a/en/self-host/configuration/environments.mdx b/en/self-host/configuration/environments.mdx index 060d6ee55..046091438 100644 --- a/en/self-host/configuration/environments.mdx +++ b/en/self-host/configuration/environments.mdx @@ -181,7 +181,7 @@ Only effective when starting with Docker image or Docker Compose. | `SERVER_WORKER_CLASS` | `gevent` | Gunicorn worker type. `gevent` provides lightweight async concurrency. Set to `geventwebsocket.gunicorn.workers.GeventWebSocketWorker` when `ENABLE_COLLABORATION_MODE` is `true`; left at `gevent`, WebSocket handshakes fail silently. Other values break psycopg2 and gRPC patching. | | `SERVER_WORKER_CONNECTIONS` | `10` | Maximum concurrent connections per worker. Only applies to async workers (gevent). If you experience connection rejections or slow responses under load, try increasing this value. | | `GUNICORN_TIMEOUT` | `360` | If a worker doesn't respond within this many seconds, Gunicorn kills and restarts it. Set to 360 (6 minutes) to support long-lived SSE connections used for streaming LLM responses. | -| `CELERY_WORKER_CLASS` | (empty; defaults to gevent) | Celery worker type. Same gevent patching requirements as `SERVER_WORKER_CLASS`—it is strongly discouraged to change. | +| `CELERY_WORKER_CLASS` | (empty; defaults to gevent) | Celery worker type with the same gevent patching requirements as `SERVER_WORKER_CLASS`. Strongly discouraged to change. | | `CELERY_WORKER_AMOUNT` | `4` | Number of Celery worker processes. Only used when autoscaling is disabled. Lower it on constrained VMs; for elastic throughput, enable `CELERY_AUTO_SCALE` instead of raising this. | | `CELERY_AUTO_SCALE` | `false` | Enable dynamic autoscaling. When enabled, Celery monitors queue depth and spawns/kills workers between `CELERY_MIN_WORKERS` and `CELERY_MAX_WORKERS`. | | `CELERY_MAX_WORKERS` | (empty; defaults to CPU count) | Maximum workers when autoscaling is enabled. | @@ -1335,6 +1335,16 @@ The plugin daemon is a separate service that manages plugin lifecycle (installat | `PLUGIN_MAX_EXECUTION_TIMEOUT` | `600` | Plugin execution timeout in seconds (plugin daemon side). Should match `PLUGIN_DAEMON_TIMEOUT` on the API side. | | `PIP_MIRROR_URL` | (empty) | Custom PyPI mirror URL used by the plugin daemon when installing plugin dependencies. Useful for faster installs or air-gapped environments. | +## Creator Center Configuration + +Creator Center (`creators.dify.ai`) is the submission portal where users upload Dify apps as templates. Submitted templates are reviewed and, once approved, listed on Dify Marketplace. The console's **Publish to Marketplace** action exports the app's DSL and uploads it to Creator Center on the user's behalf. See [Publish Apps to Marketplace](/en/use-dify/publish/publish-to-marketplace) for the user-facing flow. + +| Variable | Default | Description | +|---|---|---| +| `CREATORS_PLATFORM_FEATURES_ENABLED` | `true` | Controls whether the **Publish to Marketplace** action appears in the app builder. Set to `false` to hide the action; the underlying console API also returns 403. Useful on deployments where users shouldn't have a one-click path to submit templates externally. | +| `CREATORS_PLATFORM_API_URL` | `https://creators.dify.ai` | Endpoint that receives DSL uploads from the **Publish to Marketplace** action. Change only if running a self-hosted Creator Center instance. | +| `CREATORS_PLATFORM_OAUTH_CLIENT_ID` | (empty) | OAuth client ID issued by Creator Center. When set, the post-upload redirect carries an OAuth authorization code so Creator Center can attribute the submission to the publishing user. Empty means anonymous upload. | + ## OTLP / OpenTelemetry Configuration OpenTelemetry provides distributed tracing and metrics collection. When enabled, Dify instruments Flask and exports telemetry data to an OTLP collector. diff --git a/ja/api-reference/openapi_chatflow.json b/ja/api-reference/openapi_chatflow.json index 621dfa41c..50fd020ee 100644 --- a/ja/api-reference/openapi_chatflow.json +++ b/ja/api-reference/openapi_chatflow.json @@ -29,7 +29,7 @@ "description": "チャットアプリケーションにリクエストを送信します。", "operationId": "sendChatflowMessageJp", "tags": [ - "チャットメッセージ" + "チャットフロー" ], "requestBody": { "description": "チャットメッセージを送信するためのリクエストボディ。", @@ -304,14 +304,14 @@ "description": "チャットメッセージ生成タスクを停止します。`streaming` モードでのみサポートされます。", "operationId": "stopChatflowMessageGenerationJp", "tags": [ - "チャットメッセージ" + "チャットフロー" ], "parameters": [ { "name": "task_id", "in": "path", "required": true, - "description": "タスク ID です。[チャットメッセージを送信](/api-reference/チャットメッセージ/チャットメッセージを送信) API のストリーミングチャンクレスポンスから取得できます。", + "description": "タスク ID です。[チャットメッセージを送信](/api-reference/チャットフロー/チャットメッセージを送信) API のストリーミングチャンクレスポンスから取得できます。", "schema": { "type": "string" } @@ -374,7 +374,7 @@ "description": "現在のメッセージに対する次の質問の提案を取得します。", "operationId": "getChatflowSuggestedQuestionsJp", "tags": [ - "チャットメッセージ" + "チャットフロー" ], "parameters": [ { @@ -2550,7 +2550,7 @@ "description": "ワークフロー実行 ID に基づいて、ワークフロータスクの現在の実行結果を取得します。", "operationId": "getChatflowWorkflowRunDetailJa", "tags": [ - "ワークフロー実行" + "チャットフロー" ], "parameters": [ { @@ -2639,7 +2639,7 @@ "description": "フィルタリングオプション付きでワークフロー実行ログをページネーションで取得します。", "operationId": "listChatflowWorkflowLogsJa", "tags": [ - "ワークフロー実行" + "チャットフロー" ], "parameters": [ { @@ -2788,7 +2788,7 @@ "schema": { "type": "string" }, - "description": "一時停止フォームのアクセストークン。ストリーミングモードで [チャットメッセージを送信](/api-reference/チャットメッセージ/チャットメッセージを送信) が返す `human_input_required` イベントから取得します。" + "description": "一時停止フォームのアクセストークン。ストリーミングモードで [チャットメッセージを送信](/api-reference/チャットフロー/チャットメッセージを送信) が返す `human_input_required` イベントから取得します。" } ], "responses": { @@ -2967,7 +2967,7 @@ "人間の入力" ], "summary": "人間の入力フォームを送信", - "description": "一時停止中の人間の入力フォームに対する受信者の応答を送信します。フォームが受理されるとワークフローが再開するため、後続のイベントは [ワークフローイベントをストリーム](/api-reference/人間の入力/ワークフローイベントをストリーム) で受信してください。**WebApp** 配信が必要です。", + "description": "一時停止中の人間の入力フォームに対する受信者の応答を送信します。フォームが受理されるとワークフローが再開するため、後続のイベントは [ワークフローイベントをストリーム](/api-reference/チャットフロー/ワークフローイベントをストリーム) で受信してください。**WebApp** 配信が必要です。", "operationId": "submitChatflowHumanInputForm", "parameters": [ { @@ -2977,7 +2977,7 @@ "schema": { "type": "string" }, - "description": "一時停止フォームのアクセストークン。ストリーミングモードで [チャットメッセージを送信](/api-reference/チャットメッセージ/チャットメッセージを送信) が返す `human_input_required` イベントから取得します。" + "description": "一時停止フォームのアクセストークン。ストリーミングモードで [チャットメッセージを送信](/api-reference/チャットフロー/チャットメッセージを送信) が返す `human_input_required` イベントから取得します。" } ], "requestBody": { @@ -3114,7 +3114,7 @@ "/workflow/{task_id}/events": { "get": { "tags": [ - "人間の入力" + "チャットフロー" ], "summary": "ワークフローイベントをストリーム", "description": "一時停止後または元の SSE 接続が切断された後にワークフロー実行の Server-Sent Events ストリームを再開します。すでに完了している実行に対しては、`workflow_finished` イベントを 1 つ送信してストリームを閉じます。", @@ -3128,7 +3128,7 @@ "type": "string", "format": "uuid" }, - "description": "元の [チャットメッセージを送信](/api-reference/チャットメッセージ/チャットメッセージを送信) リクエストで返されたワークフロー実行 ID。" + "description": "元の [チャットメッセージを送信](/api-reference/チャットフロー/チャットメッセージを送信) リクエストで返されたワークフロー実行 ID。" }, { "name": "user", @@ -3930,7 +3930,7 @@ "external_user_id": { "type": "string", "nullable": true, - "description": "API リクエストで提供された `user` 識別子です(例:[チャットメッセージを送信](/api-reference/チャットメッセージ/チャットメッセージを送信) の `user` フィールド)。" + "description": "API リクエストで提供された `user` 識別子です(例:[チャットメッセージを送信](/api-reference/チャットフロー/チャットメッセージを送信) の `user` フィールド)。" }, "name": { "type": "string", @@ -5898,6 +5898,10 @@ { "type": "object", "properties": { + "workflow_run_id": { + "type": "string", + "description": "ワークフロー実行の実行 ID です。" + }, "data": { "type": "object", "properties": { @@ -6024,7 +6028,7 @@ "workflow_run_id": { "type": "string", "format": "uuid", - "description": "このワークフロー実行記録の永続的な識別子です。[ワークフロー実行詳細を取得](/api-reference/ワークフロー/ワークフロー実行詳細を取得) と組み合わせて、実行後に結果を取得します。" + "description": "このワークフロー実行記録の永続的な識別子です。[ワークフロー実行詳細を取得](/api-reference/チャットフロー/ワークフロー実行詳細を取得) と組み合わせて、実行後に結果を取得します。" }, "paused_nodes": { "type": "array", @@ -6085,6 +6089,10 @@ { "type": "object", "properties": { + "workflow_run_id": { + "type": "string", + "description": "ワークフロー実行の実行 ID です。" + }, "data": { "type": "object", "properties": { @@ -6125,6 +6133,10 @@ { "type": "object", "properties": { + "workflow_run_id": { + "type": "string", + "description": "ワークフロー実行の実行 ID です。" + }, "data": { "type": "object", "properties": { @@ -6654,8 +6666,8 @@ }, "tags": [ { - "name": "チャットメッセージ", - "description": "チャットメッセージとインタラクションに関連する操作です。" + "name": "チャットフロー", + "description": "チャットフローアプリケーションの操作です(チャットメッセージ、ワークフロー実行詳細、イベントストリーミングを含む)。" }, { "name": "ファイル操作", @@ -6685,13 +6697,9 @@ "name": "アノテーション管理", "description": "ダイレクト返信用のアノテーション管理に関連する操作です。" }, - { - "name": "ワークフロー実行", - "description": "ワークフロー実行の詳細とログに関連する操作です。" - }, { "name": "人間の入力", - "description": "人間の入力を要する一時停止中のワークフローの再開、およびワークフローイベントのストリーミング操作です。" + "description": "人間の入力を要する一時停止中のワークフローの再開操作です。" } ] } diff --git a/ja/api-reference/openapi_workflow.json b/ja/api-reference/openapi_workflow.json index 0a1d639cc..a0663f983 100644 --- a/ja/api-reference/openapi_workflow.json +++ b/ja/api-reference/openapi_workflow.json @@ -1745,7 +1745,7 @@ "人間の入力" ], "summary": "人間の入力フォームを送信", - "description": "一時停止中の人間の入力フォームに対する受信者の応答を送信します。フォームが受理されるとワークフローが再開するため、後続のイベントは [ワークフローイベントをストリーム](/api-reference/人間の入力/ワークフローイベントをストリーム) で受信してください。**WebApp** 配信が必要です。", + "description": "一時停止中の人間の入力フォームに対する受信者の応答を送信します。フォームが受理されるとワークフローが再開するため、後続のイベントは [ワークフローイベントをストリーム](/api-reference/ワークフロー/ワークフローイベントをストリーム) で受信してください。**WebApp** 配信が必要です。", "operationId": "submitWorkflowHumanInputForm", "parameters": [ { @@ -1892,7 +1892,7 @@ "/workflow/{task_id}/events": { "get": { "tags": [ - "人間の入力" + "ワークフロー" ], "summary": "ワークフローイベントをストリーム", "description": "一時停止後または元の SSE 接続が切断された後にワークフロー実行の Server-Sent Events ストリームを再開します。すでに完了している実行に対しては、`workflow_finished` イベントを 1 つ送信してストリームを閉じます。", @@ -4343,7 +4343,7 @@ }, { "name": "人間の入力", - "description": "人間の入力を要する一時停止中のワークフローの再開、およびワークフローイベントのストリーミング操作です。" + "description": "人間の入力を要する一時停止中のワークフローの再開操作です。" } ] } diff --git a/ja/self-host/configuration/environments.mdx b/ja/self-host/configuration/environments.mdx index 877ec72a7..5b93e9125 100644 --- a/ja/self-host/configuration/environments.mdx +++ b/ja/self-host/configuration/environments.mdx @@ -101,8 +101,8 @@ Docker ネットワーク内のサービス間通信で使用されるファイ この変数を設定するだけでは不十分です。共同編集は WebSocket 経由で動作するため、以下も必要です: -- `SERVER_WORKER_CLASS` を `geventwebsocket.gunicorn.workers.GeventWebSocketWorker` に設定します([コンテナ起動設定](#コンテナ起動設定)を参照)。 -- `NEXT_PUBLIC_SOCKET_URL` をブラウザからアクセス可能な WebSocket URL に設定します([CORS設定](#cors-設定)を参照)。 +- `SERVER_WORKER_CLASS` を `geventwebsocket.gunicorn.workers.GeventWebSocketWorker` に設定します([コンテナ起動設定](#コンテナ起動設定) を参照)。 +- `NEXT_PUBLIC_SOCKET_URL` をブラウザからアクセス可能な WebSocket URL に設定します([CORS 設定](#cors-設定) を参照)。 独自のリバースプロキシを使用する場合は `/socket.io/` パスで `Upgrade` および `Connection` ヘッダーを転送してください(同梱の nginx テンプレートにはこの設定が含まれています)。API を複数レプリカで運用する場合はスティッキーセッションが必要です。 @@ -183,7 +183,7 @@ Docker イメージまたは Docker Compose で起動する場合にのみ有効 | `SERVER_WORKER_CLASS` | `gevent` | Gunicorn ワーカータイプ。`gevent` は軽量な非同期並行処理を提供します。`ENABLE_COLLABORATION_MODE` が `true` の場合、`geventwebsocket.gunicorn.workers.GeventWebSocketWorker` に設定します。`gevent` のままだと WebSocket ハンドシェイクがサイレントに失敗します。他の値は psycopg2 と gRPC のパッチを壊します。 | | `SERVER_WORKER_CONNECTIONS` | `10` | ワーカーごとの最大同時接続数。非同期ワーカー(gevent)にのみ適用されます。高負荷時に接続拒否やレスポンス遅延が発生する場合は、この値を増加してください。 | | `GUNICORN_TIMEOUT` | `360` | ワーカーがこの秒数以内に応答しない場合、Gunicorn はそのワーカーを終了して再起動します。ストリーミング LLM レスポンスに使用される長時間 SSE 接続をサポートするため、360(6 分)に設定されています。 | -| `CELERY_WORKER_CLASS` | (空;デフォルトはgevent) | Celeryワーカータイプ。`SERVER_WORKER_CLASS`と同じgeventパッチ要件があります。変更は強く非推奨です。 | +| `CELERY_WORKER_CLASS` | (空;デフォルトは gevent) | Celery ワーカータイプ。`SERVER_WORKER_CLASS` と同じ gevent パッチ要件があります。変更は強く非推奨です。 | | `CELERY_WORKER_AMOUNT` | `4` | Celery ワーカープロセス数。オートスケーリング無効時のみ使用されます。リソースの限られた VM では下げてください。スループットを柔軟に調整したい場合は、この値を上げるより `CELERY_AUTO_SCALE` を有効化するほうが適切です。 | | `CELERY_AUTO_SCALE` | `false` | 動的オートスケーリングを有効化。有効時、Celery はキュー深度を監視し、`CELERY_MIN_WORKERS`から `CELERY_MAX_WORKERS` の間でワーカーを動的に生成/終了します。 | | `CELERY_MAX_WORKERS` | (空;デフォルトは CPU 数) | オートスケーリング有効時の最大ワーカー数。 | @@ -351,12 +351,12 @@ sentinel://:@:/:@:/