Expert analysisAutomation →

Workflow automation error handling: how processes stay reliable even when things go wrong

A workflow is only reliable once it is clear what happens when things go wrong: retry, set aside, report and trace instead of failing silently.

This is a concept study, not a report on a client project. The processes and sample values described are assumptions worked through on paper, not proven results.

PageLeo editorial team · · 12 min read

Starting point
A small business has automated several processes: inquiries into the CRM, documents into storage, reminders to customers. As long as everything runs, nothing stands out.
Challenge
Interfaces go down, data arrives incomplete, limits kick in, events arrive twice. Without error handling, such cases trickle away and nobody notices in time.
Approach
We classify errors by type, retry only what makes sense to retry, make steps idempotent, route doubtful cases into a review queue and actively report everything relevant.
Benefit
The benefit is less lost work and faster response. It can be measured by error rate, time to detection and queue backlog; error-freedom cannot be promised.

Monday morning: three inquiries are missing in the CRM, and nobody knows since when

The alarm does not come from a system but from a customer. She made an inquiry through the contact form a week ago and never received a reply. She cannot be found in the CRM. According to the log, the form sent a confirmation, and the workflow shows green checkmarks. Somewhere in between something got lost, and there is no trace of it.

In this scenario, a service business with two dozen employees runs four automations: form inquiries into the CRM, invoices from the mailbox into accounting, appointment reminders by email and a weekly report. Each was built individually and ran satisfactorily for months. Nobody ever defined what should happen when a step fails.

That is the normal case, not the exception. When building a workflow, you think of the path that works. But everyday operation also consists of paths that do not work: a service that does not respond for an hour, a required field that arrives empty, a daily limit that is reached at 3 pm. Anyone who does not design these cases designs them anyway, only unconsciously and usually as data loss.

What is dangerous is less the total outage than the partial outage. If an automation fails completely, you usually notice within a day because something familiar fails to appear. But if it loses only every twentieth case, every spot check looks fine. The damage is spread over weeks, attributed to individuals and appears in no statistic as a cause. It is precisely this class of error that turns a convenient automation into a risk that is trusted blindly.

A workflow that does nothing when things go wrong actually does something: it silently discards.

Four types of error that cannot be treated alike

The first type is the failed interface. A service responds with a server error, runs into a timeout or is simply unreachable. The cause is beyond your control and often temporary. Patience helps here in the form of controlled retries, and if that is not enough, a clean setting aside with a notification.

The second type is incomplete or implausible data: an email address without an at sign, an amount as text, a required field that a form let through. Retrying is pointless, because the same record fails again and again. This belongs with a person who decides whether to correct, follow up or discard.

Third, limits and quotas. Almost every interface limits calls per minute or day and responds to an overrun with a notice, usually status 429, often with an indication of how long to wait. This is an error that calls for consideration, not persistence. Fourth, duplicates: webhooks are occasionally delivered more than once, users click twice, a retry hits a step that had actually already succeeded.

The distinction is the heart of the matter. Anyone who treats all four cases with the same mechanism, such as “retry three times on error”, does harm: it hammers a throttled service, retries hopelessly faulty data and, with duplicates, creates even more of them.

  • Temporary and external: retry with growing intervals, then set aside and report.
  • Permanent and data-related: do not retry, store for manual review.
  • Limited by the provider: wait as the service indicates, and spread the load.
  • Arrived twice: detect and ignore before anything is booked twice.

Where effort belongs first: weight by damage, not by frequency

Not every error deserves the same care. A missed weekly report is annoying, a lost customer inquiry is expensive, an invoice sent twice is embarrassing and, depending on the case, legally unpleasant. The first analysis therefore does not ask what can technically go wrong, but what the worst realistic outcome would be at each step.

To do this, we go through the workflows step by step and note three things per step: What happens if it fails? What happens if it runs twice? And who would notice, and when? The third question is the most uncomfortable, because the answer is often “probably the customer, in a week”. Exactly these steps get priority.

Added to this is the dependency on third-party systems. An interface you do not control will change at some point: a field is renamed, a version is deprecated, an authentication method is replaced. It is not a question of whether. The analysis therefore records which steps depend on which external services and how quickly a change would be noticed.

From the answers, a simple matrix of damage and detection risk emerges. Steps with high damage and low visibility get the full treatment with key, queue and alert. Steps with low damage and high visibility, such as a report that does not arrive and is missed immediately, get by with a simple retry and a notification. That keeps the effort proportionate and the processes understandable.

Figure · Where error handling sensibly begins

  • Silent discarding of customer inquiriesrelative priority
  • Duplicate bookings or emailsrelative priority
  • Incomplete data in the CRMrelative priority
  • Throttled interfacesrelative priority
  • Delayed reportsrelative priority
Illustrative representation, not measured values. It shows a possible weighting by damage and detection risk in a hypothetical business. Illustrative depiction, not measured values.

Better to fail loudly than to carry on quietly

The principle behind all measures is: an error must never remain invisible, and nothing may be lost before a person has seen it or deliberately discarded it. This implies an order of means. First the system tries to help itself, for example with a retry. If that fails, it puts the case in a safe place. Only then does it report, and in a targeted way.

An alternative would be to report every error immediately. That sounds thorough and ends after two weeks in an inbox nobody reads any more. Notifications about things that heal themselves create fatigue, and the one important notification gets lost in it. We therefore rely on thresholds: a single retried request is log material, a service that has not responded for ten minutes is worth a phone call.

A second alternative is an all-or-nothing approach in which a workflow aborts completely on every error and is rolled back. That suits database transactions, rarely processes that touch several third-party systems: a sent email cannot be taken back. It is more practical to design steps so that they can be safely executed again, and to resume the case at the point where it stopped.

Repeatable instead of reversible: build steps so that a second run causes nothing new.

Figure · Silent failure versus active error handling

  • A step fails, the process aborts, the case disappears.
  • The message sits somewhere in the platform's history, nobody sees it.
  • A manual restart leads to duplicate bookings.
  • A change to the third-party interface is only noticed through customer complaints.
Description of a hypothetical workflow, not measured values.

The structure: four layers of protection around every step

We think of error handling in layers that work from the inside out. At the center is the individual step with its check of the input data. Around it lies the retry logic, then the securing in a queue, and on the outside the monitoring with notifications. Each layer catches what the inner one could not resolve and passes it on with more context.

The check at the entrance is important. Before a step addresses a third-party system, required fields, formats and plausibility are checked: is the address well-formed, is the amount within the expected range, is the date not in the past? This way, invalid data does not even end up in a retry cycle but goes straight to where a person looks at it.

Part of the design is also deciding who is responsible for what. A review queue without a named person is a graveyard. We therefore define who opens it daily, how long an entry may sit, and what happens when that period is exceeded. For small teams, one person with a clear deputy is often enough; what matters is commitment.

An example of how it works together: the form delivers an inquiry with an invalid phone number. The input check classifies it as doubtful, places it in the queue together with the original text and notifies the responsible person. The contact is neither discarded nor created unchecked. A few minutes later a person corrects the number, confirms, and the process continues where it was stopped.

Figure · Layers of protection around a workflow step

  • Monitoring and notification

    Logs, metrics, alerts with a threshold and a named recipient.

  • Review queue

    Failed or doubtful cases remain fully preserved and wait for a person.

  • Retry with backoff

    Only for temporary errors, with growing intervals and an upper limit.

  • Validation and idempotency

    Validate input data, design the step so that a second run is harmless.

Each layer catches what the inner one could not resolve.

Retry without duplicating: the mechanics in detail

For retries, a growing interval called exponential backoff has proven its worth: for example after one, then four, then sixteen seconds, with an upper limit on attempts and waiting time. Added to this is a small random jitter so that ten failed cases do not return at exactly the same moment and overload the just-recovered service again. Retries happen only for timeouts, server errors and throttling, not for errors the call itself caused, such as invalid input.

If an interface states during throttling how long to wait, the workflow follows that indication instead of making its own calculation. Under persistent limit pressure, it is worth bundling calls or spreading them over time. A daily limit cannot be overcome by retrying; it calls for a decision: set aside until the next time window or adjust the plan with the provider.

Idempotency means that a step produces the same result when executed several times as when executed once. Technically this is done through a key per case, for example the form ID or an identifier built from sender, subject and date. Before a step creates anything, it checks whether this key has already been processed. Some interfaces support such keys directly; for others we keep our own small table of completed cases.

The key must be chosen to be stable and suitable at the same time. Too coarse, and two genuine inquiries from the same person on the same day count as a duplicate. Too fine, for instance with a timestamp in the key, and the duplicate is never recognized. There is no general solution here, only the question of what constitutes the same thing in each case.

Figure · The path of a case through error handling

  1. Check input

    Required fields, format, plausibility

  2. Check key

    Already processed? Then skip

  3. Execute step

    Call to the interface

  4. Retry

    Only for temporary errors, with backoff

  5. Queue

    Case secured, notification triggered

Simplified flow. Depending on the type of error, the path branches earlier.

Edge cases: half-completed cases and interfaces that change

The trickiest edge case is the half-completed case. A workflow creates a contact in the CRM, sends a confirmation and fails at the third step, creating a task. A restart from the beginning produces a second contact and a second email. That is why the process remembers for each case which steps are done and resumes at the first open one. This state tracking is extra effort but prevents exactly the duplicates that cause the most trouble later.

A second edge case: the error occurs only sometimes. An interface responds in two percent of cases with an empty field that is otherwise never empty. Individual error messages say little about this, a log with context does: which case, which step, which input, which response. There you see the pattern, for instance that it always affects records with umlauts in a particular field.

Third, the creeping change in third-party interfaces. A provider adds a field, changes a format or switches off an old version. In the worst case the workflow keeps running and delivers wrong results unnoticed, for example because an amount now arrives in cents instead of euros. What helps are plausibility checks on the results, functional tests with a test record and reading the provider's change notes, which we schedule as a fixed appointment.

Fourth, it affects the people who fix errors. A review queue only works if an entry contains everything needed for the decision: the original data, the reason for the error in plain words and a button or instructions for the next action. If someone first has to search in three systems, the queue will be avoided.

What improves and how you can tell

What is to be expected is less a drop in errors than a change in their consequences. Errors keep occurring, because third-party systems remain error-prone. The difference: they no longer lead to lost inquiries or duplicate bookings, but to an entry in the queue and a notification. The benefit is that disruptions lose their cost, not that they disappear.

This can be measured with a few metrics. The time between an error occurring and being detected should fall from days to minutes or hours. The share of automatically healed cases, meaning errors resolved on their own by retrying, shows how much work the system takes off your hands. The age of the oldest entry in the review queue reveals whether anyone is taking care of it. Added to this are complaints or follow-up questions from customers that point to losses.

A start-up phase is also realistic. In the first weeks, monitoring shows error patterns that were never visible before, and the number of notifications initially rises. That is a success of visibility, not a step backwards. After that, thresholds are adjusted and frequent causes eliminated. We do not promise particular rates, because they depend on the third-party systems, the data quality and discipline in the team.

If you want to know more precisely, look at errors by cause instead of by count. If timeouts accumulate at a single service, a conversation with the provider or a switch is worthwhile. If data errors accumulate at one input point, the solution lies in the form, not in the workflow. That way, monitoring leads not only to faster response but, in the long run, to fewer disruptions at the source.

  • Time to detection of an error, measured from the log and the alert time.
  • Share of cases that succeeded after retrying without intervention.
  • Number and age of entries in the review queue.
  • Number of duplicates detected and discarded, relative to those that actually arose.

What proves sustainable in operation

The first principle: error handling belongs in the design, not at the end. Anyone who adds it afterwards has to rebuild data flows that are already running in production. For new workflows, we therefore ask the question about failure before the question about function. That costs an afternoon during design and saves weeks later.

The second: logs need structure and retention rules. An entry should contain case ID, step, time, result and error reason, but no unnecessary personal data in plain text. How long logs are stored is also a data protection question that you should clarify with your data protection advisor. We mention this here as a pointer, not as legal information.

The third: workflows are software and deserve versioning and tests. Every change is kept as a new version, with a short note on what changed and why, and can be rolled back. A small set of test cases covering the normal case, a service outage, a duplicate and a broken record is run after every change. That is less effort than it sounds and catches the most common follow-on errors.

The fourth concerns the alerts themselves. A notification is only as good as its content: it names the workflow, the step, the case, the reason and a link to the place where one can act. And it goes to a person or a channel that is read, not to a catch-all address. Not everything has to ring at night, but for customer inquiries and payment flows it should be clear who looks first in the morning.

The fifth concerns the schedule. New automations should go through a phase of closer observation before being left to themselves. And afterwards there need to be fixed maintenance dates, because even a quiet workflow becomes outdated.

A quiet workflow is not necessarily a healthy one. Check whether it is silent because everything works or because nobody is listening.

Figure · A possible path to reliable workflows

  1. 1

    Week 1

    Inventory: processes, steps, third-party systems, worst outcome per step.

  2. 2

    Week 2

    Input check, keys against duplicates and retry rules for the most critical processes.

  3. 3

    Week 3

    Define review queue, notification paths, responsibilities and deputies.

  4. 4

    Week 4

    Test cases, versioning, functional test against third-party interfaces.

  5. 5

    From week 5

    Closer observation, adjust thresholds, then fixed maintenance dates.

Example schedule that varies depending on the number of processes and access to systems.

Conclusion: first ask what happens when things go wrong, then build

Reliable automation does not show in normal operation but on the day something is wrong. That is when it is decided whether a case stays secured, reported and traceable or disappears without a trace. Error handling is the part of the work you do not see afterwards when it is done well, and miss very clearly when it is absent.

The next step is small. Pick one of your workflows and go through it step by step: What happens if this step fails? What if it runs twice? Who would notice? If any of the questions has no clear answer, you have found the first gap. We are happy to look at two or three processes with you and tell you clearly where the greatest need for action lies and where a simple alert is already enough.

A step-by-step approach is the realistic one. You do not have to rebuild all your processes at once. Start with the one where a lost case costs the most, and then carry the patterns over to the others. Even an input check, a key against duplicates and a reliable alert change the situation noticeably, even if the full build-out is still to come.

One limit belongs here: no error handling makes third-party systems more reliable; it only makes your processes more resilient against their weaknesses. And it does not replace a person who actually opens the queue. Technology and responsibility belong together.

Frequently asked questions

What makes up good error handling in workflow automations?

A check of incoming data, retries with backoff for temporary errors, idempotency against duplicates, a queue for cases that a person has to decide, plus logs and alerts with thresholds. What matters is that no case gets lost without someone finding out.

How often and for how long should a failed step be retried?

That depends on the service and on the damage. A few attempts with growing intervals and an upper limit for the total waiting time are common, complemented by small random variations. After that, the case should be set aside and reported. Errors caused by wrong data are not retried.

What does idempotency mean in automations?

A step is idempotent if running it several times gives the same result as running it once. In practice you achieve this with a key per case that is checked before creating or sending anything. That way, webhooks delivered twice or retries do not lead to duplicate contacts, bookings or emails.

How do I know that a workflow is failing silently?

Only through active monitoring. Helpful measures include counts of expected events, such as “at least one inquiry in the CRM today”, a daily summary of runs, a test record that is sent through the workflow regularly, and alerts on unusual silence. A log that nobody looks at is not enough.

What should I do when a provider changes its interface?

Read the provider's change notices regularly, check results for plausibility and plan a functional test with test data. If the workflow keeps running but with different values, that is only noticed through checks on the result. Changes should be tried out in a test environment first and rolled out as a new version.

Do I really need a review queue for small automations?

Not always in an elaborate form. For non-critical processes, a table of failed cases and a daily email are enough. As soon as customer inquiries, money or deadlines are involved, a reliable place with a named owner is worthwhile, so that nothing is lost and decisions remain traceable.

Know what your processes do when something goes wrong

Tell us two or three of your automations. We will go through them with you and show where an error would silently disappear today and what is the cheapest way to prevent it.

Send an enquiry