跳到主要内容

自动化

该分类包含 14 条以 system.automation. 开头的 Runtime 系统命令。

1. 列出任务​

完整命令:system.automation.task.list

列出自动化任务。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:读取

sl system automation task list \
[--keyword value] [--cursor value] [--limit n] [--json]

参数:

  • keyword(可选)— Case-insensitive code/name search
  • cursor(可选)— Opaque nextCursor returned by the previous request
  • limit(可选)— Maximum definitions, 1-100; defaults to 20

2. 获取任务​

完整命令:system.automation.task.get

获取自动化任务资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:读取

sl system automation task get --definition-id <uuid> [--json]

参数:

  • definitionId(必填)— Automation definition UUID discovered with task.list

3. 创建任务​

完整命令:system.automation.task.create

根据已校验的图结构创建自动化定义与版本 1(草稿)。该命令不会发布或启用任务;审批后请用 system.automation.task.version.publish 发布返回的版本,不要对新草稿调用 activate。 · 风险:写入

sl system automation task create \
(--definition-json json|--definition-file path) [--json]

参数:

  • code(必填)— Tenant-unique stable automation code, 1-120 characters
  • name(必填)— Display name, 1-200 characters
  • description(可选)— Nullable description, at most 2000 characters
  • graphSchema(必填)— Complete persisted graph. Create atomically writes the definition and version 1 draft; it does not publish

4. 更新任务​

完整命令:system.automation.task.update

更新自动化任务资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:写入

sl system automation task update \
--definition-id <uuid> (--definition-json json|--definition-file path) \
[--json]

参数:

  • definitionId(必填)— Existing definition UUID
  • code(可选)— Replacement tenant-unique code
  • name(可选)— Replacement display name
  • description(可选)— Replacement description; null clears it

5. 启用任务​

完整命令:system.automation.task.activate

恢复一个已有已发布版本的暂停任务;不要用于草稿或刚创建的任务,那种情况应发布其草稿版本。 · 风险:写入

sl system automation task activate --definition-id <uuid> [--json]

参数:

  • definitionId(必填)— Definition UUID with an active published version. Resumes a paused task and is idempotent when already active

6. 暂停任务​

完整命令:system.automation.task.pause

暂停自动化任务资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:写入

sl system automation task pause --definition-id <uuid> [--json]

参数:

  • definitionId(必填)— Active or paused definition UUID. Pausing also pauses its schedule and is idempotent when already paused

7. 删除任务​

完整命令:system.automation.task.delete

删除自动化任务资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:高风险

sl system automation task delete --definition-id <uuid> [--json]

参数:

  • definitionId(必填)— Draft or paused definition UUID. Active or archived definitions cannot be deleted

8. 列出任务版本​

完整命令:system.automation.task.version.list

列出自动化任务版本。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:读取

sl system automation task version list \
--definition-id <uuid> [--cursor value] [--limit n] [--json]

参数:

  • definitionId(必填)— Existing definition UUID
  • cursor(可选)— Opaque nextCursor returned by the previous request
  • limit(可选)— Maximum versions, 1-100

9. 创建任务版本​

完整命令:system.automation.task.version.create

为已有自动化定义创建新的不可变草稿版本(基于已校验的图结构)。该命令不会发布或启用任务。 · 风险:写入

sl system automation task version create \
--definition-id <uuid> (--graph-json json|--graph-file path) [--json]

参数:

  • definitionId(必填)— Existing non-archived definition UUID
  • graphSchema(必填)— Complete graph snapshot for a new draft version. This does not mutate an existing snapshot

10. 发布任务版本​

完整命令:system.automation.task.version.publish

校验并发布一个草稿版本。发布会把该定义置为启用并写入 activeVersionId,因此无需再调用 task.activate。 · 风险:写入

sl system automation task version publish \
--definition-id <uuid> --version-id <uuid> [--json]

参数:

  • definitionId(必填)— Definition UUID that owns the version
  • versionId(必填)— Draft version UUID to validate and publish

11. 运行任务​

完整命令:system.automation.task.run

运行自动化任务资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:写入

sl system automation task run \
--definition-id <uuid> [--payload-json json|--payload-file path] \
[--json]

参数:

  • definitionId(必填)— Active definition UUID with a published active version
  • payload(可选)— Manual trigger payload. A form-bound single-record manual trigger requires payload.recordId

12. 列出执行​

完整命令:system.automation.execution.list

列出自动化执行。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:读取

sl system automation execution list \
[--definition-id <uuid>] [--parent-execution-id <uuid>] \
[--status value] [--keyword value] [--cursor value] [--limit n] \
[--from timestamp --to timestamp] [--json]

参数:

  • definitionId(可选)— Filter by definition UUID
  • parentExecutionId(可选)— Filter child executions of one batch root
  • status(可选)— queued, running, waiting, succeeded, failed, or canceled
  • keyword(可选)— Definition/execution keyword filter
  • cursor(可选)— Opaque cursor returned by the previous page; do not construct it
  • limit(可选)— Page size, 1-100
  • timeRange(可选)— Inclusive search window {from,to}; both values are RFC 3339 timestamps with offsets and from must precede to

13. 获取执行​

完整命令:system.automation.execution.get

获取自动化执行资源。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:读取

sl system automation execution get --execution-id <uuid> [--json]

参数:

  • executionId(必填)— Execution UUID. Returns trigger snapshot, graph snapshot, progress, output/error, and node logs

14. 列出执行批次失败项​

完整命令:system.automation.execution.batch-failure.list

列出自动化执行批次失败项。此租户级 Runtime 命令会按已注册的命令 schema 校验输入。 · 风险:读取

sl system automation execution batch-failure list \
--execution-id <uuid> [--cursor value] [--limit n] [--json]

参数:

  • executionId(必填)— Root batch execution UUID
  • cursor(可选)— Opaque nextCursor returned by the previous request
  • limit(可选)— Maximum failed children, 1-100