---
schema_version: "1"
id: 345e2142f835323c4e93556a68a1ae60d24e24eae42aa1ea01f547be7b144c7f
title: Response Timeout Policy
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/gateway/latest/policies-included-response-timeout.md
canonical_url: https://docs.mulesoft.com/gateway/latest/policies-included-response-timeout
source_site: docs.mulesoft.com
content_type: documentation
content_hash: d7fefe87f9bb7ab43fc332c24725cf57a085d47b3fcd99b93540abb0d5b88eae
description: MuleSoft Documentation Site
release: "1.14"
latest: true
---
---
product: Omni Gateway
version: 1.14
is-latest-version: true
keywords: basic authentication, api gateway, flex gateway, gateway, policy
---

# Response Timeout Policy

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

<table><colgroup><col> <col></colgroup><tbody><tr><td><p><strong>Policy Name</strong></p></td><td><p>Response Timeout</p></td></tr><tr><td><p><strong>Summary</strong></p></td><td><p>Sets the maximum duration that Omni Gateway waits for a response from an upstream service</p></td></tr><tr><td><p><strong>Category</strong></p></td><td><p>Quality of Service</p></td></tr><tr><td><p><strong>First Omni Gateway version available</strong></p></td><td><p>v1.9.0</p></td></tr><tr><td><p><strong>Release Notes</strong></p></td><td><p><a href="https://docs.mulesoft.com/release-notes/gateway/policies/response-timeout-release-notes">Response Timeout</a></p></td></tr><tr><td><p><strong>Returned Status Codes</strong></p></td><td><p>504 - Upstream request timeout</p></td></tr></tbody></table>

## Summary

The Response Timeout policy sets how long Omni Gateway waits for a response from an upstream service
before it returns a `504` error. The timer starts when Omni Gateway sends the request to the
upstream service.

Without this policy, an API instance uses the gateway-level Upstream Response Timeout. The
gateway-level default is 15 seconds.

This policy overrides every other Upstream Response Timeout configuration for the API instance you
apply it to, whether the policy value is higher or lower. To change the gateway-level timeout, see
[Configure Timeouts for Managed Omni Gateway](https://docs.mulesoft.com/gateway/latest/managed-timeout) or
[Configuring Timeouts in Connected Mode](https://docs.mulesoft.com/gateway/latest/conn-timeout).

## Configuring Policy Parameters

### Omni Gateway Local Mode

When you apply the policy via declarative configuration files, Refer to the following policy
definition and table of parameters:

\- policyRef: name: response-timeout-flex config: timeout: number // REQUIRED

<table><colgroup><col> <col> <col> <col></colgroup><thead><tr><th>Parameter</th><th>Required or Optional</th><th>Default Value</th><th>Description</th></tr></thead><tbody><tr><td><div><div><p><code>timeout</code></p></div></div></td><td><div><div><p>Required</p></div></div></td><td><div><div><p>15</p></div></div></td><td><div><div><p>Number of seconds Omni Gateway waits for a response from the upstream service.</p></div></div></td></tr></tbody></table>

#### Resource Configuration Example

\- policyRef: name: response-timeout-flex config: timeout: 3

### Managed Omni Gateway and Omni Gateway Connected Mode

When you apply the policy from the UI, the following parameters are displayed:

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Element</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><div><div><p>Response timeout</p></div></div></td><td><div><div><p>Number of seconds Omni Gateway waits for a response from the upstream service.</p></div></div></td><td><div><div><p>Yes</p></div></div></td></tr></tbody></table>
