Workflow date compare issue

In the workflow, I’m converting the data, comparing it, and setting true or false.

However, I can see the workflow output capturing the data, but it is not performing the date comparison or setting true or false.

What could be causing this issue?

“Define Variable”: {

            "actionId": "sp:define-variable",

            "attributes": {

                "id": "sp:define-variable",

                "variables": \[

                    {

                        "description": "thresholdISO",

                        "key": "thresholdISO",

                        "name": "thresholdISO",

                        "transforms": \[\],

                        "value": {

                            "attributes": {

                                "input": {

                                    "attributes": {

                                        "expression": "now-10d",

                                        "roundUp": false

                                    },

                                    "name": "NowMinus10d",

                                    "type": "dateMath"

                                },

                                "inputFormat": "yyyy-MM-dd'T'HH:mm",

                                "outputFormat": "ISO8601"

                            },

                            "name": "thresholdISO",

                            "type": "dateFormat"

                        }

                    },

                    {

                        "description": "lastLoginISO",

                        "key": "lastLoginISO",

                        "name": "lastLoginISO",

                        "transforms": \[\],

                        "value": {

                            "attributes": {

                                "input": {

                                    "attributes": {

                                        "value.$": "$.getAccounts.accounts\[?(@.sourceId=='e445dafd859ecc23cd9748c5178b40034')\].created"

                                    },

                                    "type": "static"

                                },

                                "inputFormat": "EEE MMM dd HH:mm:ss zzz yyyy",

                                "outputFormat": "ISO8601"

                            },

                            "name": "lastLoginISO",

                            "type": "dateFormat"

                        }

                    },

                    {

                        "description": "isWithin10Days",

                        "key": "isWithin10Days",

                        "name": "isWithin10Days",

                        "transforms": \[\],

                        "value": {

                            "attributes": {

                                "firstDate": {

                                    "attributes": {

                                        "value.$": "$.define.lastLoginISO"

                                    },

                                    "type": "static"

                                },

                                "negativeCondition": false,

                                "operator": "GTE",

                                "positiveCondition": true,

                                "secondDate": {

                                    "attributes": {

                                        "value.$": "$.define.thresholdISO"

                                    },

                                    "type": "static"

                                }

                            },

                            "name": "isWithin10Days",

                            "type": "dateCompare"

                        }

                    }

                \]

            },

            "displayName": "",

            "nextStep": "Verify Data Type 2",

            "type": "Mutation"

        }

below is the workflow output

{

        "displayName": "Define Variable",

        "input": {

            "id": "sp:define-variable",

            "variables": \[

                {

                    "description": "thresholdISO",

                    "key": "thresholdISO",

                    "name": "thresholdISO",

                    "transforms": \[\],

                    "value": {

                        "attributes": {

                            "input": {

                                "attributes": {

                                    "expression": "now-10d",

                                    "roundUp": false

                                },

                                "name": "NowMinus10d",

                                "type": "dateMath"

                            },

                            "inputFormat": "yyyy-MM-dd'T'HH:mm",

                            "outputFormat": "ISO8601"

                        },

                        "name": "thresholdISO",

                        "type": "dateFormat"

                    }

                },

                {

                    "description": "lastLoginISO",

                    "key": "lastLoginISO",

                    "name": "lastLoginISO",

                    "transforms": \[\],

                    "value": {

                        "attributes": {

                            "input": {

                                "attributes": {

                                    "value": "2026-08-12T18:44:21.554Z"

                                },

                                "type": "static"

                            },

                            "inputFormat": "EEE MMM dd HH:mm:ss zzz yyyy",

                            "outputFormat": "ISO8601"

                        },

                        "name": "lastLoginISO",

                        "type": "dateFormat"

                    }

                },

                {

                    "description": "isWithin10Days",

                    "key": "isWithin10Days",

                    "name": "isWithin10Days",

                    "transforms": \[\],

                    "value": {

                        "attributes": {

                            "firstDate": {

                                "attributes": {

                                    "value.$": "$.define.lastLoginISO"

                                },

                                "type": "static"

                            },

                            "negativeCondition": false,

                            "operator": "GTE",

                            "positiveCondition": true,

                            "secondDate": {

                                "attributes": {

                                    "value.$": "$.define.thresholdISO"

                                },

                                "type": "static"

                            }

                        },

                        "name": "isWithin10Days",

                        "type": "dateCompare"

                    }

                }

            \]

        },

        "stepName": "defineVariable",

        "task": "sp:internal:operator:mutative",

        "technicalName": "Define Variable"

    }

Hello Gayathri. I would suggest trying the native Compare Timestamps operator instead of dateCompare inside Define Variable.

Since created is already ISO8601, set:

  • Value 1: created
  • Operator: Is On or After X Days Ago
  • Value 2: 10

dateCompare is not a documented Define Variable date operation. Compare Timestamps is designed for this check and branches the workflow directly. Workflow Operators

@gayare -
dateCompare isn’t a supported Define Variable operator in ISC workflows, and that’s almost certainly why the comparison never runs even though the data capture works. dateCompare is an Identity Profile Transform type; workflows are a separate engine, and the Define Variable operator doc lists its supported operators as Concatenate Strings, Substring, Trim, Replace, Get Index, Add Time, and Subtract Time. Nothing that compares two values. Nesting a "type": "dateCompare" block inside a defined variable doesn’t get evaluated as a comparison the way it would in an account attribute transform; it just sits there, which matches what you’re seeing, the values come through fine, but nothing ever resolves to true or false.

Comparison in workflows is its own operator, Compare Timestamps, separate from Define Variable entirely. It has prebuilt day-relative options, including “Is On or After X Days Ago,” which is what isWithin10Days actually needs. Under the hood a Compare Timestamps step comes out as a comparator string plus variableA/variableB, for example (from a resolved thread using the “days in the future” side of the same operator):

"comparator": "TimestampGreaterThanEqualsXDayFuture",
"variableA.$": "$.getCertificationCampaign.deadline",
"variableB": 5

I’d point variableA.$ at $.define.lastLoginISO and let Compare Timestamps compute “10 days ago” itself, rather than keeping thresholdISO as a separate variable. That also removes the need for two independently-formatted dates to match exactly. I haven’t confirmed the literal comparator string for the “days ago” side, only the two “days in the future” ones shown above, so build the step through the operator’s picklist rather than typing a guessed value.

If you do keep a manually computed threshold for some reason, both timestamps need to be in the exact same strict ISO8601 form, milliseconds and the Z included, like 2026-08-16T00:00:00.000Z. A near-identical “Compare Timestamps returning false” case traced back to exactly that, one side missing the milliseconds. Also worth knowing, the dateMath transform that Add Time/Subtract Time is presumably built on documents its raw output as yyyy-MM-dd'T'HH:mm, not full ISO8601, so if you’re formatting a threshold yourself, run it through a Date Formatter step set to ISO8601 rather than assuming the raw output already qualifies.