256 lines
6.3 KiB
JSON
256 lines
6.3 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "schedule-run-requested-v1.json",
|
|
"title": "Schedule Run Requested V1",
|
|
"description": "Platform API 或 Cron Dispatcher 请求调度编排器启动一次固化 DAG。",
|
|
"allOf": [
|
|
{
|
|
"$ref": "event-envelope-v1.json"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"event_type": {
|
|
"const": "schedule.run.requested"
|
|
},
|
|
"aggregate_type": {
|
|
"const": "schedule_run"
|
|
},
|
|
"payload": {
|
|
"$ref": "schedule-run-requested-v1.json#/$defs/payload"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"$defs": {
|
|
"ulid": {
|
|
"type": "string",
|
|
"minLength": 26,
|
|
"maxLength": 26,
|
|
"pattern": "^[0-9A-HJKMNP-TV-Z]{26}$"
|
|
},
|
|
"node": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"node_id",
|
|
"node_key",
|
|
"versions_id",
|
|
"script_type",
|
|
"artifact_object_id",
|
|
"artifact_path",
|
|
"timeout_seconds",
|
|
"retry_count",
|
|
"retry_interval_sec",
|
|
"arguments"
|
|
],
|
|
"properties": {
|
|
"node_id": {
|
|
"$ref": "schedule-run-requested-v1.json#/$defs/ulid"
|
|
},
|
|
"node_key": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 64
|
|
},
|
|
"versions_id": {
|
|
"$ref": "schedule-run-requested-v1.json#/$defs/ulid"
|
|
},
|
|
"script_type": {
|
|
"enum": [
|
|
"python",
|
|
"notebook"
|
|
]
|
|
},
|
|
"artifact_object_id": {
|
|
"$ref": "schedule-run-requested-v1.json#/$defs/ulid"
|
|
},
|
|
"artifact_path": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 1024
|
|
},
|
|
"timeout_seconds": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 86400
|
|
},
|
|
"retry_count": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 10
|
|
},
|
|
"retry_interval_sec": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 3600
|
|
},
|
|
"arguments": {
|
|
"type": "array",
|
|
"maxItems": 100,
|
|
"items": {
|
|
"type": "string",
|
|
"maxLength": 1000
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"edge": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"source_node_id",
|
|
"target_node_id"
|
|
],
|
|
"properties": {
|
|
"source_node_id": {
|
|
"$ref": "schedule-run-requested-v1.json#/$defs/ulid"
|
|
},
|
|
"target_node_id": {
|
|
"$ref": "schedule-run-requested-v1.json#/$defs/ulid"
|
|
}
|
|
}
|
|
},
|
|
"snapshot": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"schedule_name",
|
|
"workflow_version",
|
|
"max_concurrency",
|
|
"failure_policy",
|
|
"nodes",
|
|
"edges"
|
|
],
|
|
"properties": {
|
|
"schedule_name": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 255
|
|
},
|
|
"workflow_version": {
|
|
"type": "integer",
|
|
"minimum": 1
|
|
},
|
|
"max_concurrency": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 100
|
|
},
|
|
"failure_policy": {
|
|
"enum": [
|
|
"stop",
|
|
"continue"
|
|
]
|
|
},
|
|
"nodes": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"maxItems": 100,
|
|
"items": {
|
|
"$ref": "schedule-run-requested-v1.json#/$defs/node"
|
|
}
|
|
},
|
|
"edges": {
|
|
"type": "array",
|
|
"maxItems": 500,
|
|
"items": {
|
|
"$ref": "schedule-run-requested-v1.json#/$defs/edge"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"payload": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"workspace_id",
|
|
"schedule_id",
|
|
"run_id",
|
|
"workflow_version",
|
|
"trigger_type",
|
|
"triggered_by",
|
|
"schedule_snapshot"
|
|
],
|
|
"properties": {
|
|
"workspace_id": {
|
|
"$ref": "schedule-run-requested-v1.json#/$defs/ulid"
|
|
},
|
|
"schedule_id": {
|
|
"$ref": "schedule-run-requested-v1.json#/$defs/ulid"
|
|
},
|
|
"run_id": {
|
|
"$ref": "schedule-run-requested-v1.json#/$defs/ulid"
|
|
},
|
|
"workflow_version": {
|
|
"type": "integer",
|
|
"minimum": 1
|
|
},
|
|
"trigger_type": {
|
|
"enum": [
|
|
"manual",
|
|
"cron",
|
|
"api",
|
|
"retry"
|
|
]
|
|
},
|
|
"triggered_by": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "schedule-run-requested-v1.json#/$defs/ulid"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"schedule_snapshot": {
|
|
"$ref": "schedule-run-requested-v1.json#/$defs/snapshot"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"examples": [
|
|
{
|
|
"event_id": "01K123456789ABCDEFGHJKMNPQ",
|
|
"event_type": "schedule.run.requested",
|
|
"schema_version": 1,
|
|
"occurred_at": "2026-07-27T08:00:00Z",
|
|
"producer": "platform-api",
|
|
"trace_id": "req-demo-0001",
|
|
"aggregate_type": "schedule_run",
|
|
"aggregate_id": "01K123456789ABCDEFGHJKMNPR",
|
|
"idempotency_key": "run-demo-0001",
|
|
"payload": {
|
|
"workspace_id": "01K123456789ABCDEFGHJKMNPS",
|
|
"schedule_id": "01K123456789ABCDEFGHJKMNPT",
|
|
"run_id": "01K123456789ABCDEFGHJKMNPR",
|
|
"workflow_version": 1,
|
|
"trigger_type": "manual",
|
|
"triggered_by": "01K123456789ABCDEFGHJKMNPV",
|
|
"schedule_snapshot": {
|
|
"schedule_name": "每日模型演示",
|
|
"workflow_version": 1,
|
|
"max_concurrency": 1,
|
|
"failure_policy": "stop",
|
|
"nodes": [
|
|
{
|
|
"node_id": "01K123456789ABCDEFGHJKMNPW",
|
|
"node_key": "prepare",
|
|
"versions_id": "01K123456789ABCDEFGHJKMNPX",
|
|
"script_type": "python",
|
|
"artifact_object_id": "01K123456789ABCDEFGHJKMNPY",
|
|
"artifact_path": "versions/prepare/v1.py",
|
|
"timeout_seconds": 600,
|
|
"retry_count": 0,
|
|
"retry_interval_sec": 5,
|
|
"arguments": []
|
|
}
|
|
],
|
|
"edges": []
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|