Edge Rules

Business logic,
without the code.

A declarative rules engine for the Kaptio platform. Fees, surcharges, eligibility gates, acknowledgments, and alerts -- configured by operators, evaluated on Edge, enforced everywhere.

4 rule modes
Declarative YAML
Version controlled
Audited & debuggable
The Problem

Rules live everywhere

Every tour operator has hundreds of business rules -- booking fees, surcharges, eligibility checks, warnings, approval gates. Today they are scattered across four different layers, each with its own pain.

Apex triggers

Custom code that fires on object insert/update. Hard-coded logic.

Pain

Developer required to change. Deploy risk. Hard to debug at runtime.

Salesforce Flows

Visual automation built in Flow Builder. One flow per scenario.

Pain

Version sprawl. Harder to test. Admin-gated. Difficult to audit logic.

Validation rules

Field-level blocks in Salesforce. One formula per rule.

Pain

Cannot explain why a user sees an error. No debugging. Static formulas.

Tribal knowledge

Unwritten rules in operator heads. "We always charge this fee on that channel."

Pain

Lost when the person leaves. No consistency. Rules applied unevenly across teams.

The cost of scattered rules

Every rule change today involves a developer, an admin, or a veteran operator with context nobody else has. Rules conflict with each other, fire inconsistently, and are nearly impossible to audit. Edge Rules centralizes this layer so operators own it, developers do not gate it, and everyone can see exactly what fired on which booking and why.

How Rules Work

Three parts. One line of thinking.

Every rule in Edge Rules follows the same structure: WHEN something happens, IF a set of conditions match, THEN do these actions.

Trigger

When does this rule run?

Lifecycle events that Edge Rules listens for. Pricing completion, status change, document send, page load.

Examples
itinerary.priceditinerary.updatedpayment.requesteddocument.sendingstatus.changedpage.loaded

Conditions

What should match for this rule to fire?

Composable predicates with AND/OR logic. Check fields in the request context or run SOQL against the live booking data.

Examples
Total < $1,000Channel contains "Direct"All items are rail-familyDeparture within 14 daysMargin below 5%Passenger count > 6

Actions

What should happen when conditions match?

Bounded, auditable effects. Create a line item, set a field, block a workflow, send a notification, prompt a user to acknowledge.

Examples
add_itinerary_itemremove_itinerary_itemblock_actionset_fieldsend_notificationrequire_acknowledgment

What a rule actually looks like

A rail-only booking fee rule written as declarative YAML.

rules.yaml
active
# Rail-only booking fee on direct channels under $1,000
- id: rail-booking-fee
  name: Rail-Only Booking Fee
  mode: silent
  enabled: true
  triggers:
    - itinerary.priced
  conditions:
    all:
      - source: context
        field: total_sell_price
        operator: less_than
        value: 1000
      - source: context
        field: channel_name
        operator: contains
        value: Direct
      - source: query
        query: |
          SELECT Id FROM KaptioTravel__Itinerary_Item__c
          WHERE KaptioTravel__Itinerary__c = :itineraryId
            AND Service_Type__c NOT IN (Rail, ManualRail, Transfer, Promotion)
            AND Edge_Rule_Marker__c = null
        expect: no_results
  actions:
    - type: add_itinerary_item
      params:
        item_id: <booking fee catalog item Id>
        price_category_id: <price category Id>
        sell_price: 50
        external_marker: EDGE_RULE_RAIL_BOOKING_FEE

No Apex. No Flow Builder. No managed package extension. This is the whole rule.

Four Modes

Different rules need different behaviors

Not every rule should act silently. Some should block, some should prompt the user, some should alert someone else. Edge Rules offers four distinct modes covering the full spectrum of operator intent.

Silent

Evaluate and act. No user prompt.

The rule fires in the background and applies its action. The user never sees it happen -- they just see the outcome on their booking or quote.

User experience

User sees the result (e.g. booking fee line) but is never interrupted.

Examples
  • Rail-only booking fee
  • Channel-specific surcharge
  • Volume discount
  • Small group supplement
  • Seasonal surcharge

Gate

Hard block with message.

The rule prevents the action entirely. User cannot proceed until the underlying condition is resolved.

User experience

User sees a clear block message explaining why the action cannot continue.

Examples
  • Block payment on unconfirmed services
  • Block document send with missing passenger details
  • Block booking when inventory is full
  • Prevent action on expired quote
  • Block above credit limit

Acknowledge

Silent until needed. User confirms awareness.

The rule stays dormant until it matches. When it does, a dialog requires the user to explicitly acknowledge before proceeding. Creates an audit record.

User experience

User sees a confirmation dialog. Reads. Accepts. Continues. The acknowledgment is recorded.

Examples
  • Zero-margin quote warning before send
  • Travel advisory for destination
  • Visa requirements reminder
  • Cancellation terms changed after amendment
  • High-value booking manager review
  • Late booking fee notification

Notify

Alert someone. Do not interrupt the user.

The rule fires an alert through Slack, email, or in-app notifications but does not interrupt the workflow in progress.

User experience

User continues their work. A target party receives the notification.

Examples
  • Slack alert on high-value booking
  • Email reminder for stale quote
  • Low inventory warning to ops
  • Unconfirmed service notification
  • New booking on watched package

Why Acknowledge is special

Acknowledge is the mode most travel operators have been unable to build cleanly in Salesforce. It is a soft gate -- not a hard block, not a silent action, but a required moment of explicit awareness, captured as an audit record. Zero-margin quote warnings. Travel advisory confirmations. Visa requirement reminders. Late booking fee notifications. Anywhere you need an agent or a customer to pause and actively confirm before moving forward, acknowledge is the right mode.

Edge Rules renders the acknowledgment inline through a lightweight canvas runner that stays dormant until a rule fires. No interruption when no rule matches. Clear, recorded consent when one does.

Rule Catalog

Not one rule. A library.

Edge Rules is designed to hold every operational rule your business depends on. Here is a catalog of rules that Edge Rules can express today, organized by category. Start with one, add more as you go.

Fees & Surcharges

Charges added automatically based on booking composition, channel, or lead time.

Rail-only booking fee

silent

Apply fee when all items are rail-family and total is below threshold

Trigger
itinerary.priced

Late booking fee

acknowledge

Add fee when departure is within configurable days

Trigger
itinerary.created

Amendment fee

acknowledge

Charge fee for changes after confirmation

Trigger
itinerary.updated

Channel-specific surcharge

silent

Apply different surcharges by booking channel

Trigger
itinerary.priced

Small group supplement

silent

Add supplement when passenger count is below group threshold

Trigger
itinerary.priced

Credit card surcharge

silent

Apply card-type specific fee at payment

Trigger
payment.method_selected

Compliance & Duty of Care

Ensure agents and customers see the right warnings, acknowledgments, and required information.

Travel advisory check

acknowledge

Require acknowledgment for destinations with active advisories

Trigger
document.sending

Visa requirements warning

acknowledge

Remind agent to communicate visa requirements before send

Trigger
document.sending

Insurance not offered

gate

Block document send if no insurance on booking

Trigger
document.sending

Pricing provisional warning

acknowledge

Show customer that on-request services are not yet confirmed

Trigger
document.generating

Passport details incomplete

gate

Block confirmation without passport data

Trigger
status.changed

Payment Gates

Prevent payment collection when the booking is not ready or eligible.

Block payment on unconfirmed services

gate

Prevent payment until supplier confirms all services

Trigger
payment.requested

Block above credit limit

gate

Prevent booking exceeding account credit

Trigger
itinerary.priced

Expired quote block

gate

Prevent payment on quotes past their expiry date

Trigger
payment.requested

Blackout dates

gate

Prevent bookings during operator-defined blackouts

Trigger
itinerary.created

Currency conversion surcharge acknowledgment

acknowledge

Customer confirms they understand the FX fee

Trigger
payment.requested

Commercial Alerts

Notify the right person when something commercially significant happens.

High-value booking

notify

Slack alert when a booking exceeds threshold

Trigger
itinerary.priced

Zero-margin quote

acknowledge

Agent confirms low-margin quote before sending

Trigger
document.sending

Quote conversion stalled

notify

Email rep when quote has been sent for more than X days with no action

Trigger
page.loaded

Large booking manager review

acknowledge

Require manager acknowledgment above threshold

Trigger
status.changed

Repeat customer identified

notify

Flag returning customers for loyalty offer

Trigger
itinerary.created

Validation & Data Quality

Catch data issues before they cause downstream problems.

Email required before send

gate

Block document send when lead passenger has no email

Trigger
document.sending

Phone format validation

acknowledge

Warn when phone number does not match E.164

Trigger
itinerary.updated

Child age validation

gate

Block child passenger without valid age

Trigger
itinerary.updated

Room occupancy check

acknowledge

Warn when passengers exceed room capacity

Trigger
itinerary.updated

Tour inventory warning

notify

Notify ops when inventory falls below reorder threshold

Trigger
itinerary.created
Worked example

Rail-only booking fee

A common travel industry scenario: apply a booking fee to rail-only bookings below a configurable threshold, varying by channel. A single rule in Edge Rules delivers it end to end.

Traditional approach

Custom Apex + Flow

  • -3 to 4 weeks of Salesforce development
  • -Custom Apex trigger, Flow, validation rules, catalog item
  • -Developer needed for every tweak to threshold or amount
  • -No standardized audit trail
  • -Each new rule repeats the cycle
Edge Rules approach

Declarative YAML rule

  • +About 15 lines of YAML, one day to configure and test
  • +Managed package pipeline handles taxes, commissions, rollup
  • +Operator updates threshold or amount by editing YAML
  • +Every rule execution is logged and queryable
  • +Next rule is a paste-and-tweak, not a rebuild

What happens when a rail-only booking is priced

1

The ask

Add a booking fee to rail-only bookings below a dollar threshold, configurable by channel. A common travel industry requirement that would traditionally take 3 to 4 weeks of custom Salesforce development.

2

The rule

Written in YAML in about 15 lines. Threshold, channel match, rail-only check. No Apex, no Flow, no managed package change.

3

The trigger

A Salesforce Flow on pricing completion calls the Edge Rules evaluator via an Apex Queueable. Evaluates in under one second.

4

The outcome

When a matching booking is priced, a line item is created against a pre-configured catalog item. Taxes and commissions calculated by the managed package pipeline. Idempotent, auditable, operator-tunable.

Typical outcome

A new line item on the booking

The booking fee appears as a first-class line item on the itinerary, visible in the builder and costings, participating in the total rollup. It prints on customer documents alongside every other service line. The rule is operator-tunable, rerunnable, and fully traceable.

Platform Fit

Rules everywhere they are needed

Edge Rules is a horizontal layer consumed by every other Edge service. The same rule can fire from a document, a payment page, a canvas dashboard, or a customer-facing booking flow.

Edge Docs
Document generation
Edge Pay
Payment collection
Canvas
Configurable UI surfaces
Quest
Enquiry and booking flows
Horizontal layer
Edge Rules
Evaluates WHEN / IF / THEN on every trigger
Salesforce
Managed package
KTAPI
Pricing & inventory
External systems
Payment, content, CRM
ED

Edge Docs

Consumes rules at document.generating and document.sending triggers. Acknowledgments and gates fire before a customer receives the quote.

EP

Edge Pay

Consumes rules at payment.requested and payment.method_selected. Gates block ineligible payments; silent rules add surcharges.

C

Canvas

Can render acknowledgment prompts inline on any record page, triggered by page.loaded or data.changed events.

Q

Quest

Consumes rules during the customer-facing booking flow to apply fees, surcharges, and eligibility checks pre-confirmation.

Roadmap

Where Edge Rules is going

The platform work has been in development for six months. Phase 1 is production-ready today. Phases 2 through 4 are on the near-term roadmap, shaped by what our first customers need.

Now
Phase 1

Silent rules and gates

Production-ready for fee rules, surcharges, and hard blocks.

YAML rule definitions in edge-doc-engine-configs
HTTP callout from Apex Queueable
SOQL-based conditions
Itinerary item creation with managed package pricing
Idempotency and audit logging
Next
Phase 2

Acknowledgment experience

The canvas-runner pattern: silent until triggered, then renders a confirmation prompt inline.

LWC acknowledgment dialog component
Audit trail of who acknowledged what and when
Per-rule severity and icon configuration
Per-user suppression policies
Confirmation reports ("all agents acknowledged policy X")
Future
Phase 3

Operator UI and templates

A visual builder so operators can create, test, and manage rules without touching YAML.

Rules manager UI in the Edge Admin app
Rule template library (copy from catalog)
Dry-run testing against real itineraries
Version history and rollback
Rule firing analytics and effectiveness reports
Future
Phase 4

Reconciliation and amendment intelligence

Rules that understand the lifecycle of the booking and reconcile when conditions change.

Remove fee when rule no longer matches after amendment
Detect rule conflicts before they fire
Rule chaining (output of one rule feeds another)
Cross-rule dependency graph
AI-suggested rules based on operator behavior

Part of the Edge Platform

Edge Rules joins Edge Docs, Edge Pay, Edge Canvas, Edge Brief, and Quest as a horizontal layer of the Kaptio platform -- moving operational logic out of Salesforce and into composable, operator- owned services.

Kaptio

Serve travelers, not spreadsheets.