CI_PIPELINE_IID holds scoped stages count not pipelines

I’m using CI_PIPELINE_IID var in my project. But it turns out that it holds stage count, so each consequent pipeline’s CI_PIPELINE_IID differ for more than 1. Is it expected behavior or I’m doing something wrong?
gitlab v11.6.5