AiRunQueuedPayload ai.run.queued@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.queued.v1.json
ai.run.queued v1 (OpenVibe.AI server/runs.js create). 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 was stored queued (it then runs inline within ?wait or on the worker). Not published for a cache hit (ai.run.cached) or a create refused by quota or a full queue. 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 low, 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 | null | yes |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: live
{
"run_id": "run_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"status": "queued",
"workflow": {
"key": "live.chat_reply",
"version": 1
},
"requester": {
"type": "service",
"id": "live"
},
"on_behalf_of": {
"type": "user",
"id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
},
"target": null,
"attribution": null,
"provider": null,
"model": null,
"fallback_used": false,
"synthetic": false,
"cached_from": null,
"usage": {
"tokens_in": 0,
"tokens_out": 0,
"cost_usd": 0,
"attempts": 0
},
"error": null,
"citations_count": 0,
"retry_of": null,
"created_at": "2026-09-23T10:00:00.000Z",
"finished_at": null
}Rejected: finished
{
"run_id": "run_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"status": "queued",
"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"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('ai.run.queued@1', value); // { valid, errors: [{ path, message }] }