Flow Studio
Rule Input Mapping
Mapping workflow execution data to the rule engine's expected fact object shape — the inputMap config, expression evaluation, and matching the rule set's declared fact schema.
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 Field | Type | Required | Source Expression |
|---|---|---|---|
amount | number | Yes | $output.fetchInvoice.data.total |
currency | string | Yes | $output.fetchInvoice.data.currency |
category | string | Yes | $output.fetchInvoice.data.category |
vendorTier | string | No | $output.fetchVendor.data.tier ?? 'standard' |
isFirstTimeVendor | bool | No | $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.