Workflow applications offers non-session support and is ideal for translation, article writing, summarization AI, and more.
Workflow 应用无会话支持,适合用于翻译/文章写作/总结 AI 等等。
<div>
<div>
### Base URL
### Base URL
...
@@ -14,10 +14,9 @@ Workflow applications offers non-session support and is ideal for translation, a
...
@@ -14,10 +14,9 @@ Workflow applications offers non-session support and is ideal for translation, a
### Authentication
### Authentication
The Service API uses `API-Key` authentication.
Dify Service API 使用 `API-Key` 进行鉴权。
<i>**Strongly recommend storing your API Key on the server-side, not shared or stored on the client-side, to avoid possible API-Key leakage that can lead to serious consequences.**</i>
所有 API 请求都应在 **`Authorization`** HTTP Header 中包含您的 `API-Key`,如下所示:
For all API requests, include your API Key in the `Authorization`HTTP Header, as shown below:
<CodeGroup title="Code">
<CodeGroup title="Code">
```javascript
```javascript
...
@@ -32,139 +31,138 @@ Workflow applications offers non-session support and is ideal for translation, a
...
@@ -32,139 +31,138 @@ Workflow applications offers non-session support and is ideal for translation, a
<Heading
<Heading
url='/workflows/run'
url='/workflows/run'
method='POST'
method='POST'
title='Execute workflow'
title='执行 workflow'
name='#Execute-Workflow'
name='#Execute-Workflow'
/>
/>
<Row>
<Row>
<Col>
<Col>
Execute workflow, cannot be executed without a published workflow.
执行 workflow,没有已发布的 workflow,不可执行。
### Request Body
### Request Body
- `inputs` (object) Required
- `inputs` (object) Required
Allows the entry of various variable values defined by the App.
允许传入 App 定义的各变量值。
The `inputs` parameter contains multiple key/value pairs, with each key corresponding to a specific variable and each value being the specific value for that variable.
- `blocking` Blocking mode, returns result after execution is complete. (Requests may be interrupted if the process is long)
- `blocking` 阻塞模式,等待执行完毕后返回结果。(请求若流程较长可能会被中断)。
<i>Due to Cloudflare restrictions, the request will be interrupted without a return after 100 seconds.</i>
<i>由于 Cloudflare 限制,请求会在 100 秒超时无返回后中断。</i>
- `user` (string) Required
- `user` (string) Required
User identifier, used to define the identity of the end-user for retrieval and statistics.
用户标识,用于定义终端用户的身份,方便检索、统计。
Should be uniquely defined by the developer within the application.
由开发者定义规则,需保证用户标识在应用内唯一。
- `files` (array[object]) Optional
- `files` (array[object]) Optional
File list, suitable for inputting files (images) combined with text understanding and answering questions, available only when the model supports Vision capability.
- `url` (string) Image URL (when the transfer method is `remote_url`)
- `url` (string) 图片地址(仅当传递方式为 `remote_url` 时)
- `upload_file_id` (string) Uploaded file ID, which must be obtained by uploading through the File Upload API in advance (when the transfer method is `local_file`)