获取 Workflow 运行列表
获取 Workflow 运行列表
用于获取 Workflow 的运行日志列表。Workflow 由 API Key 自动鉴权确定,无需额外传入 workflow_id。
| ID 名称 | 描述 |
|---|---|
| log_id | Workflow 运行日志 ID。 |
| workflow_run_id | Workflow 单次运行 ID,用于标识一次 Workflow 执行。 |
| input | Workflow 本次运行的输入内容。 |
| output | Workflow 本次运行的输出内容。 |
请求方式
GET
调用地址
https://api-${endpoint}.gptbots.ai/v1/workflow/run/logs
调用验证
使用 Workflow API Key 进行调用验证。
请求
请求示例
curl -X GET 'https://api-${endpoint}.gptbots.ai/v1/workflow/run/logs?conversation_type=API&user_id=your_user_id&start_time=1785125443602&end_time=1785125447498&page=1&page_size=10' \
-H 'Authorization: Bearer ${API Key}'
curl -X GET 'https://api-${endpoint}.gptbots.ai/v1/workflow/run/logs?conversation_type=API&user_id=your_user_id&start_time=1785125443602&end_time=1785125447498&page=1&page_size=10' \
-H 'Authorization: Bearer ${API Key}'
此代码块在浮窗中显示
请求头
| 字段 | 类型 | 描述 |
|---|---|---|
| Authorization | Bearer ${API Key} | 使用 Authorization: Bearer ${API Key} 进行调用验证,请使用 Workflow API Key。 |
请求参数
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
| conversation_type | string | 是 | 运行来源类型。支持:ALL、API、AGENT、SHARE、C_WORKFLOW。不支持试运行 DEBUG。 |
| user_id | string | 否 | 用户标识,用于筛选指定用户的 Workflow 运行记录。 |
| start_time | number | 是 | 查询开始时间,毫秒时间戳。 |
| end_time | number | 是 | 查询结束时间,毫秒时间戳。 |
| page | number | 是 | 页码,从 1 开始。 |
| page_size | number | 是 | 每页数量,取值范围 10-100。 |
响应
响应示例
{
"list": [
{
"log_id": "6a66da44435da934b2e67e49",
"workflow_run_id": "6a66da44435da934b2e67e49",
"input": "{}",
"output": "{\"output\":\"{\\\"text\\\":\\\"Workflow output text\\\",\\\"image\\\":[],\\\"audio\\\":[]}\"}"
}
],
"total": 1
}
{
"list": [
{
"log_id": "6a66da44435da934b2e67e49",
"workflow_run_id": "6a66da44435da934b2e67e49",
"input": "{}",
"output": "{\"output\":\"{\\\"text\\\":\\\"Workflow output text\\\",\\\"image\\\":[],\\\"audio\\\":[]}\"}"
}
],
"total": 1
}
此代码块在浮窗中显示
成功响应
| 字段 | 类型 | 描述 |
|---|---|---|
| list | array | Workflow 运行日志列表。 |
| total | number | 符合查询条件的总数。 |
| list[].log_id | string | Workflow 运行日志 ID。 |
| list[].workflow_run_id | string | Workflow 单次运行 ID。 |
| list[].input | string | 输入内容,JSON 字符串。 |
| list[].output | string | 输出内容,JSON 字符串。 |
失败响应
| 字段 | 类型 | 描述 |
|---|---|---|
| code | int | 错误码。 |
| message | string | 错误详情。 |
错误码
| Code | Message |
|---|---|
| 40000 | 参数错误 |
| 40001 | 请求过于频繁 |
| 40101 | Header Authorization is empty |
| 40127 | Developer authentication failed |
