Skip to content

Decision Tree Evaluator

Taxi & Private HireProductsDecisionTree › Decision Tree Evaluator

Generally available

Configurable rules engine: tenant-defined JSON decision trees evaluate against runtime context to produce yes/no or routing decisions. Used by queue eligibility, dispatch policies, tariff selection, modifier matching, webhook filtering, permission profiles — anywhere operators need to express "this applies when X" without code. Tree shapes are boolean-tree (AND / OR / NOT) over typed leaves; leaves are routed to per-domain evaluator services via a tagged service locator.

A rule is built from conditions

The smallest piece is a single condition. Every condition reads the same way — a thing to check, how to compare it, and what to compare it against:

PROPERTY OPERATOR VALUE Is this an account trip? is equal to Yes “Apply this when the trip is booked to a corporate account.”
One condition = property · operator · value.

Conditions combine into groups: ALL or ANY

Real rules need more than one condition. You collect them into a group, and the group decides how they combine — either every condition must be true, or any one of them is enough.

ALL of every condition must match Trip is an account trip Brand is “Go Cabs” Vehicle is executive class ANY of at least one must match Account is “BOI” Account is “AIB” Account tagged “VIP”
ALL = every condition true · ANY = one is enough. Both groups above pass.

Groups can nest — a worked example

Because a group can contain other groups, you can express genuinely intricate policy in plain terms. Here is a tariff called “Complex Account”. Read it top-down: the blue ALL bars mean “every part must hold”, the cyan ANY bar means “one of these is enough”.

ALL of — this tariff applies only when every part below is true ALL of Brand is equal to Go Cabs ANY of — and the account matches one of these Account a specific corporate account is equal to Meridian Bank Account tag any account carrying this label is equal to Financial Pickup is scheduled the booked pickup falls within this weekly window Mon Tue Wed Thu Fri Sat Sun 09:00 17:00 ✓ When all of this holds, “Complex Account” prices the trip.
The same rule the operator builds in the console — drawn as the logic it represents. Names are illustrative.

In words: price with this tariff when the brand is Go Cabs and the account is Meridian Bank (or any account tagged “Financial”) and the pickup is scheduled Monday–Friday, 09:00–17:00.

How a rule is checked

When something happens — a trip is booked, an event fires — the platform takes its details and walks the rule from the top. Each condition reads a value off the thing being checked, the groups combine the results, and the rule resolves to a yes or no (or, for selection rules like tariffs, picks the first match).

A trip is booked account · brand · time · zone Rule is walked top-down, group by group Yes / No does it match? Action apply tariff, fire, allow…
The same flow whether the rule is selecting a tariff, gating an event, or checking access.

One engine, used everywhere

The power of the decision tree is that it’s the same builder everywhere. The conditions available change to suit what’s being decided, but the way you build a rule never does — the exact menus per use are in the catalogue below.

Decision tree Which tariff prices a trip When a surcharge applies Which drivers are eligible Which events fire a webhook What a user role can access …and more, the same way
Learn the builder once; it powers pricing, dispatch, integrations and access control.

The catalogue

The diagrams show the idea. The tables below are the exact catalogue — the consumers, conditions, operators and value types, emitted straight from the platform so they always match what the engine actually supports.

Consumers and their condition menus

Each place the engine is used exposes its own menu of conditions and its own matching rule — here is exactly what each one offers.

Pricing modifiers

Each modifier group is evaluated in order; every modifier whose rule matches is added to the price chain. A modifier with no rule is skipped.

Distance TravelledSpeedAccumulated PriceASAPPre-BookedIs Account TripSpecific AccountAccount TagSpecific ZoneSpecific BrandVehicle TypePickup Date (Schedule)Pickup Date (Specific)Calculation Date (Schedule)Calculation Date (Specific)POB Date (Schedule)POB Date (Specific)
Tariff selection

Candidate tariffs are filtered by vehicle type, then the first whose rule matches prices the trip; a tariff with no rule is the catch-all default.

Is Account TripSpecific AccountAccount TagSpecific BrandTrip FleetPickup Date (Schedule)Pickup Date (Specific)POB Date (Schedule)POB Date (Specific)
Discount model selection

Every model whose rule matches is collected and the highest-priority one wins; a model with no rule is a catch-all.

Is Account TripSpecific AccountAccount TagSpecific BrandTrip FleetCustomer TierPickup Date (Schedule)Pickup Date (Specific)POB Date (Schedule)POB Date (Specific)
Zone backup

Chooses a fallback dispatch plan for a zone when supply is short.

Transporter FleetShift Average EarningsWeekly Average EarningsTransporter RatingTrip FleetIs Account TripSpecific AccountAccount TagSpecific BrandVehicle TypePickup Date (Schedule)Pickup Date (Specific)Calculation Date (Schedule)Calculation Date (Specific)POB Date (Schedule)POB Date (Specific)Estimate Trip Distance
Queue trip entry

Intended to decide which trips may enter a dispatch queue.

Trip FleetTrip Fleet Operating ModelEstimate PriceIs Account TripSpecific AccountAccount TagSpecific ZoneSpecific BrandVehicle Type
Permission profiles

A gate: the request is allowed only when the rule matches; a profile with no rule denies access.

EntityActionFull AccessTime Restriction (Schedule)
Trip profiles

Evaluated per trip segment to categorise the trip; profiles apply in priority order and one with no rule matches everything. A profile's match mode is ANY (any segment matches) or ALL (every segment must match).

ASAPPre-BookedIs Account TripSpecific AccountAccount TagSpecific BrandTrip FleetVehicle TypeEstimate Trip DistanceEstimate PricePickup Date (Schedule)Pickup Date (Specific)Calculation Date (Schedule)Calculation Date (Specific)POB Date (Schedule)POB Date (Specific)

Conditions you can match on

25 conditions are active. Each compares a value from the trip against a value you set, using one of the operators below.

ConditionTypeOperatorsWhat it matches
Distance Travelled Decimal number Equal to, Equal to (loose), Not equal to, Not equal to (loose), Greater than, Greater than or equal to, Less than, Less than or equal to Matches on the live metered distance travelled so far (metered pricing only).
Estimate Trip Distance Decimal number Equal to, Equal to (loose), Not equal to, Not equal to (loose), Greater than, Greater than or equal to, Less than, Less than or equal to Matches on the route distance estimated for the trip up front.
Speed Decimal number Equal to, Equal to (loose), Not equal to, Not equal to (loose), Greater than, Greater than or equal to, Less than, Less than or equal to Matches on the live metered average speed (metered pricing only).
Accumulated Price Decimal number Equal to, Equal to (loose), Not equal to, Not equal to (loose), Greater than, Greater than or equal to, Less than, Less than or equal to Matches on the live metered fare accumulated so far (metered pricing only).
Estimate Price Decimal number Equal to, Equal to (loose), Not equal to, Not equal to (loose), Greater than, Greater than or equal to, Less than, Less than or equal to Matches on the price estimated for the trip up front.
Is Account Trip Yes / No Equal to, Equal to (loose), Not equal to, Not equal to (loose) Whether the trip is a corporate-account trip.
Specific Account Text Equal to, Equal to (loose), Not equal to, Not equal to (loose) Whether the trip belongs to a specific account you choose.
Account Tag Text Equal to, Equal to (loose), Not equal to, Not equal to (loose) Whether the trip's account carries a specific tag (lets one rule cover many accounts).
Specific Zone Text Equal to, Equal to (loose), Not equal to, Not equal to (loose) Whether the pickup falls in a specific zone.
Specific Brand Text Equal to, Equal to (loose), Not equal to, Not equal to (loose) Whether the trip is booked under a specific brand.
Trip Fleet Text Equal to, Equal to (loose), Not equal to, Not equal to (loose) Whether the trip originates from a specific fleet.
Trip Fleet Operating Model Text Equal to, Equal to (loose), Not equal to, Not equal to (loose) Whether the trip's fleet belongs to a specific fleet group.
Vehicle Type Text Equal to, Equal to (loose), Not equal to, Not equal to (loose) Whether the trip uses a specific vehicle type.
Pickup Date (Schedule) Text Equal to, Equal to (loose), Not equal to, Not equal to (loose) Whether the requested pickup time falls inside a recurring weekly schedule (evaluated in the operator's timezone, overnight windows supported).
Pickup Date (Specific) Whole number Equal to, Equal to (loose), Not equal to, Not equal to (loose) Whether the requested pickup time falls inside a specific calendar date range.
Calculation Date (Schedule) Text Equal to, Equal to (loose), Not equal to, Not equal to (loose) Whether the current time falls inside a recurring weekly schedule.
Calculation Date (Specific) Whole number Equal to, Equal to (loose), Not equal to, Not equal to (loose) Whether the current time falls inside a specific calendar date range.
Transporter Fleet Text Equal to, Equal to (loose), Not equal to, Not equal to (loose) Whether the driver/vehicle belongs to a specific fleet.
Entity Text Equal to, Equal to (loose), Not equal to, Not equal to (loose) Which type of record is being accessed (e.g. trips, customers).
Action Text Equal to, Equal to (loose), Not equal to, Not equal to (loose) Whether the request is reading or writing.
Full Access Yes / No Equal to, Equal to (loose), Not equal to, Not equal to (loose) Grants access to everything — an allow-all rule.
Time Restriction (Schedule) Text Equal to, Equal to (loose), Not equal to, Not equal to (loose) Restricts access to a recurring weekly time window.
ASAP Yes / No Equal to, Equal to (loose), Not equal to, Not equal to (loose) Whether the trip is on-demand (ASAP) rather than pre-booked.
Pre-Booked Yes / No Equal to, Equal to (loose), Not equal to, Not equal to (loose) Whether the trip is pre-booked rather than on-demand.
Customer Tier Text Equal to, Not equal to, Greater than or equal to, Less than or equal to The customer's loyalty tier — operators let you say 'this tier or better' / 'or worse'.

Defined but not yet active

These conditions appear in the engine but have no evaluator behind them yet — a rule using one will never match. Listed here for completeness; avoid relying on them.

POB Date (Schedule)POB Date (Specific)Shift Average EarningsWeekly Average EarningsTransporter Rating

Operators & value types

Operators

  • EQUALS — Equal to
  • EQUALS_LOOSE — Equal to (loose)
  • NOT_EQUALS — Not equal to
  • NOT_EQUALS_LOOSE — Not equal to (loose)
  • GREATER — Greater than
  • LESS — Less than
  • GREATER_OR_EQUALS — Greater than or equal to
  • LESS_OR_EQUALS — Less than or equal to

Value types

  • INTEGER — Whole number
  • STRING — Text
  • FLOAT — Decimal number
  • BOOLEAN — Yes / No