# @exellix/job-dispatcher

> Graph job dispatch orchestration (validate → compile → execute) for Exellix graph runtimes.

Latest version **1.0.11** (published 2026-07-10) · exellix-license license · 0 weekly downloads

## Install

```sh
npm install @exellix/job-dispatcher
pnpm add @exellix/job-dispatcher
yarn add @exellix/job-dispatcher
bun add @exellix/job-dispatcher
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.0.11 |
| Published | 2026-07-10 |
| First published | 2026-07-01 |
| Weekly downloads | 0 |
| License | exellix-license |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20.19.0 \|\| >=22.12.0 |
| Dependencies | 2 |
| Unpacked size | 175 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | exellix |
| Keywords | exellix, graph, dispatch, jobs |

## Links

- npm: https://www.npmjs.com/package/@exellix/job-dispatcher
- Repository: https://github.com/exellix/exellix-engine-mono-repo
- Homepage: https://github.com/exellix/exellix-engine-mono-repo#readme
- Issues: https://github.com/exellix/exellix-engine-mono-repo/issues
- npm.io page: https://npm.io/package/@exellix/job-dispatcher

## Dependencies (2)

- [@exellix/ai-tasks](https://npm.io/package/@exellix/ai-tasks.md) ^10.15.15
- [@exellix/graph-engine](https://npm.io/package/@exellix/graph-engine.md) ^9.6.0

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 1.0.11 (latest) — 2026-07-10
- 1.0.10 — 2026-07-07
- 1.0.9 — 2026-07-07
- 1.0.7 — 2026-07-07
- 1.0.6 — 2026-07-05
- 1.0.5 — 2026-07-05
- 1.0.4 — 2026-07-05
- 1.0.3 — 2026-07-01
- 1.0.0 — 2026-07-01

## README

# @exellix/job-dispatcher

Graph job dispatch orchestration for Exellix graph runtimes.

**Validate → normalize → compile → execute → diagnostics** in one place. Hosts send a JSON request; this package owns the dispatch pipeline and engine wiring.

Published on npm as `@exellix/job-dispatcher` (currently `1.0.4`).

## Install

```bash
npm install @exellix/job-dispatcher
```

Requires Node `>=20.19.0 || >=22.12.0`.

Dependencies: `@exellix/graph-engine`, `@exellix/ai-tasks`.

## Exports

| Import | Use |
|--------|-----|
| `@exellix/job-dispatcher` | Main re-exports |
| `@exellix/job-dispatcher/graph` | `dispatchGraphJob`, `dispatchGraphJobWithEngine`, `createExellixGraphRuntimeFromEnv`, `compileGraphDispatchPlan`, `resolveInvocationPlan` |
| `@exellix/job-dispatcher/studio` | Studio compile/execute adapters, `dispatchGraphJobWithEngine` |
| `@exellix/job-dispatcher/jobs` | `createJobsGraphDispatcher`, `buildJobsGraphDispatchRequest` (used by `@exellix/jobs`) |
| `@exellix/job-dispatcher/node` | `dispatchGraphNode` — single-node runs |
| `@exellix/job-dispatcher/matrix` | `createMatrixGraphExecuteAdapter` — matrix batch hosts |

## Quick start (orchestration only)

```js
import { dispatchGraphJob } from '@exellix/job-dispatcher/graph';

const result = await dispatchGraphJob(request, {
  compileGraph: myCompileGraphAdapter,
  executeGraph: myExecuteGraphAdapter,
});
```

## Studio graph run

```js
import { dispatchGraphJobWithEngine } from '@exellix/job-dispatcher/studio';
import { createExellixGraphRuntimeFromEnv } from '@exellix/job-dispatcher/graph';

const { exellixRuntime } = await createExellixGraphRuntimeFromEnv({ graphLoader });

const result = await dispatchGraphJobWithEngine(
  {
    mode: 'graph',
    graph: authoringDocument,
    runtime: { input: { vulnerabilityType: 'xss' } },
    jobId: 'job-abc',
  },
  {
    graphRuntimeEnvelope: { job, jobMemory, runtimeObjects },
    agentId: 'my-agent',
    exellixRuntime,
  },
);
```

## Jobs worker / factory

```js
import { createJobsGraphDispatcher } from '@exellix/job-dispatcher/jobs';

const { dispatchGraphRun } = createJobsGraphDispatcher({
  graphLoader,
  eventEmitter: activix?.eventEmitter,
});

const result = await dispatchGraphRun({
  graphId: 'graph-1',
  jobId: 'job-1',
  runtimeInput: { recordId: 'rec-1' },
  context: { jobMemory: resolvedJobMemory },
});
```

`@exellix/jobs` re-exports the same API for backward compatibility.

## Runtime `jobMemory`

The dispatcher treats `runtime.context.jobMemory` as host-resolved runtime memory and forwards it unchanged into graph-engine execution as `runtime.jobMemory`. It validates and diagnoses whether the graph reads `jobMemory`, but it does not resolve Memorix, Hippox, linked records, or associated snapshot data itself.

For jobs that assemble Memorix snapshot records, `@exellix/jobs` resolves those host concerns **before** dispatch (worker, `executeGraphJob`, Graph Studio BFF — never inside this package):

- `runtime.input` receives the graph's primary record fields.
- `runtime.context.jobMemory.context["linked-information"]` and `extendedInformation` receive configured linked/same-object context source enrichment (`resolveJobMemoryForDispatch` / worker context resolution).
- `runtime.context.jobMemory.associated*` fields receive associated/enriched sub-objects promoted out of snapshot data.

Graph Studio and other sync hosts should call `@exellix/jobs` with the same `contextSources` definition as queued jobs, then pass the resolved `jobMemory` into `dispatchGraphJobWithEngine` or `createJobsGraphDispatcher().dispatchGraphRun`.

Snapshot-associated data should be promoted into `jobMemory`, not left in the main runtime input and not nested under `jobMemory.context`. On `snapshots`, any root data property whose name starts with `associated` is treated as associated content, so this supports `associatedData`, `associatedInferred`, `associatedAnalysis`, `associatedRiskScores`, `associatedExploitability`, and other custom `associated<Something>` fields without hard-coding the known names. The worker normalizes each associated value to an array of object items and dispatches:

```js
await dispatchGraphRun({
  graphId: 'graph-1',
  jobId: 'job-1',
  runtimeInput: {
    recordId: 'rec-1',
    cveId: 'CVE-2024-1234',
  },
  context: {
    jobMemory: {
      context: {
        'linked-information': [
          { context: 'Existing linked context', data: [{ recordId: 'linked-1' }] },
        ],
      },
      associatedData: [
        { owner: 'team-x', severity: 'critical' },
      ],
      associatedRiskScores: [
        { score: 91, source: 'risk-model-v2' },
      ],
    },
  },
});
```

Graphs or skill templates that need this snapshot-associated content should read it from direct `jobMemory.associated*` fields such as `jobMemory.associatedData` or `jobMemory.associatedRiskScores`. This keeps the business input clean while still making associated/enriched data available to skills that opt into `jobMemory`, and keeps `jobMemory.context` dedicated to context-source/Hippox-style context.

## Single-node run

```js
import { dispatchGraphNode } from '@exellix/job-dispatcher/node';

await dispatchGraphNode(
  { graph, nodeId, job, jobMemory, execution, variables },
  { exellixRuntime },
);
```

## Compile-only preview

```js
import { compileGraphDispatchPlan } from '@exellix/job-dispatcher/graph';

const compiled = await compileGraphDispatchPlan(request, {
  agentId,
  jobTypeId,
  graphRuntimeEnvelope,
});
```

## What this package owns

- Request validation, normalization, orchestration, diagnostics
- Studio + jobs compile/execute adapters
- Runtime factory (`createExellixGraphRuntimeFromEnv`)
- Node and matrix execute facades
- Forwarding host-provided `jobMemory` into graph runtime and warning when assembled context is unused or missing

## What stays in hosts

- Memorix / Hippox context resolution (`@exellix/jobs`)
- Snapshot record assembly, including promoting associated/enriched `associated*` data into direct `jobMemory.associated*` fields
- Queue admission, HTTP handlers
- Authoring UI (`@exellix/graph-engine/authoring`)

## Development

```bash
npm run build --workspace=@exellix/job-dispatcher
node --test jobs-packages/job-dispatcher/tests/*.test.mjs
npm publish -w @exellix/job-dispatcher
```

---
_Source: https://npm.io/package/@exellix/job-dispatcher · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
