When the outcome is unknown
Handle a governed action whose result could not be confirmed: why Anlyon does not send it again, why its allowance stays held, and the four ways to settle it.
Sometimes a write leaves Anlyon and no usable answer comes back. The provider may have applied it. Anlyon records that outcome as unknown. It does not record failed, and it does not send the request again. This page shows what your code sees, what Anlyon does next, and how a person settles what Anlyon cannot.
Why unknown is not failed
The cost of guessing wrong is not symmetric. If a timed-out refund is called failed and retried, a customer may be refunded twice. If it is called unknown and looked up, the cost is one read.
- Risk. A write that may have happened is never sent again blind, and its allowance stays held so a duplicate cannot slip under the limit.
- Effort. Anlyon schedules the lookups, records each one as evidence, and gives you one queue of effects that need a person.
- Cost. A lookup reads the provider. It never writes.
What unknown means
unknown means the available evidence cannot establish the result. It happens when:
- the request timed out, or the connection was reset after the request was sent
- the provider answered with a
5xx - the worker handling the dispatch stopped before it recorded an outcome
A request that provably never left Anlyon is failed, and a provider’s 4xx is usually failed. The exception is a 409 to stripe.refund or resend.email_send, which is unknown: it can mean the idempotency key is still in use, which proves nothing either way.
Detect an unknown outcome in your code
import { Client } from '@anlyonhq/sdk';
const agent = new Client({ apiKey: process.env.ANLYON_API_KEY! });
const { data } = await agent.actions.invoke(
'send-email',
{ emailId: 'welcome-1', to: ['a@example.com', 'b@example.com'], subject: 'Welcome' },
{ idempotencyKey: 'welcome-1' },
);
if (data!.status === 'unknown') {
// Do not invoke again. Keep the effect id and read it later.
console.log(data!.grade, data!.effectId, data!.error);
}curl -s -X POST https://api.anlyon.com/api/v2/actions/send-email/invoke \
-H "Authorization: Bearer $ANLYON_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: welcome-1" \
-d '{ "input": { "emailId": "welcome-1", "to": ["a@example.com", "b@example.com"], "subject": "Welcome" } }'import os
from anlyon import Client
agent = Client(api_key=os.environ["ANLYON_API_KEY"])
result = agent.actions.invoke(
"send-email",
{"emailId": "welcome-1", "to": ["a@example.com", "b@example.com"], "subject": "Welcome"},
idempotency_key="welcome-1",
)
if result.data["status"] == "unknown":
# Do not invoke again. Keep the effect id and read it later.
print(result.data["grade"], result.data["effectId"], result.data["error"])The HTTP status is 200, and the body carries:
{ "status": "unknown", "grade": "unknown", "effectId": "eff_01JABCDEF" }
The invocation’s error reads:
The provider may have applied effect <effect id>; Anlyon is reconciling it. Do not retry; inspect the effect.
The effect, read while unknown:
{
"outcome": "unknown",
"stage": "reconciling",
"verification": "unverified",
"unresolvedExposure": true,
"reconciliation": { "attempts": 0, "nextAt": "2026-10-27T09:00:30.000Z", "exhausted": false }
}
reconciliation.nextAt is set: a lookup is already scheduled. From the CLI, an invoke whose outcome is unknown exits with code 13.
A request is sent once
Nothing in the effect lifecycle retries a write. A dispatch is claimed once, and the database refuses a second dispatch attempt for one effect. A worker that dies after sending leaves the effect unknown. The effect is reconciled, never dispatched again.
The allowance stays held
The effect reserved its impact before dispatch. While the outcome is unknown, that reservation is neither consumed nor released. It is held:
{ "consumed": 0, "reserved": 2, "unknownExposure": 2 }
Two emails are held against the limit. available is limit - consumed - reserved, so other callers have that much less room. The hold survives restarts and period boundaries. For a per-user limit, it is held against that user’s allowance. See When the limit is hit.
A dependent effect does not start either. unknown and pending never satisfy a dependsOn.
Four ways an unknown outcome settles
1. The scheduled read-back
Anlyon schedules a lookup when it records the unknown outcome. The lookup is a read. It asks the provider what happened to this operation and never writes.
- A declared action repeats its verify rule: one
GET, compared with the declared status and checks. stripe.refundlooks the refund up by id, or by theanlyon_effectmetadata every refund carries.github.file_updatelooks for a commit on the branch whose message carries the effect trailer.resend.email_sendreads the email by id, or scans recent sent emails for theanlyon_effecttag, bounded at 3 pages and 20 reads.
A match settles the effect. For a declared action:
{
"stage": "settled",
"outcome": "succeeded",
"grade": "confirmed",
"verification": "provider",
"attempts": [{ "kind": "dispatch" }, { "kind": "reconcile" }]
}
The destination saw one write and one read. The limit then reads:
{ "consumed": 2, "reserved": 0, "unknownExposure": 0 }
The settled amount goes into the period the reservation was made in, even when the answer arrives in a later period.
Backoff. The first lookup runs 30 seconds after the unknown outcome. The delay doubles after each attempt, up to one hour. After 12 attempts automatic reconciliation stops:
{ "reconciliation": { "exhausted": true, "nextAt": null } }
The effect’s evidence gains an entry that begins “Automatic reconciliation stopped”. The outcome is still unknown and the allowance is still held. Nothing times out into failed.
2. Reconcile now
You do not have to wait for the schedule. Ask for the same lookup now. This needs actions:invoke, which is in the default set, or the admin or member role in the console. It also runs one more lookup on an exhausted effect.
const { data: effect } = await agent.actions.reconcileEffect('eff_01JABCDEF');
console.log(effect!.outcome, effect!.grade, effect!.verification);curl -s -X POST https://api.anlyon.com/api/v2/actions/effects/eff_01JABCDEF/reconcile \
-H "Authorization: Bearer $ANLYON_API_KEY"effect = agent.actions.reconcile_effect("eff_01JABCDEF").data
print(effect["outcome"], effect["grade"], effect["verification"])Reconcile stays available while the environment is halted, so a halt never strands held exposure. An effect that is already succeeded or failed answers 409: a settled outcome is not reconciled again. If another lookup or write for the effect is in flight, the call also answers 409; try again shortly. API reference: Reconcile an effect now.
3. A same-key replay, where the adapter supports it
A replay repeats the lost write under the same provider identity. It is safe when the provider deduplicates on an idempotency key, and inside that key’s window.
stripe.refundsupports it for 24 hours, the time the adapter treats Stripe’s idempotency key as usable.resend.email_sendsupports it for 24 hours. Resend keeps an idempotency key for 24 hours, as of 2026-10-03. A send recovered that way gradesacknowledged.github.file_updatedoes not.- A declared action does not. It sends no provider idempotency key, so a repeated write could apply twice.
A replay is a write. It passes every control a dispatch passes, and it needs actions:resolve, which no key receives by default, or the admin role in the console. The key that requested the effect cannot replay it.
// An operator key with actions:resolve. Never the key that made the call.
const operator = new Client({ apiKey: process.env.ANLYON_OPERATOR_KEY! });
await operator.actions.replayEffect('eff_01JABCDEF');curl -s -X POST https://api.anlyon.com/api/v2/actions/effects/eff_01JABCDEF/replay \
-H "Authorization: Bearer $ANLYON_OPERATOR_KEY"operator = Client(api_key=os.environ["ANLYON_OPERATOR_KEY"])
operator.actions.replay_effect("eff_01JABCDEF")On a declared action the replay is refused before anything is sent, with HTTP 409:
{
"success": false,
"error": {
"code": "REPLAY_REFUSED",
"message": "Replay refused (replay_unsupported): http.declared does not support replay: Not supported. Without a provider idempotency key a repeated write could apply twice, so a replay is refused before anything is sent."
},
"requestId": "req_0123456789abcdef0123456789abcdef"
}
The reason is in the message, in the parentheses. The API does not return error.details. The refusal is recorded in the effect’s evidence, and the outcome stays unknown.
A replay that is admitted and then fails says nothing about the original write. The effect stays unknown and its allowance stays held. API reference: Replay a lost write.
4. An operator’s resolution, labelled manual
When no lookup can settle it, a person checks the provider and records what they found.
await operator.actions.addEffectNote('eff_01JABCDEF', 'Asked the mailer support desk, ticket 81233.');
const { data: resolved } = await operator.actions.resolveEffect('eff_01JABCDEF', {
outcome: 'succeeded',
reason: 'Checked the mailer dashboard: the message was sent.',
externalReference: 'msg_7781',
});
console.log(resolved!.grade, resolved!.verification); // acknowledged, manualcurl -s -X POST https://api.anlyon.com/api/v2/actions/effects/eff_01JABCDEF/resolve \
-H "Authorization: Bearer $ANLYON_OPERATOR_KEY" \
-H "Content-Type: application/json" \
-d '{ "outcome": "succeeded", "reason": "Checked the mailer dashboard: the message was sent.", "externalReference": "msg_7781" }'operator.actions.add_effect_note("eff_01JABCDEF", "Asked the mailer support desk, ticket 81233.")
resolved = operator.actions.resolve_effect(
"eff_01JABCDEF",
outcome="succeeded",
reason="Checked the mailer dashboard: the message was sent.",
external_reference="msg_7781",
).data
print(resolved["grade"], resolved["verification"]){ "outcome": "succeeded", "grade": "acknowledged", "verification": "manual" }
- A manual
succeededgradesacknowledged, neverconfirmed. It keepsverification: "manual"everywhere it is shown, and consumes the reserved amount. - A manual
failedwith no partial effect releases the allowance. If part of it happened, passpartialEffect: "confirmed"withactualImpact, the quantities that did happen; those are consumed and the rest released.partialEffect: "possible"keeps the allowance held. - The
reasonis 10 to 2000 characters. A note is 3 to 2000. - Resolving and adding notes need
actions:resolve, or the admin role in the console. The key that requested an effect can never resolve it. - A confirmed outcome is not rewritten: resolving an effect that is already settled answers
409.
API reference: Record a manual resolution, Add an investigation note.
Not finding it never becomes failed
A lookup that finds nothing is absence of evidence. Metadata can be removed, a commit can be force-pushed away, and a provider’s list can lag. So a lookup that does not find the operation leaves the effect unknown, with its allowance held:
{ "outcome": "unknown", "grade": "unknown", "unresolvedExposure": true }
The evidence for each such lookup on a declared action reads:
The read-back did not match the declared verify rule. That does not prove the write failed, so the outcome stays unknown.
After dispatch, one thing settles an effect failed without a person: the provider’s own record of this operation in a failed state. A Stripe refund that Stripe reports as failed is that. Failing to find the operation is not. Failing to replay it is not.
Design a read-back that survives a lost response
Some APIs choose the resource id and return it in the response. The verify URL then uses {{response.id}}. That rule works when the response arrives. It cannot run when the response is lost, because the id was in the lost response. Reconciliation then sends no request, and the evidence reads:
The verify rule needs the provider response, which was lost. The outcome stays unknown until an operator resolves it.
This is stated before the write: the preview’s limitations block carries an unsupported item about read-back after a lost response.
To avoid it, let the caller choose the id. An action that writes to /v1/emails/{{input.emailId}} and verifies at the same URL can be read back after a lost response. An action with no verify rule cannot be read back at all, and a lost response on it also waits for an operator. See Govern any HTTP API.
Find every effect that needs a person
const { data: open } = await operator.actions.effects({ unresolved: true });
const { data: unknown } = await operator.actions.effects({ grade: 'unknown' });
for (const effect of open ?? []) {
console.log(effect.id, effect.endUserId, effect.outcome, effect.reconciliation.attempts, effect.reconciliation.exhausted);
}curl -s "https://api.anlyon.com/api/v2/actions/effects?unresolved=true" \
-H "Authorization: Bearer $ANLYON_OPERATOR_KEY"
curl -s "https://api.anlyon.com/api/v2/actions/effects?grade=unknown" \
-H "Authorization: Bearer $ANLYON_OPERATOR_KEY"open_effects = operator.actions.effects(unresolved=True).data
unknown = operator.actions.effects(grade="unknown").data
for effect in open_effects:
print(effect["id"], effect["outcome"], effect["reconciliation"]["attempts"], effect["reconciliation"]["exhausted"])Add endUserId to narrow to one of your users. From the CLI: anlyon effects list --unresolved and anlyon effects list --grade unknown.
What your agent should do
- Do not retry. A new invocation under a new key is a new operation. If the lost write landed, a retry is a duplicate.
- Keep the
effectId. It is in the invoke response. - Read the effect. Poll
GET /api/v2/actions/effects/{id}, or reconcile now. Wait foroutcometo leaveunknown. - Repeat the same call if you must repeat something. The same
Idempotency-Keyreturns the existing invocation in its current state. The sameoperationKeywith the same request returns the existing effect. Neither sends anything. - Do not start dependent work. Pass
dependsOnand Anlyon refuses the dependent call with409 DEPENDENCY_UNRESOLVEDuntil the outcome is settled. - Escalate when
reconciliation.exhaustedis true. An operator resolves it with evidence.
An invocation governed by an effect is resolved through its effect. POST /api/v2/actions/invocations/{id}/resolve refuses it with 409 EFFECT_RESOLUTION_REQUIRED.
Errors you may see
| Status and code | When | What to do |
|---|---|---|
200, status: unknown |
The response was lost or the provider answered 5xx. |
Follow the steps above. |
409 on reconcile |
The effect is already settled, or a lookup or write is in flight. | Read the effect, or try again shortly. |
409 REPLAY_REFUSED |
The adapter has no replay, the 24-hour window passed, or a dispatch control failed. | Resolve with evidence instead. |
409 ENVIRONMENT_HALTED on replay |
The environment is halted. | Reconcile or resolve, which stay available. |
409 on resolve |
The effect is already settled. | Read it. |
403 |
The key lacks actions:resolve, or it requested the effect. |
Use a separate operator key, or an admin in the console. |
400 on resolve |
The reason is shorter than 10 characters, or a confirmed partial has no actualImpact. |
Fix the request. |
How it behaves
- Governed means an adapter or a declaration. A governed action has an effect, a read-back and a held allowance. The invocation of an action with no declaration can still be
unknown, and you resolve that one on the invocation. See Receipts and grades. - A declared action recovers by the read-back or an operator. Its write is sent once.
confirmedon a declared action means your own verify rule matched. A resource that already existed can match, so write a rule that distinguishes this write.- A lookup is bounded. Past its bounds the effect stays
unknownuntil a person resolves it. - A limit belongs to one environment. Held exposure in one environment leaves the others unchanged.
- A manual resolution is a person’s statement, labelled as one.

