Increment a state variable in payload format Converter

Not possible; you only get the decoded application payload and the port number, and cannot preserve any state. It’s also not possible in the Decoder function.

See also:

So, you’ll need to keep state on your application server, or use some third-party server. For Node-RED see Working with context. For Pipedream, see $checkpoint in Workflow state.

And beware: