> ## Documentation Index
> Fetch the complete documentation index at: https://docs.daily.co/llms.txt
> Use this file to discover all available pages before exploring further.

# setNetworkTopology()

> Forces the network topology for the current call.

`setNetworkTopology({ topology })`

✓ Prebuilt✓ Custom

Must be called after `join()`.

> [!WARNING]
>
> **For testing only.** Calling `setNetworkTopology()` permanently overrides Daily's automatic topology management for the duration of the call — including any `sfu_switchover` threshold configured on the room or domain. Once called, Daily will no longer auto-switch based on participant count.
>
> Use this only to test topology-specific behavior during development. If Daily's defaults aren't working for your use case, contact [help@daily.co](mailto:help@daily.co).

## Parameters

**topology** `'sfu' | 'peer'` *required*

* `'sfu'` — route media through Daily's Selective Forwarding Unit
* `'peer'` — use direct peer-to-peer connections

## Return value

Returns a `Promise` that resolves to an object:

**workerId** `string`

Identifier of the SFU instance connected to. `undefined` for peer connections.

**error** `string`

Present if the topology change failed.

## Example

```javascript theme={null}
const { workerId } = await call.setNetworkTopology({ topology: 'sfu' });
console.log('Connected to SFU worker:', workerId);
```

## See also

> [card] Methods
>
> * [getNetworkTopology()](https://docs.daily.co/reference/daily-js/instance-methods/get-network-topology.md)

> [card] Guides
>
> * [Network quality](https://docs.daily.co/docs/daily-js/guides/network-quality.md)

> [card] REST API
>
> * [domain config: sfu\_switchover](https://docs.daily.co/reference/rest-api/domain/set-domain-config.md#body-properties-sfu-switchover)
> * [room config: sfu\_switchover](https://docs.daily.co/reference/rest-api/rooms/create-room.md#body-properties-sfu-switchover)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.