← All procedures

dag.createNode

This function makes a DAG node from a minimal input.

CLI
Package
@procedures/dag · README
Path
["dag","createNode"]
CLI
mark dag createNode --id <string>
As data
{"$proc":["dag","createNode"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/dag/register"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["dag","createNode"], { id: "<id>" });
console.log(JSON.stringify(result));

From the command line

$ mark dag createNode --id <string>

As data, in a program

{ "$proc": ["dag", "createNode"], "input": { "id": "<id>" } }

Input

FieldTypeRequiredDefaultDescription
idstringyes
dependenciesstring[]no
dataanyno

Output

FieldTypeRequiredDefaultDescription
idstringyesUnique identifier for this node
dependenciesstring[]yesNames/IDs of nodes this node depends on
levelnumbernoTopological level (0 = leaves, computed by Kahn's algorithm)
dataanynoOptional user data associated with this node
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string"
      },
      "dependencies": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "data": {}
    },
    "required": [
      "id"
    ],
    "additionalProperties": false
  },
  "output": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Unique identifier for this node"
      },
      "dependencies": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Names/IDs of nodes this node depends on"
      },
      "level": {
        "type": "number",
        "description": "Topological level (0 = leaves, computed by Kahn's algorithm)"
      },
      "data": {
        "description": "Optional user data associated with this node"
      }
    },
    "required": [
      "id",
      "dependencies"
    ],
    "additionalProperties": {}
  }
}