ToolsJobSucceededPayload tools.job.succeeded@1

Generated at from openvibe-contracts v0.33.0 and openvibe-sdk v0.5.0.

Version
1.0.0
Owner
tools
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/events/payloads/tools.job.succeeded.v1.json

tools.job.succeeded v1 (OpenVibe.Tools apps/_shared/jobs/events.js). The job finished and its result files are stored (in Media when TOOLS_JOB_RESULTS=media). Emitted in the transaction that records the transition, beside the job's own SSE event. Carries ids, type, owner, state, times and result locations; never the job's input, its files, its output data or a session. Jobs of sandbox app tokens are not announced. Envelope: subject { type: job, id: <job_id> }, visibility internal, priority important, actor service:tools.

Fields

FieldTypeRequiredDescriptionConstraints
job_idstringyes
  • pattern ^job_[0-9A-HJKMNP-TV-Z]{26}$
servicestringyesThe Tools satellite that runs the job (img, audio, docs…).
  • pattern ^[a-z][a-z0-9-]{1,39}$
typestringyesJob type, e.g. img.process.
  • pattern ^[a-z][a-z0-9]*\.[a-z0-9_.]+$
  • maxLength 80
type_versionintegeryes
  • minimum 1
stateconstyes
  • = "succeeded"
ownerone ofyesWho submitted the job: a user (user:usr_…), a service, app or mod principal. null for an anonymous browser session; the session is never published.
attemptsintegeryes
  • minimum 0
max_attemptsintegeryes
  • minimum 1
created_atstringyes
  • format date-time
retry_ofstring | nullyesThe failed job this one retries (POST /api/v1/jobs/:id/retry).
  • pattern ^job_[0-9A-HJKMNP-TV-Z]{26}$
started_atstringyes
  • format date-time
finished_atstringyes
  • format date-time
expires_atstring | nullyesWhen the job and its result files are pruned; null while something references the result (PUT /api/v1/jobs/:id/references/:ref).
  • format date-time
resultobjectyesWhere the result files are, never their content, names or the tool's output data (GET /api/v1/jobs/:id has those, for the owner).
  • no other fields
result.filesarray of objectyes
  • maxItems 100
  • items: no other fields
result.files[].indexintegeryesn in /api/v1/jobs/:id/files/:n.
  • minimum 0
result.files[].mimestringyes
  • minLength 1
  • maxLength 200
result.files[].sizeintegeryes
  • minimum 0
result.files[].sha256stringyes
  • pattern ^[0-9a-f]{64}$
result.files[].storageenumyesmedia: stored as an OpenVibe.Media object (TOOLS_JOB_RESULTS=media); local: kept on the satellite until the job expires.
  • one of "local", "media"
result.files[].mediaone ofyes{ media_id, role: output } when storage is media.

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: media-result
{
  "job_id": "job_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "service": "img",
  "type": "img.process",
  "type_version": 1,
  "state": "succeeded",
  "owner": {
    "type": "app",
    "id": "app_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "attempts": 1,
  "max_attempts": 3,
  "created_at": "2026-09-23T09:00:00.000Z",
  "retry_of": null,
  "started_at": "2026-09-23T09:00:01.000Z",
  "finished_at": "2026-09-23T09:00:04.000Z",
  "expires_at": "2026-09-23T10:00:04.000Z",
  "result": {
    "files": [
      {
        "index": 0,
        "mime": "image/webp",
        "size": 48213,
        "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
        "storage": "media",
        "media": {
          "media_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPS",
          "role": "output"
        }
      },
      {
        "index": 1,
        "mime": "image/png",
        "size": 90112,
        "sha256": "60303ae22b998861bce3b28f33eec1be758a213c86c93c076dbe9f558c11c752",
        "storage": "local",
        "media": null
      }
    ]
  }
}
Rejected: output-data
{
  "job_id": "job_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "service": "img",
  "type": "img.process",
  "type_version": 1,
  "state": "succeeded",
  "owner": null,
  "attempts": 1,
  "max_attempts": 3,
  "created_at": "2026-09-23T09:00:00.000Z",
  "retry_of": null,
  "started_at": "2026-09-23T09:00:01.000Z",
  "finished_at": "2026-09-23T09:00:04.000Z",
  "expires_at": null,
  "result": {
    "files": [],
    "data": {
      "text": "transcribed words"
    }
  }
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('tools.job.succeeded@1', value);   // { valid, errors: [{ path, message }] }