A simple example...
[{"id":"327c773e3f240405","type":"inject","z":"be4568a984cb4685","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":290,"y":2080,"wires":[["db2adbcefcbaa0d1"]]},{"id":"db2adbcefcbaa0d1","type":"function","z":"be4568a984cb4685","name":"function 7","func":"let storedCounter = context.get('count') || 0\nlet currentCounter = storedCounter + 1\ncontext.set('count', currentCounter)\nmsg.payload = currentCounter\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":2080,"wires":[["61ef5ffd74b3869d"]]},{"id":"61ef5ffd74b3869d","type":"debug","z":"be4568a984cb4685","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":610,"y":2080,"wires":[]}]