## TL;DR
The export is not failing; it is outliving the agent's request timeout because a month-end pull asks for everything at once. Change the pull to the ERP's async export pattern if offered: submit the export, poll its status with backoff, and download the result in parts. If only sync export exists, page it by date slices small enough to finish inside the timeout, checkpointing each slice so a timeout loses one slice, not the month.

```text
agent timed out waiting on the ERP export API during the month-end statement pull
```

## Use this when
- The agent's ERP export call times out during month-end pulls but works for small ranges.
- The ERP stays responsive to other calls while the export runs.
- Timeouts cluster on the largest accounts or the full-month range.

## Not for this skill when
- The ERP API returns errors or is in an outage. Wait and retry per the outage, not a redesign of the pull.
- The agent has no timeout problem but receives incomplete data. That is a pagination or filter issue, handled separately.

## Steps
1. Reproduce with increasing range sizes to find where the export duration crosses the agent timeout. Verify: the failing range size and the timeout value are both known
2. Check whether the ERP offers an async or bulk export endpoint, a report job, or file delivery for the same data. Verify: the available export patterns are listed from the API docs or a test call
3. Split the pull into date or account slices sized to finish well inside the timeout, and record each slice's completion in a checkpoint the agent writes before requesting the next. Verify: a killed run resumes after the last completed slice
4. Where async export exists, submit once, poll status with capped backoff, and download parts as they become ready. Verify: the agent never holds one open request for the whole export
5. Run the full month-end pull with the new pattern and compare row counts and totals to the ERP's own counts. Verify: the pulled data ties to the ERP totals with no slice missing or doubled

## Variant phrasings
### agent timeout ERP export API large pull pagination
The export-timeout phrasing.
### month end statement pull async export checkpoint
When rebuilding the pull pattern.

Compatibility: Agent integrations with ERP export APIs in NetSuite, SAP, Dynamics, and Sage, using sync and async export patterns.

## Why it happens
Synchronous exports couple data volume to a single HTTP request's lifetime, and month-end volume is the year's worst. The ERP is doing real work scanning and formatting; the agent's timeout is simply shorter than the job. Async export decouples request from work, and sliced sync pulls bound each request. Checkpointing matters because at month-end scale some slice will eventually fail, and the cost of a failure should be one slice.

## Edge cases / pitfalls
- Set slice size from measured durations with headroom for month-end load, not from average days.
- Polling for async exports needs its own overall deadline and status handling for failed exports, or the timeout problem becomes a polling hang.
- Export files delivered to object storage or SFTP change the failure modes to delivery checks; confirm arrival and size before parsing.

## Provenance

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