Skip to content

Developer portal

Schedule guide

Resequence tasks when crews, dependencies, and windows collide — CP-SAT baseline every job.

GA

When to use scheduling

Use type: schedule when work items, crews, and precedence rules must stay coherent on one timeline.

Request fields

FieldTypeRequiredDescription
tasks[].idstring | numberNo

Short identifier for the work item.

e.g. foundation

tasks[].durationstring | numberNo

Estimated effort in whole planning units.

e.g. 3

tasks[].crewstring | numberNo

Crew or resource assigned to the task.

e.g. Crew B

constraints[]string | numberNo

Dependencies or blocked windows the final plan must satisfy.

e.g. framing must happen after foundation

Example

curl

curl -X POST "https://sparkling-vibrancy-production-1a7a.up.railway.app/optimize" \
  -H "Authorization: Bearer 811f31d4-5b8e-4ed0-a7a2-8176e05eba63" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "schedule",
  "tasks": [
    {
      "id": "foundation",
      "duration": 3,
      "crew": "Crew A"
    },
    {
      "id": "framing",
      "duration": 4,
      "crew": "Crew B"
    },
    {
      "id": "inspection",
      "duration": 1,
      "crew": "Inspector"
    }
  ],
  "constraints": [
    "foundation must finish before framing",
    "inspection must occur after framing",
    "Crew B unavailable on day 2"
  ]
}'

Reading the plan

The solution array lists each task with startDay/endDay (or ISO timestamps in extended payloads). Check metrics.constraintViolations — production plans should read 0.

Troubleshooting

  • 422 infeasible — relax crew windows or remove conflicting precedence.
  • method classical — hybrid did not beat baseline; still a valid plan.
  • Long runtime — reduce task count or split into planning horizons.