Overview
You may get an error similar to the stack trace below in the following conditions:
- You call the method GetWorkflowStates.
- Your API application is a ServerApplication.
- Your local machine runs M-Files 25.6.14925.4.
- The remote M-Files Server is 25.5 or older.
- You are using the TCP/IP protocol
- The gRPC protocol is not affected.
Another case where this might happen is if you have IIS on a separate DMZ proxy and the M-Files Server installation on it got updated to 25.6, but the main application server is still on an older version. In this case, Classic Web and REST API may be hit with the same error, and also the Mobile application if it uses the REST API. The servers in such a situation must always be the exact same version, make sure that this is so - either upgrade the application server, or reinstall the matching older version on the proxy computer.
This issue does not affect the M-Files cloud standard releases, because the server is already on the latest 25.6 version. It can affect on-premises installations and LTS versions in the cloud if you have an on-premise client that got updated to the 25.6.14925.4 version.
Error Message
The procedure number is out of range.
CoVaultWorkflowOperations.cpp, 235, The procedure number is out of range. (0x800706D1)
ServerVaultWorkflowOperationsHelper.cpp, 62, The procedure number is out of range. (0x800706D1)
LatestRPC.generated.cpp, 29362, The procedure number is out of range. (0x800706D1)
(M-Files 25.6.14925.4 2025-06-18T21:30:56.341Z)
Solution
This issue is fixed in M-Files Server 25.8 (August 2025) with ID CAT-395.
If you cannot upgrade to it, see the workaround below.
Workaround
There are three workarounds you can consider/try:
- Try the gRPC protocol if possible.
- Upgrade the remote M-Files Server to 25.6.
- Downgrade the local client to 25.5 or older (matching the remote server version, ideally).
- Note that you should make sure the client computer does not run actual vaults, because it can be running M-Files Server too - in such cases downgrade is not possible.
Example Script
The following sample script should result in the error so you can compare to see whether what you have is similar and whether this situation applies to you. You can also test it to see if you would still get the error (e.g., if you change the protocol to gRPC).
Make sure to change the variables in the server connection to match your situation (login type, user, password, address, protocol, port, vault GUID).
Reference: https://developer.m-files.com/APIs/COM-API/Reference/#MFilesAPI~MFilesServerApplication~Connect.html
Dim oApp, oVault
Set oApp = CreateObject("MFilesApi.MFilesServerApplication")
' FIX THE SETTINGS HERE
Call oApp.Connect(3, "user", "pass", "", "ncacn_ip_tcp", "theMfServer","2266", "", False) ' this is an example of tcp/ip connection
' Call oApp.Connect(3, "user", "pass", "", "grpc", "theMfServer ","7766", "", False) ' this is an example of grpc connection
' FIX THE GUID HERE
Set oVault = oApp.LogInToVault("{A3C25D2B-6A76-442F-97F6-2EBEA6635221}")
' get the wofkrlows
Dim oFlows: Set oFlows = oVault.WorkflowOperations.GetWorkflowsForClient(True)
MsgBox("wofkflows count: " & oFlows.Count)
If oFlows.Count > 0 Then
For i = 1 to oFlows.Count
Dim oCurrFlow: Set oCurrFlow = oFlows.Item(i)
' This is the line that throws the error - getting the states
Dim oStates: Set oStates = oVault.WorkflowOperations.GetWorkflowStates(oCurrFlow.ID, Nothing)
' If you got this, it didn't error out
MsgBox("states count in WF " & oCurrFlow.Name & " : " & oStates.Count)
For j = 1 to oStates.Count
Dim oState: Set oState = oStates.Item(j)
Dim stateName
stateName = oState.Name
' uncomment for more info/debugging
' MsgBox(stateName)
Next
Next
End If
