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.
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.
| Field | Type | Description |
|---|---|---|
entry | string | The name of the node at which evaluation begins. |
maxIterations | positive integer (default 1000) | An upper bound on the number of node visits. Guards against non-terminating cyclic executions. |
nodes | array of node objects | The set of computational nodes. |
edges | array of edge objects | The transitions between nodes; may be empty for single-node graphs. |
files | object (optional) | Map of placeholder-name → upload identifier for pre-uploaded files. See File ingest below. |
{
"entry": "start",
"maxIterations": 100,
"nodes": [
{
"name": "start",
"operations": [
{
"operation": "math.matrix.random",
"arguments": { "rows": 4, "columns": 4 },
"as": "$M"
}
],
"return": ["$M"]
}
],
"edges": []
}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.
| Field | Type | Description |
|---|---|---|
name | string | The node identifier. Must be unique within the graph and is referenced by entry and by edge endpoints. |
input | object (optional) | An initial binding scope for the node — a map from unprefixed placeholder names to values injected at node entry. |
operations | array of operation objects | The ordered list of operations to execute at this node. |
return | array of placeholders | The subset of bindings to publish as the node's output. The entry node's return set constitutes the result of the request. |
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.
| Field | Type | Description |
|---|---|---|
operation | string | Dotted registry path (e.g. math.matrix.svd). |
arguments | object | Operation-specific parameters. Values may be literals or placeholders. Signatures are documented in the Operations catalog. |
as | placeholder | Label 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:
$namedenotes a value in the local scopeof the current node, valid for the duration of that node's evaluation.$state.namedenotes a value in the graph state, which persists across node transitions and is available to any subsequently evaluated node.
{
"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" }
]
}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.
| Field | Type | Description |
|---|---|---|
from | string | The name of the source node. |
to | string | The name of the target node. |
name | string (optional) | An identifier for the edge, used for diagnostics. |
condition | object or null (optional) | An operation block returning a single placeholder. When present, the edge is traversed only if the returned value is truthy. |
{
"from": "compute",
"to": "refine",
"condition": {
"operations": [
{
"operation": "math.matrix.FrobeniusNorm",
"arguments": { "x": "$residual" },
"as": "$normValue"
}
],
"return": "$normValue"
}
}maxIterationsbudget is respected. Exceeding the budget aborts execution with a runtime error.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.
{
"entry": "read",
"maxIterations": 10,
"files": { "file": "upl_a1b2c3d4" },
"nodes": [
{
"name": "read",
"operations": [
{
"operation": "data.readExcel",
"arguments": { "filePath": "$file" },
"as": "$rows"
}
],
"return": ["$rows"]
}
],
"edges": []
}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.
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
asfields. - Operation resolution. Every
operationidentifier must resolve to a registered entry. - Argument validation.Each operation's
argumentsobject 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'sinput. - Iteration bound. Execution is aborted if the number of node visits exceeds
maxIterations.