自动化

列出触发历史

按时间倒序读取最近 30 天的触发记录。

按时间倒序读取最近 30 天的触发记录。结果包括实际版本、运行 ID 与失败原因。

GET /automation/v1/triggers/{id}/firings

鉴权

Authorization: Bearer $PRAXIS_API_KEY

请求字段

参数类型说明
path: idstring必填;触发器 ID(trg_)。
query: limitinteger可选;每页条数,整数 1–100,默认 25。 minimum: 1;maximum: 100
query: cursorstring可选;上一页返回的 next_cursor,不透明字符串;保持原查询条件继续翻页。
query: outcome"accepted" / "started" / "skipped_overlap" / "missed" / "failed" / "deduped"[]可选;按结果筛选,多个值用逗号分隔(OR);与 run_id 同时提供时取交集。
query: run_idstring可选;仅返回关联此运行 ID 的记录。

示例

先设置以下环境变量,使用你自己的资源:

: "${TRIGGER_ID:?Set TRIGGER_ID}"
curl --fail-with-body -X GET "https://api.deepraxis.ai/automation/v1/triggers/${TRIGGER_ID}/firings" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"
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.triggers.firings.list({
  "path": {
    "id": env("TRIGGER_ID")
  }
});
console.log(result);

响应

HTTP 200

Success

application/json

字段类型说明
dataobject[]必填 / 必有;本页的最近 30 天的触发记录,按 created_at 倒序、id 倒序排列。
data[].idstring必填 / 必有;触发记录 ID;记录保留 30 天。
data[].trigger_idstring必填 / 必有;所属触发器 ID(trg_ 前缀)。
data[].scheduled_atstring必填 / 必有;计划触发的时间(RFC 3339 UTC);webhook 取请求到达时间。 format: "date-time"
data[].fired_atstring必填 / 必有;实际触发的时间(RFC 3339 UTC)。 format: "date-time"
data[].outcome"accepted" / "started" / "skipped_overlap" / "missed" / "failed" / "deduped"必填 / 必有;触发结果。accepted 已持久化等待处理;started 已创建运行;skipped_overlap 因上一次运行未结束而跳过;missed 到点时延迟超过补跑窗口,不补跑;failed 创建运行失败;deduped 与 24 小时内相同 webhook-id 的请求重复,已去重。
data[].run_idstring / null必填 / 必有;本次触发创建的运行 ID(run_ 前缀);未创建运行为 null。
data[].resolved_versionstring / null必填 / 必有;本次触发实际解析到的精确版本号;尚未解析或失败时为 null。
data[].errorobject / null必填 / 必有;触发失败时的原因 {code, message};没有失败为 null。
data[].error(分支1).codestring必填 / 必有;失败的错误码。
data[].error(分支1).messagestring必填 / 必有;失败的说明文字。
next_cursorstring / null必填 / 必有;下一页游标,原样传给 cursor 参数并保持原查询条件;没有更多页为 null。接口不返回总数。

实测响应

HTTP 200

{
  "data": [
    {
      "id": "frg_00mv67n833fec8a47a90904782ac1a8f1fef264379",
      "trigger_id": "trg_00mv67mzzqa0d63b98d72446dd9d1331051a3e100e",
      "scheduled_at": "2026-10-13T04:58:20.215Z",
      "fired_at": "2026-10-13T04:58:20.215Z",
      "outcome": "started",
      "run_id": "run_00mv67n8ao7de994212f453fdfe7def756b57ec5cdeb562a1222f554c6f3d9f428ec25480e",
      "resolved_version": "1.0.0",
      "error": null
    },
    {
      "id": "frg_00mv67n6in516077a64cfc4102a4da939476a3fa78",
      "trigger_id": "trg_00mv67mzzqa0d63b98d72446dd9d1331051a3e100e",
      "scheduled_at": "2026-10-13T04:58:18.384Z",
      "fired_at": "2026-10-13T04:58:18.384Z",
      "outcome": "started",
      "run_id": "run_00mv67n6vvebb47a96bf4b54630d8a07786ec923a68d3b722c2f7ffca4e0a553053c4a5421",
      "resolved_version": "1.0.0",
      "error": null
    }
  ],
  "next_cursor": null
}

错误码

HTTP错误码与说明
400INVALID_PARAMS:请求参数、路径、游标或请求体格式无效。
404TRIGGER_NOT_FOUND:触发器不存在或不可访问,回调鉴权失败也使用此错误。
defaultRFC 9457 automation problem. 429 includes Retry-After.

鉴权错误与通用错误 · 排查时保留响应头 X-Request-Id。

导出

本页内容