Hi Olivier,
I have a workflow that does something very similar to this:

Query Data
I have a SQL table that holds a single value:

Create Tokens
Now that I have the most recently used ID, I create an empty token that will later hold the updated ID.
Pattern Match
Since the value is very controlled and can be easily parsed, I use a pattern match activity to separate the ID into its individual components. For you, this would be Month, Year, and ID Number. You could use the patterns below:
Month: ^(\d{2})
Year: ^\d{2}(\d{4})
ID: (\d{4})$
Conditional Decision
Next, I used a conditional decision to identify whether the ID needs to be incremented (same year) or reset (new year) (screenshot below of the current year branch conditions, the new year branch does not have conditions). For you, this could be something like incremented (same month and year) or reset (new month).

Current Year Branch
Within the Current Year branch, I first increment the ID number using a token calculator. Then I apply the result of that to the ID token that was created above (Create Request ID Token).



The formatting "D5" ensures that there will be 5 digits for example 00001 or 00100. To get your expected format you would use "D4".
New Year Branch
In the New Year Branch, I simply apply a value to the ID token as I know that the ID will be 00001 (for you 0001).

Update Data
Finally, I update the SQL table with the now current ID value.
Now that you have the current ID in the ID token, you can do whatever else you would like with it.
Hope this helps!