When a record is created through the UI, the API LB is triggered on Save, and the system automatically assigns a workflow state (znWorkflowInstance), for example New/Init.
However, when the same record is created via an API call executed externally, the znWorkflowInstance is null.
Why does this happen?
The issue arises because when znWorkflowInstance is null, and the API logic executes validations later in the record’s lifecycle, the required field values may not yet be populated. This results in the API logic throwing an error and rolling back the operation, which is problematic if additional logic needs to run after the API block is executed.