Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions apps/sim/executor/handlers/condition/condition-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,20 @@ export class ConditionBlockHandler implements BlockHandler {
evalContext
)

const connection = this.findConnectionForCondition(outgoingConnections, condition.id)

if (connection && conditionMet) {
return { selectedConnection: connection, selectedCondition: condition }
if (conditionMet) {
const connection = this.findConnectionForCondition(outgoingConnections, condition.id)
if (connection) {
return { selectedConnection: connection, selectedCondition: condition }
}
// Condition is true but has no outgoing edge - branch ends gracefully
logger.info(
`Condition "${condition.title}" is true but has no outgoing edge - branch ending`,
{
blockId: block.id,
conditionId: condition.id,
}
)
return { selectedConnection: null, selectedCondition: null }
}
} catch (error: any) {
logger.error(`Failed to evaluate condition "${condition.title}": ${error.message}`)
Expand Down