AiRunSucceededPayload ai.run.succeeded@1
Generated at from
openvibe-contracts v0.33.0 and
openvibe-sdk v0.5.0.
- Version
- 1.0.0
- Owner
- ai
- Visibility
- first-party
- Status
- planned
- Compatibility
- backward
- Decision
- ADR-015
- Schema
https://openvibe.network/contracts/events/payloads/ai.run.succeeded.v1.json
ai.run.succeeded v1 (OpenVibe.AI server/runs.js execute). PLANNED: AI does not publish run events yet (its manifest notes list ai.run.queued|succeeded|failed|cached once the Events client is wired in); this is the shape it is to send. A run finished with output that matched the workflow output schema. The output itself is not in the event: a consumer that needs it reads GET /api/v1/runs/:id with ai.run.read (own runs only). A projection of ai.run@1 without input or output (ADR-015: request metadata, never raw prompts). requester is the token principal that created the run (service, app or mod). Envelope: subject { type: run, id: <run_id> }, visibility internal, priority important, actor service:ai.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
run_id | string | yes |
| |
status | const | yes |
| |
workflow | object | yes |
| |
workflow.key | string | yes | ||
workflow.version | integer | yes |
| |
requester | identity.subject-ref | yes | ||
on_behalf_of | one of | yes | ||
target | one of | yes | ||
attribution | one of | yes | ||
provider | string | null | yes | Provider that produced the output; null before a provider call and for cached runs. | |
model | string | null | yes | ||
fallback_used | boolean | yes | ||
synthetic | boolean | yes | Stub provider output. | |
cached_from | null | yes | ||
usage | object | yes |
| |
usage.tokens_in | integer | yes |
| |
usage.tokens_out | integer | yes |
| |
usage.cost_usd | number | yes |
| |
usage.attempts | integer | yes |
| |
error | null | yes | ||
citations_count | integer | yes |
| |
retry_of | string | null | yes |
| |
created_at | string | yes |
| |
finished_at | string | yes |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: news
{
"run_id": "run_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"status": "succeeded",
"workflow": {
"key": "news.summarize_story",
"version": 2
},
"requester": {
"type": "service",
"id": "news"
},
"on_behalf_of": null,
"target": {
"service": "news",
"type": "story",
"id": "sty_01JAB2C3D4E5F6G7H8J9K0MNPQ"
},
"attribution": null,
"provider": "anthropic",
"model": "claude-sonnet",
"fallback_used": true,
"synthetic": false,
"cached_from": null,
"usage": {
"tokens_in": 1200,
"tokens_out": 300,
"cost_usd": 0.0081,
"attempts": 2
},
"error": null,
"citations_count": 1,
"retry_of": null,
"created_at": "2026-09-23T10:00:00.000Z",
"finished_at": "2026-09-23T10:00:04.200Z"
}Rejected: carries-output
{
"run_id": "run_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"status": "succeeded",
"workflow": {
"key": "news.summarize_story",
"version": 2
},
"requester": {
"type": "service",
"id": "news"
},
"on_behalf_of": null,
"target": {
"service": "news",
"type": "story",
"id": "sty_01JAB2C3D4E5F6G7H8J9K0MNPQ"
},
"attribution": null,
"provider": "anthropic",
"model": "claude-sonnet",
"fallback_used": true,
"synthetic": false,
"cached_from": null,
"usage": {
"tokens_in": 1200,
"tokens_out": 300,
"cost_usd": 0.0081,
"attempts": 2
},
"error": null,
"citations_count": 1,
"retry_of": null,
"created_at": "2026-09-23T10:00:00.000Z",
"finished_at": "2026-09-23T10:00:04.200Z",
"output": {
"summary": "x"
}
}Rejected: has-error
{
"run_id": "run_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"status": "succeeded",
"workflow": {
"key": "news.summarize_story",
"version": 2
},
"requester": {
"type": "service",
"id": "news"
},
"on_behalf_of": null,
"target": {
"service": "news",
"type": "story",
"id": "sty_01JAB2C3D4E5F6G7H8J9K0MNPQ"
},
"attribution": null,
"provider": "anthropic",
"model": "claude-sonnet",
"fallback_used": true,
"synthetic": false,
"cached_from": null,
"usage": {
"tokens_in": 1200,
"tokens_out": 300,
"cost_usd": 0.0081,
"attempts": 2
},
"error": {
"code": "run.internal",
"detail": "internal error"
},
"citations_count": 1,
"retry_of": null,
"created_at": "2026-09-23T10:00:00.000Z",
"finished_at": "2026-09-23T10:00:04.200Z"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('ai.run.succeeded@1', value); // { valid, errors: [{ path, message }] }