Files
model-platform/contracts/events/job-node-finished-v1.json
T

163 lines
4.0 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "job-node-finished-v1.json",
"title": "Job Node Finished V1",
"description": "Job Worker 报告一次节点执行的终态,调度编排器据此推进 DAG。",
"allOf": [
{
"$ref": "event-envelope-v1.json"
},
{
"type": "object",
"properties": {
"event_type": {
"const": "job.node.finished"
},
"aggregate_type": {
"const": "schedule_node_run"
},
"payload": {
"$ref": "job-node-finished-v1.json#/$defs/payload"
}
}
}
],
"$defs": {
"ulid": {
"type": "string",
"minLength": 26,
"maxLength": 26,
"pattern": "^[0-9A-HJKMNP-TV-Z]{26}$"
},
"nullableUlid": {
"oneOf": [
{
"$ref": "job-node-finished-v1.json#/$defs/ulid"
},
{
"type": "null"
}
]
},
"payload": {
"type": "object",
"additionalProperties": false,
"required": [
"workspace_id",
"run_id",
"node_run_id",
"node_id",
"versions_id",
"attempt_no",
"node_status",
"exit_code",
"started_at",
"finished_at",
"duration_ms",
"logs_object_id",
"result_object_id",
"error_code",
"error_message"
],
"properties": {
"workspace_id": {
"$ref": "job-node-finished-v1.json#/$defs/ulid"
},
"run_id": {
"$ref": "job-node-finished-v1.json#/$defs/ulid"
},
"node_run_id": {
"$ref": "job-node-finished-v1.json#/$defs/ulid"
},
"node_id": {
"$ref": "job-node-finished-v1.json#/$defs/ulid"
},
"versions_id": {
"$ref": "job-node-finished-v1.json#/$defs/ulid"
},
"attempt_no": {
"type": "integer",
"minimum": 1,
"maximum": 11
},
"node_status": {
"enum": [
"succeeded",
"failed",
"cancelled",
"timed_out"
]
},
"exit_code": {
"type": [
"integer",
"null"
]
},
"started_at": {
"type": "string",
"format": "date-time"
},
"finished_at": {
"type": "string",
"format": "date-time"
},
"duration_ms": {
"type": "integer",
"minimum": 0
},
"logs_object_id": {
"$ref": "job-node-finished-v1.json#/$defs/nullableUlid"
},
"result_object_id": {
"$ref": "job-node-finished-v1.json#/$defs/nullableUlid"
},
"error_code": {
"type": [
"string",
"null"
],
"maxLength": 64
},
"error_message": {
"type": [
"string",
"null"
],
"maxLength": 2000
}
}
}
},
"examples": [
{
"event_id": "01K123456789ABCDEFGHJKMNQ1",
"event_type": "job.node.finished",
"schema_version": 1,
"occurred_at": "2026-07-27T08:00:03Z",
"producer": "job-worker",
"trace_id": "req-demo-0001",
"aggregate_type": "schedule_node_run",
"aggregate_id": "01K123456789ABCDEFGHJKMNQ0",
"idempotency_key": "01K123456789ABCDEFGHJKMNQ0:1:finished",
"payload": {
"workspace_id": "01K123456789ABCDEFGHJKMNPS",
"run_id": "01K123456789ABCDEFGHJKMNPR",
"node_run_id": "01K123456789ABCDEFGHJKMNQ0",
"node_id": "01K123456789ABCDEFGHJKMNPW",
"versions_id": "01K123456789ABCDEFGHJKMNPX",
"attempt_no": 1,
"node_status": "succeeded",
"exit_code": 0,
"started_at": "2026-07-27T08:00:01Z",
"finished_at": "2026-07-27T08:00:03Z",
"duration_ms": 2000,
"logs_object_id": null,
"result_object_id": null,
"error_code": null,
"error_message": null
}
}
]
}