## TL;DR
Check whether the timed-out call actually landed in Okta before retrying, then make the agent step idempotent and patient. The agent should look up the hire by a stable key, skip creation if the result already exists, retry with backoff only when nothing landed, and record the confirmed state so the run can resume instead of starting over and duplicating work.

```text
Okta API timed out with upload error
```

## Use this when
- The agent run fails at the step to create the new hire Okta account with a timeout from the Okta API.
- Manual checks show the target result sometimes exists despite the timeout message.
- Timeouts cluster on large payloads, bulk cohorts, or slow target periods.

## Not for this skill when
- The target service status page confirms an outage for all customers. Wait for recovery, then resume the run.
- The agent fails instantly with an authorization error instead. Fix credentials before timeout tuning.

## Steps
1. Open the agent run log and capture the timeout details: the step name, the request the agent sent to the Okta API, how long it waited, and any partial response or request identifier the target returned. Keep the affected hire as the test case. Verify: the timed-out request is fully identified in the log
2. Look up the hire directly in Okta by the stable key the step uses, such as employee ID or primary email, and establish ground truth: fully created, partially created, or absent. Never let the agent retry a create until this lookup answers. Verify: the true target state for the hire is recorded
3. Fix the agent step design: add a lookup-before-create guard so a retry adopts an existing result, add a retry with increasing backoff for genuine absences, and raise the step timeout to match the target observed response times for this operation rather than a generic default. Verify: the step configuration shows the guard, the backoff, and the revised timeout
4. Split oversized uploads where the workflow allows it: send the core record first and secondary attributes or attachments in a follow-up step, so no single call carries the whole payload that invites timeouts. Verify: a test run sends the split steps in order for one hire
5. Resume the run for the affected hire and confirm the step completes with the agent recording the confirmed identifier from Okta on the run record, then let the remaining hires flow and watch the timeout rate. Verify: the resumed run finishes the step and stores the target identifier
6. Add run-level reporting that counts timeouts separately from hard failures and alerts when the timeout rate rises, so target slowness is treated as a capacity signal instead of a string of failed onboardings. Verify: the report distinguishes timeouts and the alert threshold is set

## Why it happens
A timeout means the agent stopped waiting, not that the Okta API stopped working. Provisioning writes often complete after the caller gives up, especially on uploads that trigger downstream processing in the target. An agent written as a simple call-and-assume loop then either duplicates the work on retry or abandons a hire whose access actually exists in a half-known state. Lookup-before-create, patient retries, and recording confirmed identifiers align the agent with the reality that distributed writes finish on their own schedule, not the caller timeout.

## Variants and edge cases
### Timeout only on the first hire of a batch
Cold starts and connection setup can make the first call the slowest. Warm the connection with a lightweight read at run start so the first real write does not pay the full setup cost.

### Partial record needs completion, not recreation
When the lookup finds a partial result, have the agent complete the missing attributes with an update call and verify each required field, rather than deleting and recreating.

### Okta is chronically slow at a set hour
Schedule provisioning runs outside the target known slow window, such as vendor batch jobs, instead of endlessly raising timeouts.

Compatibility: Applies to agent workflows calling the Okta API for employee provisioning steps. Requires agent workflow editor access and read access to Okta.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_vVklM89YSL4U96VabTY6ZQ
