Skip to content

automation: flow conditions on numeric string-serialized fields (rating/currency/percent) fault under strict CEL and silently dead-end the flow (sibling of #1530) #1534

@xuyushun441-sys

Description

@xuyushun441-sys

Summary

Record-change flow decision / edge conditions that compare a numeric field against a literal (e.g. record.rating >= 4, record.amount > 100000) fault at runtime whenever the field's value serializes as a stringField.rating(allowHalf)"5.0", Field.currency(scale)"250000.00", Field.percent likewise. Strict CEL raises no such overload: dyn<string> >= int, so the comparison can never be satisfied. Two compounding defects:

  1. Build vs runtime mismatch (false green). The ADR-0032 §1a build validator accepts record.rating >= 4 (treats rating as numeric per schema) and objectstack build passes. At runtime the bound value is a string and the comparison faults.
  2. Silent dead-end. @objectstack/service-automation evaluateCondition (CEL branch) binds the raw row into the CEL activation — the same un-hydrated-value root cause as Date-typed formula fields always evaluate to null — objectql applyFormulaPlan binds raw string values + silently swallows the CEL type fault (ADR-0032 §1c) #1530, but in the automation path rather than objectql applyFormulaPlan. When a decision node's outgoing conditional edges all fault, traverseNext matches no edge → the flow reports success with no node after the decision executed (no update_record, no notify, no error surfaced).

Version

@objectstack/* 7.6.0.

Evidence

Probe inside evaluateCondition for a hot-lead insert (rating = 5):

[PROBE-CEL] expr=`record.rating >= 4` ok=false value=undefined
            err=no such overload: dyn<string> >= int
            ratingVal="5.0" ratingType=string

The record-change handler fired (handler invokedcallback completed), but next_followup_date was never stamped — routing dead-ended at the decision node.

Affected fields / flows (hotcrm, but the pattern is generic)

  • Field.rating(allowHalf) → lead routing decision on record.rating >= 4
  • Field.currency(scale) → opportunity approval start/decision on record.amount > 100000, oppRecord.amount > 500000
  • Field.percent would behave the same

Relationship to #1530

#1530 is the date / formula-field variant (raw string dates vs CEL Timestamp, swallowed to null in objectql applyFormulaPlan). This issue is the numeric / flow-condition variant in service-automation evaluateCondition, with an extra failure mode: instead of swallow-to-null, the decision silently dead-ends the whole flow. Same ADR-0032 §1c hydration gap — please consider fixing both projection paths (objectql formula + automation condition) consistently.

Workaround (app side)

Cast in the condition: double(record.rating) >= 4, double(record.amount) > 100000. (Applied in hotcrm.)

Suggested fix


Found while upgrading objectstack-ai/hotcrm to 7.6 (objectstack-ai/hotcrm#365).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions