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

FieldTypeRequiredDescriptionConstraints
run_idstringyes
  • pattern ^run_[0-9A-HJKMNP-TV-Z]{26}$
statusconstyes
  • = "succeeded"
workflowobjectyes
  • no other fields
workflow.keystringyes
workflow.versionintegeryes
  • minimum 1
requesteridentity.subject-refyes
on_behalf_ofone ofyes
targetone ofyes
attributionone ofyes
providerstring | nullyesProvider that produced the output; null before a provider call and for cached runs.
modelstring | nullyes
fallback_usedbooleanyes
syntheticbooleanyesStub provider output.
cached_fromnullyes
usageobjectyes
  • no other fields
usage.tokens_inintegeryes
  • minimum 0
usage.tokens_outintegeryes
  • minimum 0
usage.cost_usdnumberyes
  • minimum 0
usage.attemptsintegeryes
  • minimum 0
errornullyes
citations_countintegeryes
  • minimum 0
retry_ofstring | nullyes
  • pattern ^run_[0-9A-HJKMNP-TV-Z]{26}$
created_atstringyes
  • format date-time
finished_atstringyes
  • format date-time

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 }] }