Portal Community

What is the Fact Object?

The rule engine evaluates rules against a fact object — a flat or nested JSON object containing the values the rules reference. Each rule set declares the fact shape it expects. The inputMap in node config builds this fact object from workflow data.

inputMap Configuration

{
  "inputMap": {
    "amount": "$output.fetchInvoice.data.total",
    "currency": "$output.fetchInvoice.data.currency",
    "category": "$output.fetchInvoice.data.category",
    "vendorTier": "$output.fetchVendor.data.tier",
    "vendorCountry": "$output.fetchVendor.data.countryCode",
    "isFirstTimeVendor": "$output.fetchVendor.data.invoiceCount === 0",
    "submittedBy": "$context.actorId",
    "submittedByDepartment": "$output.fetchActor.data.department",
    "submittedAt": "$now.toISOString()",
    "lineItemCount": "$output.fetchInvoice.data.lineItems.length",
    "maxLineItemAmount": "$Math.max(...$output.fetchInvoice.data.lineItems.map(i => i.amount))"
  }
}

Fact Schema Matching

The rule set admin publishes the expected fact schema. The inputMap must supply all required fact fields — missing required facts will cause the evaluation to return an error outcome. Optional facts default to null if not provided.

Fact FieldTypeRequiredSource Expression
amountnumberYes$output.fetchInvoice.data.total
currencystringYes$output.fetchInvoice.data.currency
categorystringYes$output.fetchInvoice.data.category
vendorTierstringNo$output.fetchVendor.data.tier ?? 'standard'
isFirstTimeVendorboolNo$output.fetchVendor.data.invoiceCount === 0
Review the rule set schema: Before configuring inputMap, open the rule set in the Rules admin and check the declared fact schema. The fact field names must match exactly (case-sensitive). Mismatched field names are a common source of rules that fire incorrectly or not at all.