# Incremental value every run

**URL:** <https://community.n8n.io/t/incremental-value-every-run/18452>\
**Category:** Questions\
**Tags:** workflow-building\
**Created:** [October 7, 2022, 2:31pm UTC](https://community.n8n.io/t/incremental-value-every-run/18452 "2022-10-07T14:31:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gabriele\_Bracciali](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/gabriele_bracciali/32/31293_2.png) [@Gabriele\_Bracciali](https://community.n8n.io/u/Gabriele_Bracciali)\
**Post date:** [October 7, 2022, 2:31pm UTC](https://community.n8n.io/t/incremental-value-every-run/18452/1 "2022-10-07T14:31:34Z")

</div>

Hello, I would like to create a workflow that run every x time, set a start value y of 500, and use it in http request…  
the point is, every time the workflow run, the initial value y must increase by 500.  
1 run 500  
2 run 1000  
3 run 1500  
etc…

I’ve tried a lot of solution but didn’t find the right way, i am sure it’s an easy function…  
thanks for the help!!

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [October 7, 2022, 2:42pm UTC](https://community.n8n.io/t/incremental-value-every-run/18452/2 "2022-10-07T14:42:14Z")

</div>

Hey @Gabriele_Bracciali,

What sort of things have you tried? Is the value of y something that would need to exist for the run of the workflow or would it be increased on each workflow run?

---

<div class="post-metadata">

**Author:** ![Gabriele\_Bracciali](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/gabriele_bracciali/32/31293_2.png) [@Gabriele\_Bracciali](https://community.n8n.io/u/Gabriele_Bracciali)\
**Post date:** [October 7, 2022, 2:44pm UTC](https://community.n8n.io/t/incremental-value-every-run/18452/3 "2022-10-07T14:44:29Z")

</div>

I’ve tried this

> [@Increment a number using Function](http://community.n8n.io/t/increment-a-number-using-function/12077/3):
>
> Hey @Jon as always thanks for the quick answer. How exactly would i write this in the function node ?

and also to put +500 in the input value  
I need this value for run an http request each run

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [October 7, 2022, 2:48pm UTC](https://community.n8n.io/t/incremental-value-every-run/18452/4 "2022-10-07T14:48:54Z")

</div>

Hey @Gabriele_Bracciali,

Is that each run of the HTTP Request then instead of the workflow itself? I need to understand which it is as the answers are very different.

---

<div class="post-metadata">

**Author:** ![Gabriele\_Bracciali](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/gabriele_bracciali/32/31293_2.png) [@Gabriele\_Bracciali](https://community.n8n.io/u/Gabriele_Bracciali)\
**Post date:** [October 7, 2022, 2:51pm UTC](https://community.n8n.io/t/incremental-value-every-run/18452/5 "2022-10-07T14:51:32Z")

</div>

yes i need this value only in the http request, and should increase every run of the node  
every http request should run based on an interval node

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [October 7, 2022, 2:57pm UTC](https://community.n8n.io/t/incremental-value-every-run/18452/6 "2022-10-07T14:57:29Z")

</div>

Do you have an example of your workflow?

---

<div class="post-metadata">

**Author:** ![Gabriele\_Bracciali](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/gabriele_bracciali/32/31293_2.png) [@Gabriele\_Bracciali](https://community.n8n.io/u/Gabriele_Bracciali)\
**Post date:** [October 7, 2022, 3:00pm UTC](https://community.n8n.io/t/incremental-value-every-run/18452/7 "2022-10-07T15:00:23Z")

</div>

Yes i have it, but i think it’s useless, cause it’s only an http request. and after the rest of the workflow do stuff, but doesn’t impact with this part.

---

<div class="post-metadata">

**Author:** ![martinhache](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/martinhache/32/70066_2.png) [@martinhache](https://community.n8n.io/u/martinhache)\
**Post date:** [October 7, 2022, 3:03pm UTC](https://community.n8n.io/t/incremental-value-every-run/18452/8 "2022-10-07T15:03:13Z")

</div>

Hi @Gabriele_Bracciali,

To increment in each execution a value of +500 you should set up a workflow that saves that value in some kind of database or a simple Google Sheets file to be able to retrieve it in each execution.

In the following sequence, you bring the last value of a table in Baserow, add the value 500 and save it again in the same table, so that in the next execution the workflow will start at 500,1000,1500, etc.

 ![Captura de pantalla 2022-10-07 a las 17.01.48](https://europe1.discourse-cdn.com/n8n/original/3X/8/e/8e6a5e7de3b780a15ea4b0c2001209c9d32e003c.png)

 ![Captura de pantalla 2022-10-07 a las 16.54.59](https://europe1.discourse-cdn.com/n8n/original/3X/5/3/5394c8241923942b97d7b1792b0d1084a10c5c15.png)

 ![Captura de pantalla 2022-10-07 a las 16.55.12](https://europe1.discourse-cdn.com/n8n/original/3X/0/9/09899171fe880144b3ec76962389eaafb02f5d5c.png)

 ![Captura de pantalla 2022-10-07 a las 16.55.46](https://europe1.discourse-cdn.com/n8n/original/3X/2/5/25a18d663119729b1c7e9ef481a4205cf8ccf6b8.png)

 ![Captura de pantalla 2022-10-07 a las 16.55.56](https://europe1.discourse-cdn.com/n8n/original/3X/9/4/9473f37e4ea62bab6b29e22f2fdb612a123a43c8.png)

 ![Captura de pantalla 2022-10-07 a las 16.59.11](https://europe1.discourse-cdn.com/n8n/original/3X/0/7/0719542a6bd7f5a6ff6fe5f6db3005961cdd491f.png)

😉

---

<div class="post-metadata">

**Author:** ![Gabriele\_Bracciali](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/gabriele_bracciali/32/31293_2.png) [@Gabriele\_Bracciali](https://community.n8n.io/u/Gabriele_Bracciali)\
**Post date:** [October 7, 2022, 3:06pm UTC](https://community.n8n.io/t/incremental-value-every-run/18452/9 "2022-10-07T15:06:54Z")

</div>

@martinhache hi, thank for reply.  
yes, it’s look like what i need, i will try

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [October 7, 2022, 3:07pm UTC](https://community.n8n.io/t/incremental-value-every-run/18452/10 "2022-10-07T15:07:12Z")

</div>

If the value only needs to exist in the workflow for that run and increment on each loop of the workflow you can use something like this.

If you want to persist it between workflow runs as it is just a small number static data would be a good way to go.

---

<div class="post-metadata">

**Author:** ![martinhache](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/martinhache/32/70066_2.png) [@martinhache](https://community.n8n.io/u/martinhache)\
**Post date:** [October 7, 2022, 3:23pm UTC](https://community.n8n.io/t/incremental-value-every-run/18452/11 "2022-10-07T15:23:28Z")

</div>

Same operation in Google Sheets…

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/9/4/9453bed084c2cbaba34e6b66fccea171c17ca15c.png)

😉

---

<div class="post-metadata">

**Author:** ![Gabriele\_Bracciali](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/gabriele_bracciali/32/31293_2.png) [@Gabriele\_Bracciali](https://community.n8n.io/u/Gabriele_Bracciali)\
**Post date:** [October 7, 2022, 3:29pm UTC](https://community.n8n.io/t/incremental-value-every-run/18452/12 "2022-10-07T15:29:07Z")

</div>

thanks @Jon , but i think this is not for what i want

---

<div class="post-metadata">

**Author:** ![Gabriele\_Bracciali](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/gabriele_bracciali/32/31293_2.png) [@Gabriele\_Bracciali](https://community.n8n.io/u/Gabriele_Bracciali)\
**Post date:** [October 7, 2022, 3:29pm UTC](https://community.n8n.io/t/incremental-value-every-run/18452/13 "2022-10-07T15:29:40Z")

</div>

okay nice, i’ve tried but the first google sheet node doesn’t work, it return me an empty item

---

<div class="post-metadata">

**Author:** ![martinhache](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/martinhache/32/70066_2.png) [@martinhache](https://community.n8n.io/u/martinhache)\
**Post date:** [October 7, 2022, 3:32pm UTC](https://community.n8n.io/t/incremental-value-every-run/18452/14 "2022-10-07T15:32:25Z")

</div>

Hi @Gabriele_Bracciali,

Have you defined the column name and assigned a first value, e.g. 0?

---

<div class="post-metadata">

**Author:** ![Gabriele\_Bracciali](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/gabriele_bracciali/32/31293_2.png) [@Gabriele\_Bracciali](https://community.n8n.io/u/Gabriele_Bracciali)\
**Post date:** [October 7, 2022, 3:33pm UTC](https://community.n8n.io/t/incremental-value-every-run/18452/15 "2022-10-07T15:33:00Z")

</div>

![Screenshot 2022-10-07 at 17.32.49](https://europe1.discourse-cdn.com/n8n/original/3X/5/7/57a7d02d560722c4879bcb9388d1edc17e3a9c58.png)  
 ![Screenshot 2022-10-07 at 17.32.56](https://europe1.discourse-cdn.com/n8n/original/3X/1/2/12d63dad9234ff5d488a282fdb03829b3a27797d.png)

---

<div class="post-metadata">

**Author:** ![martinhache](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/martinhache/32/70066_2.png) [@martinhache](https://community.n8n.io/u/martinhache)\
**Post date:** [October 7, 2022, 3:35pm UTC](https://community.n8n.io/t/incremental-value-every-run/18452/16 "2022-10-07T15:35:29Z")

</div>

Hi @Gabriele_Bracciali,

Define the column name in cell A1, and then assign the first value 0 in cell A2.

![image](https://europe1.discourse-cdn.com/n8n/original/3X/2/b/2b6dc533f1a40fbb4d2cf02389bcc18d2f7f5816.png)

---

<div class="post-metadata">

**Author:** ![Gabriele\_Bracciali](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/gabriele_bracciali/32/31293_2.png) [@Gabriele\_Bracciali](https://community.n8n.io/u/Gabriele_Bracciali)\
**Post date:** [October 7, 2022, 3:42pm UTC](https://community.n8n.io/t/incremental-value-every-run/18452/17 "2022-10-07T15:42:23Z")

</div>

![Screenshot 2022-10-07 at 17.42.08](https://europe1.discourse-cdn.com/n8n/original/3X/8/8/8870c9345f4e7298996cce5bbbcf76394fc6e61b.png)

done it, okay now the function return me this  
edit:  
it was my problem, cause i was using another “Item Lists” in the workflow @martinhache

---

<div class="post-metadata">

**Author:** ![martinhache](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/martinhache/32/70066_2.png) [@martinhache](https://community.n8n.io/u/martinhache)\
**Post date:** [October 7, 2022, 3:56pm UTC](https://community.n8n.io/t/incremental-value-every-run/18452/18 "2022-10-07T15:56:38Z")

</div>

What is the name of the previous Item list node?

---

<div class="post-metadata">

**Author:** ![Gabriele\_Bracciali](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/gabriele_bracciali/32/31293_2.png) [@Gabriele\_Bracciali](https://community.n8n.io/u/Gabriele_Bracciali)\
**Post date:** [October 7, 2022, 3:58pm UTC](https://community.n8n.io/t/incremental-value-every-run/18452/19 "2022-10-07T15:58:29Z")

</div>

It was Item List, and when i past your nodes, the Item list takes the name “Item List2” , so i’ve change the name in the function, and it’s working

---

<div class="post-metadata">

**Author:** ![martinhache](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/martinhache/32/70066_2.png) [@martinhache](https://community.n8n.io/u/martinhache)\
**Post date:** [October 7, 2022, 4:00pm UTC](https://community.n8n.io/t/incremental-value-every-run/18452/20 "2022-10-07T16:00:15Z")

</div>

Great. I hope you found it useful 👍

[Next page](https://community.n8n.io/t/incremental-value-every-run/18452.md?page=2)
