Your AI agent receives a simple instruction: create an invoice, send it to the customer, and update the CRM.
The invoice is successfully created.
Then the connection times out.
The agent receives an error, retries the operation, and creates a second invoice.
Congratulations. Your AI agent has just rediscovered distributed systems.
The problem isn't intelligence. It's execution.
The failure had nothing to do with the quality of the model.
A more sophisticated prompt would not solve it either.
The external system performed an operation, but the agent never received confirmation. From the agent's perspective, the outcome is unknown.
This distinction matters when agents interact with production systems:
- Creating invoices in accounting software.
- Modifying customer records in a CRM.
- Sending emails to external recipients.
- Creating purchase orders in an ERP.
- Updating employee records.
Every one of these operations can have consequences that survive the failure of the agent that initiated it.
A timeout is not a rollback
Consider this sequence:
- The agent requests invoice creation.
- The accounting system commits the transaction.
- The response is lost.
- The agent retries.
Unless the integration explicitly prevents duplicate operations, the retry may create another invoice.
This is precisely why execution reliability cannot be delegated entirely to a language model.
An agent should not have to infer whether a financial transaction occurred from an incomplete conversation history.
Four properties I would require from a production agent workflow
- Idempotency
Every business operation should have a stable identifier that survives retries.
For example:
"invoice:create:order_7842"
Where the destination API supports idempotency keys, repeated requests using the same key should not produce additional business operations within the API's documented guarantees.
Generating a new key every time the agent retries defeats the purpose.
- Persistent execution state
An operation needs an execution record outside the model's context window.
A minimal state machine could distinguish:
- "PENDING" — the operation has not started.
- "IN_PROGRESS" — execution has been attempted.
- "SUCCEEDED" — the external operation is confirmed.
- "FAILED" — failure has been established.
- "UNKNOWN" — the external outcome cannot yet be determined.
That last state is especially important.
An unknown outcome should trigger reconciliation, not necessarily another write operation.
- Reconciliation
Before repeating an ambiguous operation, the execution layer should determine whether its intended effect already exists.
For example, it could query the accounting system using an external order reference.
If the invoice exists, the workflow can continue without creating another one.
If the result remains uncertain and the API offers no safe retry mechanism, the workflow should stop for investigation.
- Partial failure recovery
Suppose the invoice was created, the email was sent, but the CRM update failed.
Restarting the entire workflow is usually the wrong recovery strategy.
Instead, resume from the failed step using persistent execution records and verified external state.
This is not an exotic AI problem. It is a familiar distributed systems problem with a new kind of client.
A failure-injection test for your agent
Before connecting an agent to a production ERP, try these scenarios in a sandbox:
Injected failure| Expected behaviour
Timeout after invoice creation| No duplicate invoice
Agent process crashes| Recover execution state
CRM becomes unavailable| Preserve completed operations
Two workers execute the same task| Prevent duplicate business effects
External outcome cannot be verified| Stop for reconciliation
A successful demonstration under ideal conditions tells you very little about how an agent handles these failures.
Where should this logic live?
Ideally, not inside the prompt.
The assistant can interpret instructions and select actions. The execution architecture should provide the mechanisms required to make those actions reliable.
This is one reason I am interested in platforms such as "Houston" (https://ok-houston.com/r/s99sapu6), which position themselves at the execution and orchestration layer between AI assistants and enterprise software.
Regardless of the platform, I would explicitly test its behaviour under network failures, concurrent requests and interrupted workflows before relying on it for critical operations.
Agentic AI does not make decades of software engineering obsolete.
If anything, it makes those engineering principles more valuable.
When was the last time you deliberately broke your AI agent's connection halfway through a transaction?
Further reading:
- "AWS Well-Architected: Make mutating operations idempotent" (https://docs.aws.amazon.com/wellarchitected/latest/framework/rel04-bp04.html)
- "AWS: Transactional outbox pattern" (https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/transactional-outbox.html)
Disclosure: I work commercially with Houston and may receive compensation through the link above. The failure scenarios are proposed engineering tests, not verified Houston test results.
