Reference

DAG schema

A Euriklis compute request is a directed acyclic graph of typed operations, expressed as a single JSON document. This section defines the request grammar exhaustively: top-level structure, node and edge semantics, placeholder resolution, and the mechanisms for ingesting external data.

§1

Top-level structure

The request object is required to declare an entry node, a bounded iteration budget, and the collections of nodes and edges that make up the graph.

FieldTypeDescription
entrystringThe name of the node at which evaluation begins.
maxIterationspositive integer (default 1000)An upper bound on the number of node visits. Guards against non-terminating cyclic executions.
nodesarray of node objectsThe set of computational nodes.
edgesarray of edge objectsThe transitions between nodes; may be empty for single-node graphs.
filesobject (optional)Map of placeholder-name → upload identifier for pre-uploaded files. See File ingest below.
Minimal single-node graph
{
  "entry": "start",
  "maxIterations": 100,
  "nodes": [
    {
      "name": "start",
      "operations": [
        {
          "operation": "math.matrix.random",
          "arguments": { "rows": 4, "columns": 4 },
          "as": "$M"
        }
      ],
      "return": ["$M"]
    }
  ],
  "edges": []
}
§2

Nodes

A node encapsulates a linear sequence of operations that share a local binding scope. Operations within a node execute in declared order; each writes its output under the label given by as.

FieldTypeDescription
namestringThe node identifier. Must be unique within the graph and is referenced by entry and by edge endpoints.
inputobject (optional)An initial binding scope for the node — a map from unprefixed placeholder names to values injected at node entry.
operationsarray of operation objectsThe ordered list of operations to execute at this node.
returnarray of placeholdersThe subset of bindings to publish as the node's output. The entry node's return set constitutes the result of the request.
§3

Operations and placeholders

An operation is a triple of an operation name, its arguments, and the binding label under which its output is stored. Operation names are dotted paths into the registry — for example math.matrix.transpose, math.constants.pi, finance.efficientFrontier.

FieldTypeDescription
operationstringDotted registry path (e.g. math.matrix.svd).
argumentsobjectOperation-specific parameters. Values may be literals or placeholders. Signatures are documented in the Operations catalog.
asplaceholderLabel under which the operation's output is bound.

Placeholder grammar. A placeholder is a string matching the pattern ^\$(?:state\.)?[a-zA-Z_][a-zA-Z0-9_]*$. Two scopes are distinguished:

  • $name denotes a value in the local scopeof the current node, valid for the duration of that node's evaluation.
  • $state.name denotes a value in the graph state, which persists across node transitions and is available to any subsequently evaluated node.
Two nodes, state propagation
{
  "entry": "build",
  "maxIterations": 100,
  "nodes": [
    {
      "name": "build",
      "operations": [
        {
          "operation": "math.matrix.random",
          "arguments": { "rows": 5, "columns": 5 },
          "as": "$state.A"
        }
      ],
      "return": ["$state.A"]
    },
    {
      "name": "decompose",
      "operations": [
        {
          "operation": "math.matrix.svd",
          "arguments": { "x": "$state.A" },
          "as": "$decomp"
        }
      ],
      "return": ["$decomp"]
    }
  ],
  "edges": [
    { "from": "build", "to": "decompose" }
  ]
}
§4

Edges and guarded transitions

Edges declare admissible transitions between nodes. An unconditional edge (with no condition) is always traversed. A conditional edge carries a small block of its own operations whose final return value determines admission: the edge is traversed if and only if the value is truthy.

FieldTypeDescription
fromstringThe name of the source node.
tostringThe name of the target node.
namestring (optional)An identifier for the edge, used for diagnostics.
conditionobject or null (optional)An operation block returning a single placeholder. When present, the edge is traversed only if the returned value is truthy.
A guarded edge
{
  "from": "compute",
  "to": "refine",
  "condition": {
    "operations": [
      {
        "operation": "math.matrix.FrobeniusNorm",
        "arguments": { "x": "$residual" },
        "as": "$normValue"
      }
    ],
    "return": "$normValue"
  }
}
Cyclic edges are admissible provided the maxIterationsbudget is respected. Exceeding the budget aborts execution with a runtime error.
§5

File ingest

External files may be introduced into a computation in one of two modes. In both, a placeholder name (e.g. file, rates) is bound to a filesystem path in the entry node's input scope, whereupon file-consuming operations such as data.readExcel reference the placeholder as their filePath argument.

Multipart form-data. The request body is encoded as multipart/form-data with the graph JSON supplied under the field name graph, and one or more files supplied as additional form parts. The form field name of each file becomes the bound placeholder.

curl -X POST https://api.euriklis.com/v1/compute \
  -H "x-api-key: $EURIKLIS_API_KEY" \
  -F 'graph={"entry":"read","nodes":[{"name":"read","operations":[
      {"operation":"data.readExcel","arguments":{"filePath":"$file"},"as":"$rows"}
    ],"return":["$rows"]}],"edges":[]}' \
  -F 'file=@dataset.xlsx'

Pre-uploaded references.A file previously uploaded via the platform's upload endpoint is referenced by its identifier within the request body under the top-level filesfield. The identifier is resolved server-side and injected into the entry node's input before validation.

Request with a pre-uploaded reference
{
  "entry": "read",
  "maxIterations": 10,
  "files": { "file": "upl_a1b2c3d4" },
  "nodes": [
    {
      "name": "read",
      "operations": [
        {
          "operation": "data.readExcel",
          "arguments": { "filePath": "$file" },
          "as": "$rows"
        }
      ],
      "return": ["$rows"]
    }
  ],
  "edges": []
}
§6

Response format

A successful compute request returns an envelope of the form{ "success": true, "data": { ... } }, where the data object carries two fields: result, a map from the entry node's returned placeholders (with the leading$ and any state. prefix stripped) to their computed values; and ecuUsed, the total Euriklis Compute Unit cost of the request.

Errors return { "success": false, "error": "…" }, with an additional details field for structured validation diagnostics. HTTP status codes distinguish the failure class; see the HTTP API reference.

§7

Static-analysis guarantees

Every submitted graph is subjected to the following checks prior to execution. A failure at any step returns a structured diagnostic and does not incur ECU consumption.

  • Schema conformance. The request must match the top-level shape defined in §1, including placeholder syntactic correctness in all as fields.
  • Operation resolution. Every operationidentifier must resolve to a registered entry.
  • Argument validation.Each operation'sarguments object is validated against its declared input schema (types, arities, ranges).
  • Reference integrity. Every placeholder appearing inside an argumentsvalue must be defined earlier in the same node's scope, in the graph state, or in the node's input.
  • Iteration bound. Execution is aborted if the number of node visits exceeds maxIterations.