How should a CAPTCHA interruption be classified — Business Exception or Application Exception?

Hi everyone,

I’d like to get some opinions on how you would handle the following scenario in a UiPath REFramework process.

For each transaction, the workflow does the following:

  • Application launches successfully
  • Login page loads successfully
  • Username and password are entered
  • Login button is clicked
  • A CAPTCHA unexpectedly appears
  • The bot cannot proceed with the transaction

My question is: How should this situation be classified?

At first, it may seem like an Application Exception because the bot cannot continue interacting with the application. However, an Application Exception would normally cause the transaction to be retried.

In this case, if the CAPTCHA is still present, retrying the transaction may simply result in the same failure again.

At the same time, I’m not sure whether it should be considered a Business Exception, because:

  • The transaction data is valid
  • The application itself is available
  • There is no application crash
  • The issue is caused by an unexpected CAPTCHA challenge

So I’m curious how experienced UiPath developers would classify and handle this situation.

Questions:

  1. Would you classify the CAPTCHA as a Business Exception, Application Exception, or another type of exception?
  2. In REFramework, would you allow the transaction to be retried, or would you mark it as failed without retrying?
  3. Would you skip the transaction, stop the entire process, or send an alert to support?
  4. Would your approach change if the CAPTCHA appears only occasionally versus appearing consistently?
  5. Is there a recommended UiPath pattern for handling this kind of unexpected authentication/security challenge?

I’d especially appreciate explanations based on real-world REFramework implementations and exception-handling best practices.

Thanks in advance!

Hi @Abhinay_Reddy1

My approach in REFramework:

  1. CAPTCHA = Application (System) Exception, not a Business Exception, because the transaction data is valid but the bot is blocked by an unexpected security challenge.

  2. Retry? Only one retry after reinitializing the application/session. Don’t keep retrying the same transaction if the CAPTCHA is still present.

  3. If CAPTCHA persists: Stop the process and send an alert (with logs/screenshot) to support.

  4. Occasional vs consistent CAPTCHA:

  • Occasional: Reinitialize once and retry.
  • Consistent: Treat it as an environment/security issue and terminate the job.
  1. Recommended UiPath pattern: Detect CAPTCHA explicitly, handle it as a System Exception, and use Action Center/Human-in-the-Loop if CAPTCHA is an expected authentication step.

Hope this answered your question. Thanks

Hi @Abhinay_Reddy1 ,

Try these steps to handle it:

  • If CAPTCHA appears occasionally, throw a System Exception, allow a limited retry, and send an alert if retries fail.
  • If CAPTCHA appears consistently, stop processing and raise an alert to the support team, as retries are unlikely to succeed.
  • Avoid marking it as a Business Exception because the transaction data itself is valid.
  • In REFramework, log the event clearly, capture a screenshot, notify support, and move the transaction to an exception state.

Try these approach:

  1. Detect CAPTCHA.
  2. Take screenshot and log details.
  3. Throw a System Exception.
  4. Retry only if there is a chance the CAPTCHA disappears.
  5. If repeated CAPTCHA occurrences are detected, stop the process and notify support to investigate.

Thanks

@Abhinay_Reddy1 I agree with the System/Application Exception approach, but I would handle one part slightly differently.

Since the CAPTCHA appears during login, this is really an application/session-level issue rather than a problem with the transaction itself. I wouldn’t use a BusinessRuleException just to avoid retries, because the transaction data is still valid.

I would detect the CAPTCHA explicitly in the login/Init workflow. If it appears occasionally, reinitialize the application/session and allow one controlled retry. If the CAPTCHA is still present after that, capture a screenshot/log the details, notify support and stop the job.

I also wouldn’t simply skip the current transaction and continue with the next one. If authentication is blocked, the following transactions will most likely fail for the same reason.

So the flow would be:
Detect CAPTCHA → one session/login retry → if still present, stop processing + alert support.

If the CAPTCHA occurs later while processing a specific transaction, then failing that transaction as an Application Exception makes sense.

Also, if CAPTCHA is an expected part of the authentication flow, I wouldn’t try to automate or bypass it. The better long-term option is to work with the application/security team on an approved bot authentication method such as a service account, API, SSO, or another supported mechanism. Human-in-the-loop could be considered only if that is approved by the application/security policy.

The main point is that exception classification and retry strategy should be kept separate. It is still an Application/System issue even when you deliberately decide not to keep retrying it.

Hi @Abhinay_Reddy1,

Ideally, in REFramework, the login and CAPTCHA check should be handled in the Initialization state if the application requires login only once for the entire process.

You can check whether the CAPTCHA is present after login. If it appears, use Throw to raise a System Exception. This will move the process to the End Process state without retrieving or processing any transaction items.

If the application requires a fresh login for every transaction, then after detecting the CAPTCHA, throw an exception with a specific message.

In the Set Transaction Status workflow, check for that specific CAPTCHA message. Based on this, add a new Transition (CAPTCHA) to the End Process state, and you can add take a screenshot, add a meaningful log message in this Transition state.

This way, the process can stop gracefully without unnecessarily retrying the transaction when the CAPTCHA is preventing further processing.

Thanks!