Skip to content
Open
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
11 changes: 10 additions & 1 deletion core/pipeline/conditionals.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,16 @@ func (p IfThenElseProcessor) Process(ctx *Context) error {
return nil
}

if p.cond.Check(ctx) {
// Inside a per-record sub-chain (e.g. for_each), the condition must be
// evaluated against the current record's fields — the pipeline
// parameters carry no per-record data. Fall back to the context when no
// record is bound (pipeline-level usage).
values := conditions.ValuesMap(ctx)
if rec, ok := CurrentRecord(ctx); ok {
values = rec
}

if p.cond.Check(values) {
if global.Env().IsDebug {
log.Trace("if -> then branch")
}
Expand Down
Loading