There is no in-built mechanism to tell the node to skip the processing of all remaining input records without getting the node to fail.
However, you can wrap your main logic in the ProcessRecords script in an if statement and use a variable as a flag to indicate whether the main logic is to be executed:

Note that the node will continue to process (i.e. read) the input records after the stop condition is met, but no output will be generated.
Attached files
Stop_Processing_On_Condition - 16 Jun 2021.lna