---
schema_version: "1"
id: 701d33aa4cb2fcde790215a92f7f97c5cf8ad7244b930e85101bf82f5a0254b0
title: Stream Idle Timeout Policy
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/gateway/1.13/policies-included-stream-idle-timeout.md
canonical_url: https://docs.mulesoft.com/gateway/1.13/policies-included-stream-idle-timeout
source_site: docs.mulesoft.com
content_type: documentation
content_hash: deb86e9d512c3192444d11a1bdfb017e39034fdd8863f3f4effc131053378a03
description: MuleSoft Documentation Site
release: "1.13"
latest: false
---
---
product: Omni Gateway
version: 1.13
keywords: basic authentication, api gateway, flex gateway, gateway, policy
---

# Stream Idle 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>Stream Idle Timeout</p></td></tr><tr><td><p><strong>Summary</strong></p></td><td><p>Sets the maximum duration a stream can remain idle without receiving a request or response</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/stream-idle-timeout-release-notes">Stream Idle Timeout</a></p></td></tr><tr><td><p><strong>Returned Status Codes</strong></p></td><td><p>504 - Stream timeout</p></td></tr></tbody></table>

## Summary

The Stream Idle Timeout policy sets a maximum duration for which a stream can remain idle without
receiving any data, either inbound from the client to Omni Gateway or outbound from Omni Gateway to
the upstream service. The policy prevents idle connections from consuming resources unnecessarily.
The timeout period starts at the last activity on the stream, whether the activity is a request or a
response.

By default, all Omni Gateway API instances have a stream timeout of 300 seconds. Apply the policy to
override the default 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: stream-idle-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>300</p></div></div></td><td><div><div><p>Time in seconds before Omni Gateway closes the connection.</p></div></div></td></tr></tbody></table>

#### Resource Configuration Example

\- policyRef: name: stream-idle-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>Stream idle timeout</p></div></div></td><td><div><div><p>Time in seconds before Omni Gateway closes the connection.</p></div></div></td><td><div><div><p>Yes</p></div></div></td></tr></tbody></table>
