Workflow
DAG critical (longest) path API
Finds the longest-weighted path through a DAG of weighted nodes and returns earliest/latest start, finish and slack per node so zero-slack tasks are flagged as critical. Answers 'What is the longest path through my task graph?', 'Which steps have no schedule slack?'.
Price$0.03per request
MethodPOST
Route/v1/workflow/critical-path-graph
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
critical-pathlongest-pathdagslackgraphschedulecpmworkflow
API URL
Integration docshttps://x402.hexl.dev/v1/workflow/critical-path-graphExample request
{
"nodes": [
{
"id": "a",
"duration": 3
},
{
"id": "b",
"duration": 2
},
{
"id": "c",
"duration": 4
}
],
"edges": [
[
"a",
"b"
],
[
"a",
"c"
],
[
"b",
"c"
]
]
}Example response
{
"criticalPath": [
"a",
"b",
"c"
],
"length": 9,
"nodes": [
{
"id": "a",
"es": 0,
"ef": 3,
"ls": 0,
"lf": 3,
"slack": 0
},
{
"id": "b",
"es": 3,
"ef": 5,
"ls": 3,
"lf": 5,
"slack": 0
},
{
"id": "c",
"es": 5,
"ef": 9,
"ls": 5,
"lf": 9,
"slack": 0
}
],
"interpretation": "Critical path a -> b -> c has length 9; zero-slack tasks are critical."
}Input schema
{
"type": "object",
"required": [
"nodes",
"edges"
],
"properties": {
"nodes": {
"type": "array",
"examples": [
[
{
"id": "a",
"duration": 3
},
{
"id": "b",
"duration": 2
},
{
"id": "c",
"duration": 4
}
]
]
},
"edges": {
"type": "array",
"examples": [
[
[
"a",
"b"
],
[
"a",
"c"
],
[
"b",
"c"
]
]
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}