AI Says “Execution Failed.” Why Not Just Try Again?
An AI tool timeout does not prove an operation failed. Learn how idempotency, result checks and per-target records help recover interrupted tasks.
You ask an AI to save an article. After a while, “Request timed out” appears on the screen. You reply, “Try again.”
The second attempt goes smoothly. But when you open the admin dashboard, you find two drafts with identical content.
This is a hypothetical scenario, but it reflects a real technical problem: a tool not receiving a result does not mean the remote operation did not run. When AI starts operating websites, calling APIs, and creating resources, that distinction directly affects the outcome.
The previous article, “Does Giving AI More Context Always Lead to Better Answers?”, discussed how to hand off a long-running task. This article takes the next step: when a handoff record says “failed,” should the AI taking over redo the operation, or check what happened first?
A Timeout Only Means This End Did Not Receive a Result in Time
Saving a draft involves at least several stages: the client sends a request, the platform receives and processes it, the platform returns a result, and the client receives and records that result.
A “request timed out” message can arise at different points. If the request never reached the platform, nothing may have been created. But the draft may also have been saved while the connection broke on the way back. Or the request may still be processing after the client has stopped waiting.
Those words alone cannot distinguish among these cases.
In its discussion of safe retries, AWS uses a similar example involving the creation of a cloud instance: if the caller receives no response, it cannot tell whether the instance was created. Retrying directly may create multiple instances, so the caller needs to check the actual state or rely on an API’s idempotency capability.[1]
The same principle applies to AI tools. A red error message in the interface may describe a communication, result-parsing, or waiting failure; it does not necessarily describe the full state of the business operation.
I would therefore separate execution records into these categories:
| Available evidence | What can be determined | Next step |
|---|---|---|
| Local validation rejected the request and clearly indicates it was not sent | This request did not run | Correct the input and submit again |
| The remote system returned a failure and clearly indicates that no change was made | This attempt did not achieve the goal | Handle the stated error |
| A timeout or dropped connection, with no remote status available | The result is unknown | Look for an existing result or recover according to the API’s rules |
| An object ID was returned, but the object has not been read back | A creation receipt was received | Use the ID to check the object and its status |
| The object has been read back, and its content and status match expectations | The corresponding step is complete | Record the result and continue |
A particular API may also have states such as partial success or asynchronous processing; its documentation is authoritative. The point of the table is to leave room for “result unknown” instead of rushing to classify it as failure.
“Try Again” May Create a Second Object
Reading an article twice usually does not generate another article. Calling “create draft” twice, however, may produce a new object each time.
In technical terms, “idempotency” describes a property where repeating the same operation produces no additional business side effects. The concern here is the final effect; the response text does not have to be identical every time.[1]
But an AI saying “I’ll avoid duplicates” does not establish that the platform has this capability.
Some APIs support idempotency keys. The caller generates an identifier for one business operation and reuses it on retries, allowing the server to recognize that “this is the same operation as before.” Stripe’s API documentation describes this mechanism: after a connection error, an idempotency key can be used to retry a create or update request without accidentally duplicating the operation.[2]
The key is to reuse the same identifier for the same operation. If every retry generates a new key, the server may treat them as separate requests. Conversely, if a user genuinely wants two copies with identical content, they should not be merged merely because the text is the same. AWS likewise notes that identical parameters do not always mean identical business intent.[1]
These guarantees also have a scope and a lifetime. For Stripe API v1, the documentation says keys can be removed after they have been retained for at least 24 hours; reusing a key after it has been removed may create a new request. The parameters associated with a key are also compared. Its v1 and v2 APIs handle retry results differently, so one version’s behavior should not be treated as a universal rule for all APIs.[2]
The questions to establish, then, are whether this particular API supports idempotency, which actions it covers, how long the identifier is retained, and how recovery should work after an error.
Without an Idempotent API, You Can Still Check the Result First
Many admin systems can only be operated through a webpage, or do not publicly document a duplicate-prevention mechanism. In that case, the practical step is to look for the previous attempt’s result before retrying.
If you have a draft ID, read the draft by ID. If you only have a task ID, check the task’s progress. Only when neither is available should you search using the account, title, creation time, body, and intended status together.
A title alone is not enough. An article may have an older version or a revised version, or two drafts may have been intended all along. Finding an object with the same title is a clue, not proof that it is the one just created.
Likewise, if the object is not yet visible in a list, you cannot immediately conclude that the submission failed. The request may still be processing, or the listing may not yet show the latest result. Wait or check the task status according to the platform’s instructions instead of repeatedly clicking “Create.”
There is another easily missed limit: “check first, then create if absent” is not strict duplicate prevention. Two workers may both find nothing and then each create an object. For the same object, avoid having multiple tasks submit it concurrently where possible. If a system-level guarantee is required, it must come from server-side idempotency, a uniqueness constraint, or another coordination mechanism.
If the result still cannot be confirmed and there is no reliable duplicate-prevention rule, leave the step marked “result unknown” and state what has already been checked. Stopping at an uncertain state is easier to handle than creating a second object and then guessing which one to delete.
For Multi-Platform Tasks, Track Progress for Each Destination
Suppose a task requires an article to go live on a website and a draft to be saved on each of two other platforms, WeChat Official Accounts and Zhihu.
The website is complete, and the WeChat Official Account draft was saved successfully. Then the connection drops during the Zhihu step. Rerunning the entire workflow could repeat the first two completed steps as well.
I would keep the execution record separate for each destination: the website entry would contain the article URL and the result of checking the live page; the WeChat Official Account entry would contain the draft ID and the result of reading it back; the Zhihu entry would contain what is known about the submission and what still needs checking. Each entry should also identify the corresponding article version, so a receipt for an old body is not mistaken for proof about the new one.
“Saved successfully” must also refer to the specific goal. If the user asked for a draft, verify that the draft exists, has the correct content, and remains in draft status. If the user asked for public publication, verify the public page or the platform’s published status. A successful save cannot automatically be treated as a successful publication.
These records are best saved as execution proceeds. If the only record is “everything completed” written at the end of the whole task, an interruption leaves out precisely the information needed for recovery.
A local log is not an absolute guarantee either: an interruption can still occur between remote success and writing the local record. During recovery, consider both the log and the remote state. A missing local log entry does not prove that the remote operation never happened.
When Resuming a Task, You Can Make the Instructions More Specific
After an interruption, you could give these instructions:
Read the existing execution record first, then check the remote status of each item. Skip steps that have already been completed and verified. For steps that timed out or have no receipt, check for a result before submitting again. Resubmit only after confirming the operation did not run, or when the API explicitly supports a safe retry. Finally, list completed, failed, and result-unknown items separately.
This makes the order of operations clearer, but it is not a technical guarantee against duplicates. The tool still needs a way to query status, the execution record still needs to persist, and the API’s limitations still apply.
If you are developing an AI tool, you can specifically simulate these cases in a test environment: a response is lost after a remote save, the process exits before receiving a receipt, or two workers resume the same task at once. Check whether extra objects appear, whether the original result can be identified, and whether the report is accurate. No such failure tests were performed for this article, and it does not claim that any particular tool will avoid duplicate operations.
For users, the most valuable change is small: when you see “failed,” first ask where the failure occurred. Sometimes the step is already done and only needs to be verified.
References
Sources checked: November 11, 2026. The draft scenario, record-keeping approach, and prompt in this article are design examples; API behavior depends on the documentation for the relevant product and version.
- AWS Builders’ Library: Making retries safe with idempotent APIs, a discussion of missing responses, duplicate side effects, caller-provided request identifiers, parameter changes, and retention periods.
- Stripe API Reference: Idempotent requests, documentation on idempotency keys, parameter validation, API v1 key removal, and differences between v1 and v2 behavior.
AI-generated concept illustration, not a test photograph or network topology diagram.
Discussion
Share a question or your experience. Comments appear after moderation. Your email is never displayed publicly. Comment privacy
Loading comments…