Yes, you can exit or move on after a certain number of unsuccessful attempts of gathering information. This is done using the "Not Found" condition on slots and by adding a counter variable. Check out this example in the docs on "Moving on after multiple failed attempts".
That sample defines this counter (my recommendation: name it differently):
"context": {
"counter": "<? context['counter'] + 1 ?>"
}
Then, in a "not found" condition, you would check $counter > 3
. There, in the output and context section, set up another context variable to trigger skipping to a specific node.