Hear from Salesforce leaders on how to create and deploy Agentforce agents.
Contact Us 1-800-596-4880

Upstream Idle Timeout Policy

Policy Name

Stream Idle Timeout

Summary

Sets the maximum idle duration for a stream between the Flex Gateway and an upstream service

Category

Quality of Service

First Flex Gateway version available

v1.9.0

Returned Status Codes

504 - Upstream request timeout

Summary

The Upstream Idle Timeout policy lets you set a maximum idle duration between requests for a stream between Flex Gateway and the upstream service. By applying the policy, you prevent idle connections from consuming resources while simultaneously allowing persistent connections to remain open. The timeout starts at the last request.

By default, all Flex Gateway API instances have an upstream idle timeout of 60 seconds. Apply the policy to override the default timeout.

Configuring Policy Parameters

Flex Gateway Local Mode

In Flex Gateway Local Mode, you apply the policy to your API via declarative configuration files. Refer to the following policy definition and table of parameters:

- policyRef:
    name: idle-timeout-flex
  config:
    timeout: number // REQUIRED
Parameter Required or Optional Default Value Description

timeout

Required

60

Time in seconds before Flex Gateway closes the connection.

Resource Configuration Example

- policyRef:
    name: idle-timeout-flex
  config:
    timeout: 3

Flex Gateway Connected Mode

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

Element Description Required

Upstream idle timeout

Time in seconds before Flex Gateway closes the connection.

Yes