@Rafał Lesiński Thanks for reaching out.
Unfortunately, you cannot use parameter/variable to achieve this. You need to offload and store your counter outside logic app like storage account blob. In your workflow you can retrieve the value from your storage blob, increment it and then update your blob with the new value. Make sure you are setting the degree of parallelism to 1 after enabling the concurrency control in your trigger setting else in scenario when multiple requests came at the same time then your counter may not update the right value as multiple run id could access the same data/update it.
To get familiar with blob storage connector please refer to this document.
Feel free to get back to me if you have any queries or concerns.
Please "Accept Answer" if the answer is helpful so that it can help others in the community.