An Azure service that provides an event-driven serverless compute platform.
Thank you for reaching out to Microsoft Q&A.
The issue you are encountering occurs because Microsoft Foundry workflows use Power Fx expressions (Excel-like syntax) for conditional logic, and the If/Else node strictly validates whether the expression evaluates to a Boolean value. If the syntax is incorrect, the variable type is not properly recognized, or the expression does not resolve to a true/false value, the workflow editor silently resets the condition to default. Additionally, in many cases when working with JSON outputs and Parse Value nodes, the variables are treated as loosely typed (often strings instead of Boolean), which causes the condition validation to fail. Since Foundry workflows are currently in preview, the UI does not show explicit errors and simply removes invalid expressions, which is why your condition disappears after clicking Done.
Refer below points to resolve this issue or this is the workaround
Use correct Power Fx syntax for condition
Ensure the condition starts with = and uses valid Power Fx syntax:
=Local.orchestrationOutput.decision.within_scope
or
=Local.orchestrationOutput.decision.within_scope = true
Ensure the variable is Boolean
If your JSON output contains values like "true" or "false" (as strings), the condition will not work. Convert it explicitly:
=Lower(Local.orchestrationOutput.decision.within_scope) = "true"
or
=Boolean(Local.orchestrationOutput.decision.within_scope)
Define proper schema in Parse Value node
Make sure the Parse Value node defines the Boolean type explicitly; otherwise, the editor treats the value as untyped:
valueType:
kind: Record
properties:
decision:
kind: Record
properties:
within_scope: Boolean
Validate variable value before If/Else (debug step)
Add a Send Message node before the condition to confirm the value and type:
{Text(Local.orchestrationOutput.decision.within_scope)}
Handle preview limitation / UI issue
Since Foundry workflows are still in preview, the editor may silently drop even valid expressions. If the issue persists after fixing syntax and types, recreate the If/Else node or re-save the workflow to ensure the condition is retained.