Troubleshooting Centre
Business Central 504 Gateway Timeout: Resolving Long-Running API Operations
Ways to split long-running operations, reduce data volume and manage request limits when diagnosing Business Central 504 errors.
In Business Central, a 504 Gateway Timeout response may relate to a request reaching its execution time limit. Microsoft documents time limits for certain web service calls and explains how to split long-running operations into smaller parts.
Initial diagnosis
Identify the operation causing the error: retrieving all stock, transferring a large order, or updating many records. Does it recur for a particular record or filter? Log the call duration and relevant filters.
Resolution approach
- Narrow the scope: Do not request unnecessary columns or records; use pagination where needed.
- Split the work: Break large data batches into smaller, traceable jobs.
- Use a continuation marker: Remember the last successfully processed record so an interruption does not force a restart from the beginning.
- Control retries: Splitting work into many parts increases the number of calls and may hit a
429limit instead. - Make job status visible: Report completed and pending records instead of telling the user everything is complete.
The difference between 429 and 504
429 indicates a request limit, while 504 indicates a timeout scenario. Applying the same retry rule to both is inappropriate. A 504 may require redesigning the underlying operation.
Integration testing
A request that runs quickly with sample data may slow down with production volumes. Pilot tests should represent realistic data volumes, workload and concurrent user numbers.
Could a write have completed even if no response arrived?
Yes. A timeout from an intermediary gateway does not prove that nothing happened in the ERP. Identify the layer producing the error and the operation reference first. Check whether the record exists before resending a write request; if the outcome cannot be verified, send it for review.
Example scenario: The first batch of a bulk transfer completed, but the response to the second was lost. Resume from the last verified batch and compare records from the second. Resending the entire file risks duplicate records.
| Observation | Next step |
|---|---|
| Small datasets also time out after the same duration | Review proxy, client and ERP time limits separately |
| Only a large filter times out | Narrow the fields and record range; verify pagination |
| Small batches return 429 | Reduce concurrency and apply the 429 approach. |
Duration, page or batch number and operation reference are sufficient for a measurement record; avoid unnecessary logging of customer data and credentials.
When should an administrator help?
If a small read-only query also times out consistently, identify the layer producing the error with the gateway and ERP administrators. Share a sanitised operation ID, time, query scope and duration. Assign writes with uncertain outcomes to a responsible person rather than automatically recreating them.
Sources and verification
Example flows are architectural recommendations, not claims of completed client projects or vendor partnerships. Technical sources checked: 17 October 2026. Installation version, licence and permissions must be verified separately.
Adapt it to your business workflow
ERP integration planning guide. Explore the scope of custom software development for further reading; we can assess your current process together.
Let's discuss your needs →