自动化
完成等待点
仅完成 event 等待点,payload 上限 32 KiB 且须满足等待条件。
仅完成 event 等待点,payload 上限 32 KiB 且须满足等待条件;timer 与 child 不支持手动完成。相同 id 与相同 payload 重放返回 replayed=true,其他重复提交返回 WAIT_ALREADY_RESOLVED,超时返回 WAIT_EXPIRED。
POST /automation/v1/runs/{id}/waits/{wait_id}/complete
鉴权
Authorization: Bearer $PRAXIS_API_KEY
请求字段
| 参数 | 类型 | 说明 |
|---|---|---|
| path: id | string | 必填;运行 ID(run_)。 |
| path: wait_id | string | 必填;该运行下的等待点 ID(wait_)。 |
application/json
不接受额外字段。
| 字段 | 类型 | 说明 |
|---|---|---|
| id | string | 可选;可选事件去重 ID;同一等待点重复提交相同 ID 和 payload 返回 replayed=true。 |
| payload | null / string / number / boolean / object / null / string / number / boolean / object / JSON[][] | 必填 / 必有;事件数据,JSON 编码最多 32 KiB;必须满足等待点的过滤条件。 |
| payload(分支5).*(分支5) | object | 递归 JSON 值。 |
| payload(分支5).*(分支6)[] | null / string / number / boolean / object / JSON[] | 递归 JSON 值。 |
| payload(分支6)[](分支5).* | null / string / number / boolean / object / JSON[] | 递归 JSON 值。 |
| payload(分支6)[](分支6)[] | null / string / number / boolean / object / JSON[] | 递归 JSON 值。 |
示例
先设置以下环境变量,使用你自己的资源:
| 变量 | 来源 |
|---|---|
| RUN_ID | 运行 id;暂停和恢复仅工作流;取消需非终态运行 |
| WAIT_ID | 同一运行中 kind=event、state=open 的等待点 id |
: "${RUN_ID:?Set RUN_ID}"
: "${WAIT_ID:?Set WAIT_ID}"
curl --fail-with-body -X POST "https://api.deepraxis.ai/automation/v1/runs/${RUN_ID}/waits/${WAIT_ID}/complete" \
-H "Authorization: Bearer $PRAXIS_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"payload": {
"answer": 42
}
}'import { createAutomationClient } from '@deepractice-ai/praxis-sdk/automation';
function env(name: string): string {
const value = process.env[name];
if (!value) throw new Error(`Set ${name}`);
return value;
}
const automation = createAutomationClient({
apiKey: env('PRAXIS_API_KEY'),
baseUrl: 'https://api.deepraxis.ai',
maxRetries: 0,
timeoutMs: 90_000,
});
const result = await automation.runs.waits.complete({
"path": {
"id": env("RUN_ID"),
"wait_id": env("WAIT_ID")
},
"body": {
"payload": {
"answer": 42
}
}
});
console.log(result);响应
HTTP 200
Success
application/json
| 字段 | 类型 | 说明 |
|---|---|---|
| id | string | 必填 / 必有;等待点 ID,前缀 wait_。 |
| run_id | string | 必填 / 必有;所属运行 ID(run_ 前缀)。 |
| kind | "event" / "timer" / "child" | 必填 / 必有;等待类型。event 等待外部事件;timer 等待到点;child 等待子运行;本接口只对 event 有效。 |
| state | "cancelled" / "open" / "resolved" / "expired" | 必填 / 必有;完成后的等待点状态。open 仍在等待;resolved 已被满足;expired 已到期;cancelled 已取消。成功提交的事件使其变为 resolved。 |
| task | null / object | 必填 / 必有;产生该等待的工作流步骤 {reference, name};没有对应步骤为 null。 |
| task(分支2).reference | string | 必填 / 必有;步骤的 JSON Pointer。 |
| task(分支2).name | string | 必填 / 必有;步骤名,即工作流 YAML 中的键。 |
| resume_at | null / string | 必填 / 必有;kind=timer 时恢复运行的时刻(RFC 3339 UTC);其它类型为 null。 |
| event_type | null / string | 必填 / 必有;kind=event 时等待的事件类型;其它类型为 null。 |
| child_run_id | null / string | 必填 / 必有;kind=child 时被等待的子运行 ID;其它类型为 null。 |
| created_at | string | 必填 / 必有;等待点创建时间(RFC 3339 UTC)。 |
| expires_at | null / string | 必填 / 必有;等待点到期时间(RFC 3339 UTC);没有期限为 null。 |
| resolved_at | null / string | 必填 / 必有;等待点被满足的时间(RFC 3339 UTC)。 |
| replayed | boolean | 必填 / 必有;true 表示这是对同一 id 且相同 payload 的重复提交,返回的是原结果而不是再次处理。 |
实测响应
HTTP 200
{
"id": "wait_wf-eebc9ef34869206fa1bcc1e2ae6375990a7ab34c5ad485ac98a4f189c4b37346",
"run_id": "run_00mv67mkw52c7fa90cc9649b1053e66fd836b071f289acb667ff8ca853e65bc4608e9a45bd",
"kind": "event",
"state": "resolved",
"task": {
"reference": "/do/0/ready",
"name": "ready"
},
"resume_at": null,
"event_type": "ready",
"child_run_id": null,
"created_at": "2026-10-13T04:57:56.982Z",
"expires_at": "2026-10-14T04:57:50.405Z",
"resolved_at": "2026-10-13T04:58:03.972Z",
"replayed": false
}错误码
| HTTP | 错误码与说明 |
|---|---|
| 400 | INVALID_PARAMS:请求参数、路径、游标或请求体格式无效。 INPUT_INVALID:输入不满足目标契约或业务校验。 |
| 404 | RUN_NOT_FOUND:运行不存在或当前租户不可见。 WAIT_NOT_FOUND:运行中不存在该等待点。 |
| 409 | OPERATION_NOT_SUPPORTED:该资源类型不支持此操作。 WAIT_ALREADY_RESOLVED:等待点已关闭,或重复事件与原提交不同。 |
| 410 | WAIT_EXPIRED:等待点已超过到期时间。 |
| 413 | PAYLOAD_TOO_LARGE:请求内容超过本操作允许的大小。 |
| default | RFC 9457 automation problem. 429 includes Retry-After. |
鉴权错误与通用错误 · 排查时保留响应头 X-Request-Id。