Skip to content

API and local runner

Automate Xentropy workflow tests with the HTTP API and local Node.js runner. Configure scoped credentials, export graphs, and inspect run results.

The platform owns service definitions, DAGs, cases and run history. Workflows execute in a browser or the local runner. No API accepts a command to execute the whole workflow in a sandbox.

Access

Use a Clerk session JWT for browser management. From Local access, create a runner token scoped to a saved workflow. It expires after 30 days and can be revoked. Its plaintext is shown once. Keep it in XENTROPY_RUNNER_TOKEN, never in a graph or context file. Use XENTROPY_API_URL for the platform origin. Requests carry Authorization: Bearer TOKEN.

node xentropy-runner.mjs workflow.json
node xentropy-runner.mjs workflow.json test-case-id
node xentropy-runner.mjs --resume RUN_ID

Download the runner from /resources/xentropy-runner.mjs, or use npm run graph:run -- before these arguments. Node.js 24+ is required. Save the workflow before exporting it for a scoped runner; it executes the exact saved revision. The CLI prints actual results and returns a nonzero status for a failed suite. Ctrl-C cancels the run.

Routes

All paths use /v1/graph.

Method/pathBehavior
GET /capabilitiesPublic auth configuration, model, prices and limits
GET /workflowsList saved workflow definitions
POST /workflowsSave a validated workflow and allocate its next revision
GET /workflows/:idRead a saved workflow
POST /runsStart `{workflow,testCaseId,location:"browser"
GET /runsRecent account runs
GET /runs/:idImmutable run input and current results
PUT /runs/:id/nodes/:nodeIdRecord a client-reported real-node observation
POST /runs/:id/heartbeatRenew runner presence
POST /runs/:id/finishFinish with passed, failed, cancelled or interrupted status
POST /runs/:id/cancelCancel pending simulations and release session state
POST /runs/:id/invocationsSubmit {nodeId,input} with Idempotency-Key
POST /runs/:id/dependencies/:dependencyId/invocationsSubmit {input} for a configured dependency endpoint with Idempotency-Key; local runs only
GET /runs/:id/invocations/:idPoll the hosted simulation result
GET /tokensInspect runner credentials without their secrets
POST /tokensCreate {name,workflowId?} credential; human authentication required
DELETE /tokens/:idRevoke a credential

Simulation statuses distinguish queued, running, completed, failed, cancelled and indeterminate. An indeterminate dispatch is not retried automatically. Preserve the same key for the same logical invocation; changing its input is a conflict. Real HTTP calls are never automatically retried.

Graph format

A workflow contains id, numeric revision, name, services, nodes, tests, and optional dependencies. Each service supplies instructions, selected files, operations and initial state. Multiple nodes and dependency endpoints may reference one service instance ID to share state within the run.

A node references serviceId, operationId, instanceId, mode, dependsOn, input and bindings. Bindings use {target,source,path} where target/path are JSON Pointers and source is $input or an upstream node ID. Every node binding must have an explicit dependency edge. Real nodes configure real.url, method, optional non-secret headers and secretHeaders mapping header names to local environment variable names. Browser execution refuses local secret references.

Cases include an ID, name, input, assertions and optional terminal nodes, initial state, scenarios and mode overrides. Assertions stay outside agent context. The editor and shared model validator describe the supported schema subset; unsupported schema features fail validation instead of being silently ignored.

One run is one session. Each case starts fresh simulated state; real-service state remains external. Completed history is evidence, not state to seed a later case. Simulated results are server-owned; real results are explicitly client-reported.

Local dependency endpoints

An entry in workflow.dependencies exposes a simulated service operation to a real application independently of DAG execution:

{
  "id": "inventory-api",
  "serviceId": "inventory",
  "operationId": "reserve",
  "instanceId": "inventory-main",
  "path": "/reserve",
  "port": 4401,
  "env": "INVENTORY_BASE_URL",
  "responseMode": "body"
}

Configure and start Service A with INVENTORY_BASE_URL=http://127.0.0.1:4401, then use a real workflow node to call A. A must read the setting and send a JSON POST to /reserve. The runner does not launch A or change its environment. The CLI binds 127.0.0.1:4401 before graph execution and closes the listener after each test. Browser execution rejects workflows containing dependency endpoints.

port must be a unique integer from 1024 through 65535. env must be a unique uppercase environment variable; reserved system and runner names are rejected. path is a literal absolute path. responseMode: "body" (the default) returns the agent output as a JSON body with HTTP 200. "http" requires {status,body}, with an integer status from 200 through 599; HTTP 204 and 304 require a null body. Define the corresponding output shape in the service instructions/schema.

The native endpoint accepts at most 2 MB of JSON and waits at most five minutes for simulation. Requests with Origin are rejected. The listener needs no xEntropy token from A and never forwards application credential headers to the provider. The runner uses its scoped token for authenticated hosted requests. HTTP 502 indicates a simulation transport failure; HTTP 504 indicates a timeout; API rejections retain their status. No failure calls the original dependency.

A may send an Idempotency-Key header of at most 200 characters. The bridge scopes it to the run and dependency; repeating the same logical request recovers its invocation, while changed input conflicts. Without one, each native request gets a new key. The hosted invocation uses the existing poll route. Keys do not carry across test sessions. Configure A's request timeout and the real graph node timeout for simulation latency; the graph's default real-call timeout is 60 seconds.

Run.dependencyCalls holds server-owned {id,dependencyId,status,input,output?,error?,createdAt,finishedAt?} entries. Status values match hosted invocations. Dependency calls use the same budget, state, serialization, and cleanup as simulated graph calls; expected assertions stay outside agent context.