Not every automation problem needs a new codebase. Sometimes, an existing API, a scheduled task or a native application connector is enough to eliminate hours of manual work.
However, when workflows involve multiple applications, complex business rules and unpredictable failures, standard automation tools can become difficult to maintain.
For developers, the challenge is knowing when to configure, integrate or build.
This guide explores how to make that decision, design maintainable automation workflows and avoid unnecessary architectural complexity.
1. Understand the Process Before Writing Code
Before selecting a framework or workflow engine, identify what the automation actually needs to accomplish.
Consider an automated purchase approval workflow involving an ERP, an accounting application and an internal approval system.
The requirements might include:
- Validating incoming purchase requests.
- Checking departmental budgets.
- Assigning the appropriate approver.
- Creating records in the ERP.
- Notifying relevant users.
- Recording workflow decisions for auditing.
Each requirement introduces different dependencies, validation rules and potential failure scenarios.
Effective business process automation starts with understanding these relationships rather than immediately selecting a development framework.
Automating an inefficient process does not necessarily make it a better process.
2. Decide Whether to Configure, Integrate or Build
Developers should evaluate existing capabilities before committing to a custom implementation.
| Approach | Suitable scenario | Limitation |
|---|---|---|
| Native automation | Tasks within a single application | Restricted customisation |
| Low-code platforms | Standard cross-platform workflows | Platform dependency |
| API integration | Structured communication between applications | Integration maintenance |
| Custom software | Specialised workflows and complex business rules | Engineering and ownership costs |
For example, sending a notification whenever a CRM record changes rarely requires a dedicated backend service.
However, coordinating inventory updates, payment validation and conditional fulfilment across several applications may justify a custom orchestration layer.
Choose the least complex approach that satisfies the functional and operational requirements.
3. Recognise When Custom Automation Is Justified
Custom development becomes worth considering when existing platforms introduce persistent architectural constraints.
Typical indicators include:
- Business rules that cannot be represented through standard configurations.
- Integration with proprietary or legacy applications.
- Long-running workflows requiring persistent state.
- High transaction volumes requiring asynchronous processing.
- Granular access control and approval requirements.
- Specialised auditing and reporting requirements.
- Complex exception-handling scenarios.
These requirements do not automatically mean that an entire platform needs rebuilding. A focused integration service or dedicated workflow component may be sufficient.
For processes involving unstructured documents or language-based classification, AI automation may also be worth evaluating, provided its outputs can be appropriately validated.
4. Design a Maintainable Automation Architecture
A custom automation system should separate workflow decisions from application-specific integration logic.
Consider this simplified architecture:
Event Trigger
(API / Webhook / Schedule)
|
v
Workflow Engine
(Orchestration & State)
|
v
Business Rules
(Validation & Decisions)
|
v
Integration Layer
(Adapters & API Clients)
/ | \
v v v
CRM ERP Accounting
The workflow engine coordinates execution, while the business-rule layer determines which actions are appropriate. Integration adapters handle communication with downstream applications.
For more demanding production environments, additional components may include message queues, persistent storage, distributed tracing and monitoring services.
These architectural considerations are particularly relevant when integrating ERP, CRM and payment systems.
Keeping business rules separate from vendor-specific integrations reduces coupling and makes individual components easier to maintain.
5. Implement Controlled Retry Handling
External API failures are unavoidable. Network interruptions, temporary service outages and rate limits can disrupt otherwise valid automation workflows.
Rather than retrying every unsuccessful request indefinitely, developers should distinguish transient failures from permanent errors.
Here is a simplified Python example demonstrating bounded retries, exponential backoff and an idempotency key:
import random
import time
import requests
def submit_order(order, event_id, api_url):
headers = {
"Idempotency-Key": event_id
}
max_attempts = 3
for attempt in range(max_attempts):
try:
response = requests.post(
api_url,
json=order,
headers=headers,
timeout=10
)
if response.status_code not in (
429, 500, 502, 503, 504
):
response.raise_for_status()
return response.json()
except (
requests.Timeout,
requests.ConnectionError
):
pass
if attempt < max_attempts - 1:
delay = (2 ** attempt) + random.random()
time.sleep(delay)
raise RuntimeError(
"Order submission requires recovery"
)
This example introduces several useful engineering principles:
- Bounded retries: Prevents indefinite execution.
- Exponential backoff: Reduces repeated pressure on unavailable services.
- Jitter: Helps prevent synchronised retry attempts.
- Request timeouts: Limits waiting on unresponsive services.
- Idempotency keys: Help prevent duplicate transactions when supported by the receiving API.
The example is illustrative rather than production-ready. A production implementation should also consider authentication, Retry-After headers, persistent workflow state, structured logging and durable failure recovery.
An idempotency key only provides duplicate protection when the receiving service implements the corresponding behaviour.
6. Design for Failure, Not Just Successful Execution
A workflow that performs correctly during development may behave differently in production.
Developers should explicitly define what happens when an application becomes unavailable, incoming information is invalid or an event is delivered multiple times.
| Failure scenario | Engineering approach |
|---|---|
| Temporary API outage | Bounded retries and backoff |
| Duplicate event | Idempotency and deduplication |
| Invalid payload | Schema and business-rule validation |
| Unavailable downstream application | Queuing and deferred processing |
| Unexpected workflow error | Structured logging and alerting |
| Irrecoverable transaction | Dead-letter queue or manual review |
Some exceptions should remain subject to human judgement, particularly when automated decisions affect financial transactions or contractual obligations.
A reliable automation system must provide a recovery path, not just a successful execution path.
7. Measure More Than Technical Performance
Successful automation should deliver measurable operational improvements alongside reliable technical execution.
Useful metrics include:
- Workflow completion time.
- Automation success rate.
- Manual intervention frequency.
- Duplicate transaction rate.
- Failed event frequency.
- Mean time to recovery.
- Processing cost per transaction.
These measurements should be established before implementation so that engineering teams can compare performance against the original manual process.
Organisations exploring broader intelligent automation initiatives can use these foundations to evaluate additional opportunities without introducing unnecessary complexity.
8. Consider Long-Term Maintenance Before Building
A custom automation service creates ongoing engineering responsibilities beyond its initial development.
Teams must account for API changes, infrastructure expenses, dependency updates, security patches, monitoring and changes to operational requirements.
Before approving custom development, ask:
- Can an existing application handle the workflow reliably?
- Is custom business logic genuinely necessary?
- Who will maintain the integrations?
- How will failures be detected and resolved?
- Can the solution accommodate future requirements?
- Do the expected operational benefits justify ongoing ownership?
If a simpler implementation meets these requirements, building a dedicated application may introduce unnecessary technical debt.
Final Thoughts
Custom automation software is most valuable when existing tools cannot reliably support essential workflow requirements.
Developers should prioritise clear business rules, maintainable architecture, controlled failure recovery and measurable outcomes rather than building unnecessarily sophisticated systems.
The best automation solution is not always the one that requires the most engineering effort. It is the one that solves the operational problem reliably and remains maintainable over time.
Further Reading
This article is an engineering-focused adaptation of a business process automation guide published by Dev House Australia.
Read the original article for a broader perspective on workflow assessment, implementation choices and the commercial considerations behind custom automation development:
Business Process Automation: When Should You Build Custom Software?
How do you decide when an automation workflow has outgrown existing tools? Do you prefer low-code platforms, custom integration services or dedicated workflow engines? Share your experience in the comments.
Top comments (0)