Unify Automations
Logo
OR Solver

OR Solver

The OR Solver node solves optimization and constraint-satisfaction problems from within an automation. Define a mathematical model- variables, constraints, and an objective- and the node finds the best feasible solution using the solver type you choose.

Overview

Operations research (OR) solvers find optimal assignments, schedules, allocations, and routes when the solution space is too large for brute-force search. The OR Solver node exposes this capability without requiring code: you build the model step by step using the node's operations, then call Solve.

Screenshot_2026-08-29_at_10.39.52_PM_1.png
Screenshot_2026-08-29_at_10.39.52_PM_1.png

Building a Model

A model is built in sequence — each operation adds to the solver session you pass forward:

  1. Create Solver — initialize a solver and choose the Solver Algorithm (SCIP by default). This is also where you set the Time Limit (seconds) (default 300) and Threads (default 4). The Solver ID is returned and passed to every subsequent operation.

  2. Add Variable (or Add Variables for several at once) — define the decision variables the solver may adjust. Each variable has a name, a type (Continuous, Integer or Boolean), and lower and upper bounds.

  3. Create Constraint (or Create Constraints) — create an empty constraint with a comparison type (≤, ≥ or =) and a right-hand side (RHS) value.

  4. Add Term — add variables and their coefficients to each constraint. A constraint with no terms is empty.

  5. Create Objective — create an empty objective and choose Minimize (the default) or Maximize.

  6. Add Objective Term — add variables and their coefficients to the objective.

  7. Solve — run the solver. The output contains the solution status and the objective value, along with the solve time and the number of variables and constraints.

  8. Get Solution or Get Variable Value — read the values of the variables. Get Solution returns only non-zero values by default.

Use List Variables to see the variables you have added, and Export Model (Debug) to export the full model as LP or MPS text before you call Solve.

Note: Always pass the Solver ID from one operation to the next. Each step mutates the same session, so losing the reference mid-chain leaves the model incomplete.

Solver Types

Choose the solver type when you create the solver. The choice determines which class of problems the engine can handle:

  • GLOP — linear programming. Use when all variables are continuous and all constraints are linear. Fastest option for linear models.

  • SCIP — mixed-integer programming. Use when some variables must take integer values (e.g., whole units, binary on/off). More powerful than GLOP but slower.

  • CBC — another mixed-integer solver. Similar capability to SCIP; useful as an alternative if SCIP times out on a particular model shape.

  • CP-SAT — constraint programming and satisfiability. Use for combinatorial problems — scheduling, assignment, and routing — where you need to satisfy a set of hard constraints.

  • HiGHS — high-performance LP and MIP solver. Use for large-scale linear and mixed-integer models where performance is critical.

Time Limits and Async Execution

Complex models can take a long time to solve. The Time Limit (seconds) on Create Solver caps how long the solver runs; it defaults to 300 seconds. When the limit is reached, the solver returns the best feasible solution found so far (which may not be globally optimal) rather than failing.

Solve always runs asynchronously — the automation pauses while the solver works and resumes with the result when it finishes.

Checking the Solution Status

The Solve operation returns a status field and the objective value. Always check the status before reading the variable values with Get Solution or Get Variable Value:

  • Optimal — the solver found the best possible solution.

  • Feasible — the solver found a solution that satisfies all constraints, but optimality was not proven (e.g., the time limit was hit). The solution is usable but may not be the best possible.

  • Infeasible — no solution exists that satisfies all constraints. Review your constraints — they may be contradictory, or the variable bounds may be too tight.

  • Unbounded — the objective can improve without limit. Check that your variables have bounds and that the constraints restrict the objective.

  • Not solved — the solver did not produce a solution.

Note: A Feasible status when you expected Optimal usually means the time limit was hit. Increase the time limit or simplify the model if you need the optimal solution.

Notes

Keep these practices in mind when building models with the OR Solver node:

  • Start with GLOP for any purely linear model — it is significantly faster than the integer solvers on the same problem size.

  • Use CP-SAT for scheduling and assignment problems where the variables are naturally integer or binary.

  • If a model returns Infeasible, add an Export Model (Debug) step before Solve — contradictory constraints are easier to spot when the full model is written out.

  • Store intermediate solver references in a Variable node if you need to reference them across branches.

  • The default time limit is 300 seconds; set the Time Limit on Create Solver to match your model in production.

Choosing the right solver type and setting a time limit are the two decisions that most affect whether the OR Solver node performs reliably in production.