curl --request POST --fail-with-body --max-time 30 \
"${AMLOK_API_BASE_URL}/v1/workflow-runs/wfr_example/retry" \
--header "Authorization: Bearer ${AMLOK_API_KEY}" \
--header "Accept: application/json" \
--header 'Idempotency-Key: idem_example_1001'import os
import requests
base_url = os.environ["AMLOK_API_BASE_URL"].rstrip("/")
headers = {'Accept': 'application/json',
'Idempotency-Key': 'idem_example_1001'}
headers["Authorization"] = "Bearer " + os.environ["AMLOK_API_KEY"]
response = requests.request(
"POST", base_url + "/v1/workflow-runs/wfr_example/retry",
headers=headers, timeout=30, allow_redirects=False,
)
response.raise_for_status()
print(response.json())
const baseUrl = process.env.AMLOK_API_BASE_URL;
const apiKey = process.env.AMLOK_API_KEY;
if (!baseUrl || !apiKey) throw new Error("Configure AMLOK_API_BASE_URL and AMLOK_API_KEY");
const headers = {
"Accept": "application/json",
"Idempotency-Key": "idem_example_1001"
};
headers.Authorization = `Bearer ${apiKey}`;
const response = await fetch(baseUrl.replace(/\/$/, "") + "/v1/workflow-runs/wfr_example/retry", {
method: "POST", headers,
redirect: "error", signal: AbortSignal.timeout(30000),
});
if (!response.ok) throw new Error(`AMLOK returned HTTP ${response.status}`);
console.log(await response.json());{
"data": {
"id": "wfr_example",
"object": "workflow_run",
"subject_id": "biz_example",
"created_at": "2026-10-22T13:00:00Z",
"updated_at": "2026-10-22T14:00:00Z",
"record_version": 1,
"source_refs": [],
"data_status": "pending",
"missing_fields": [],
"schema_version": "1.4.2",
"workflow_type": "underwrite",
"workflow_version": "underwrite-v1",
"status": "queued",
"input_resource_ids": [
"app_example",
"doc_example"
],
"output_resource_ids": [],
"product": "insights",
"input_manifest_id": "manifest_example",
"initial_input_manifest_id": "manifest_example",
"workload_id": "workload_example",
"billing_usage_id": null,
"monitoring_period_id": null,
"blocked_reason": null,
"stop_reason": null,
"failure": null,
"attempt": 2,
"completed_at": null
},
"meta": {
"request_id": "req_example",
"schema_version": "1.4.2",
"generated_at": "2026-10-23T14:00:00Z",
"data_status": "complete"
}
}Retry failed workflow
Retry an existing failed run only when failure.retryable is true and recovery_action is retry_same_run. Retain run identity, application, product context, evidence and the one eventual charge. Increment attempt once per accepted retry and append an audit event; replaying this idempotency key cannot increment it again. Revalidate active consent, parent context, association and workload. Respect retry_after_seconds. Non-retryable, completed, cancelled or already-running runs return 409 invalid_state; concurrent retries can start only one attempt. Unfunded accepted work uses waiting_for_credits, not a replacement run. For non-retryable invalid evidence, correct requirements or contact support as failure.recovery_action directs; do not invent a replacement billable operation. Account cancellation rejects new processing immediately with 409 invalid_state. Read-only access lasts only until workspace deletion. No separate product charge or financial mutation is introduced. Accepted commands have a durable request receipt. Full response replay lasts 24 hours; afterward the same key and target return 409 idempotency_result_expired without re-execution. Different payloads return 409 idempotency_conflict. Use GET /v1/request-receipts/lookup to find the original resource. The fingerprint includes the resolved target path and intended payload; a key used on another target is rejected rather than replayed onto it. Pre-execution validation or insufficient-credit rejection creates no accepted receipt.
curl --request POST --fail-with-body --max-time 30 \
"${AMLOK_API_BASE_URL}/v1/workflow-runs/wfr_example/retry" \
--header "Authorization: Bearer ${AMLOK_API_KEY}" \
--header "Accept: application/json" \
--header 'Idempotency-Key: idem_example_1001'import os
import requests
base_url = os.environ["AMLOK_API_BASE_URL"].rstrip("/")
headers = {'Accept': 'application/json',
'Idempotency-Key': 'idem_example_1001'}
headers["Authorization"] = "Bearer " + os.environ["AMLOK_API_KEY"]
response = requests.request(
"POST", base_url + "/v1/workflow-runs/wfr_example/retry",
headers=headers, timeout=30, allow_redirects=False,
)
response.raise_for_status()
print(response.json())
const baseUrl = process.env.AMLOK_API_BASE_URL;
const apiKey = process.env.AMLOK_API_KEY;
if (!baseUrl || !apiKey) throw new Error("Configure AMLOK_API_BASE_URL and AMLOK_API_KEY");
const headers = {
"Accept": "application/json",
"Idempotency-Key": "idem_example_1001"
};
headers.Authorization = `Bearer ${apiKey}`;
const response = await fetch(baseUrl.replace(/\/$/, "") + "/v1/workflow-runs/wfr_example/retry", {
method: "POST", headers,
redirect: "error", signal: AbortSignal.timeout(30000),
});
if (!response.ok) throw new Error(`AMLOK returned HTTP ${response.status}`);
console.log(await response.json());{
"data": {
"id": "wfr_example",
"object": "workflow_run",
"subject_id": "biz_example",
"created_at": "2026-10-22T13:00:00Z",
"updated_at": "2026-10-22T14:00:00Z",
"record_version": 1,
"source_refs": [],
"data_status": "pending",
"missing_fields": [],
"schema_version": "1.4.2",
"workflow_type": "underwrite",
"workflow_version": "underwrite-v1",
"status": "queued",
"input_resource_ids": [
"app_example",
"doc_example"
],
"output_resource_ids": [],
"product": "insights",
"input_manifest_id": "manifest_example",
"initial_input_manifest_id": "manifest_example",
"workload_id": "workload_example",
"billing_usage_id": null,
"monitoring_period_id": null,
"blocked_reason": null,
"stop_reason": null,
"failure": null,
"attempt": 2,
"completed_at": null
},
"meta": {
"request_id": "req_example",
"schema_version": "1.4.2",
"generated_at": "2026-10-23T14:00:00Z",
"data_status": "complete"
}
}workflows:execute
Retry an existing failed run only when failure.retryable is true and recovery_action is retry_same_run. Retain run identity, application, product context, evidence and the one eventual charge. Increment attempt once per accepted retry and append an audit event; replaying this idempotency key cannot increment it again. Revalidate active consent, parent context, association and workload. Respect retry_after_seconds. Non-retryable, completed, cancelled or already-running runs return 409 invalid_state; concurrent retries can start only one attempt. Unfunded accepted work uses waiting_for_credits, not a replacement run. For non-retryable invalid evidence, correct requirements or contact support as failure.recovery_action directs; do not invent a replacement billable operation. Account cancellation rejects new processing immediately with 409 invalid_state. Read-only access lasts only until workspace deletion. No separate product charge or financial mutation is introduced. Accepted commands have a durable request receipt. Full response replay lasts 24 hours; afterward the same key and target return 409 idempotency_result_expired without re-execution. Different payloads return 409 idempotency_conflict. Use GET /v1/request-receipts/lookup to find the original resource. The fingerprint includes the resolved target path and intended payload; a key used on another target is rejected rather than replayed onto it. Pre-execution validation or insufficient-credit rejection creates no accepted receipt.
Product scope · Processing lifecycle · ErrorsAuthorizations
Server-to-server API key bound to exactly one workspace, institution tenant and environment. No caller-supplied workspace override is accepted. Do not use in public browser code.
Headers
Stable key for this intended action; retain across retries.
Path Parameters
Authorized identifier in this workspace.