获取工作流运行
开发环境
开发环境
GET
https://api.copy.ai/api/workflow/{workflow_id}/run/{run_id}
你可以通过API查看工作流运行的详细信息。
要查看一个工作流运行的详情,发送一个GET请求至 https://api.copy.ai/api/workflow/<workflow_id>/run/<run_id>。
你将收到一个响应,其中包含工作流运行的详细信息。
获取工作流运行
要查看工作流程运行,请将 GET 请求发送到。https://api.copy.ai/api/workflow/<workflow_id>/run/<run_id>
您将收到包含工作流程运行详细信息的响应。
例如:
JSON
{
"status": "success",
"data": {
"status": "COMPLETE",
"input": {
"Input 1": "Inputs vary depending on the workflow used.",
"Input 2": "The best way to see an example is to try it!"
},
"output": {
"Output 1": "Outputs vary depending on the workflow used.",
"Output 2": "The best way to see an example is to try it!"
},
"metadata": {
"api": true
},
"createdAt": "2023-04-06T22:34:46.704Z",
"id": "<run_id>",
"credits": 2
}
}
运行状态类型
地位 | 描述 |
---|---|
NEW | 工作流运行刚刚创建并准备好排队等待处理。 |
WAITING | 工作流运行正在等待满足所需的资源或条件,然后才能继续。 |
PROCESSING | 当前正在执行和处理工作流运行。 |
COMPLETE | 工作流运行已成功完成处理,并且所有步骤均已完成。 |
RETRYING | 工作流运行遇到问题,正在重试失败的步骤,然后再继续。 |
FAILED | 由于错误,工作流运行未能完成,进一步重试未成功。 |
跟踪/民意调查进度
该端点可用于实时检查工作流程运行的进度。
您可以通过在请求之间短暂延迟地重复调用端点来实现此目的。
当工作流运行完毕后,状态将更改为COMPLETE
。
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://api.copy.ai/api/workflow//run/' \
--header 'x-copy-ai-api-key: key goes here' \
--header 'x-copy-ai-api-key;'
响应示例响应示例
200 - 成功示例
{
"status": "success",
"data": {
"output": {
"text": "workflow run output"
},
"metadata": {
"interestingValue": "doublelyInterestingValue"
},
"createdAt": "2023-09-27T18:34:13.091Z",
"id": "WRUN-dc46baf3-cb19-4424-be04-95ba630409bf",
"workflowRunId": "WRUN-dc46baf3-cb19-4424-be04-95ba630409bf",
"workflowId": "WCFG-84e56597-ebaf-4b49-a98c-75cacd4aecaa",
"credits": 9001
}
}
请求参数
Path 参数
workflow_id
string
必需
run_id
string
必需
Header 参数
x-copy-ai-api-key
string
必需
示例值:
key goes here
返回响应
修改于 2023-12-26 09:51:36