---
url: >-
  https://adk.nht.io/api/batteries/isolation/child_process/functions/forkIsolated.md
---

# Function: forkIsolated()

```ts
function forkIsolated<S>(
  spec: S,
  options: ForkIsolatedOptions,
): IsolatedService<S>;
```

Defined in: [src/batteries/isolation/child\_process/transport.ts:379](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/isolation/child_process/transport.ts#L379)

Sugar over [createChildProcessTransport](createChildProcessTransport.md) + @nhtio/adk/batteries/isolation!createIsolatedService — the one-call entry point most callers want:
fork a guest module (or BYO-spawn one) and get back a ready-to-use @nhtio/adk/batteries/isolation!IsolatedService.

## Type Parameters

| Type Parameter                                                                                                                                                                                                                                                                                                                             |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `S` *extends* [`IsolatedServiceSpec`](../../../../@nhtio/adk/batteries/interfaces/IsolatedServiceSpec.md)<[`MethodMap`](../../../../@nhtio/adk/batteries/type-aliases/MethodMap.md), [`StreamMap`](../../../../@nhtio/adk/batteries/type-aliases/StreamMap.md), [`EventMap`](../../../../@nhtio/adk/batteries/type-aliases/EventMap.md)> |

## Parameters

| Parameter | Type                                                            |
| --------- | --------------------------------------------------------------- |
| `spec`    | `S`                                                             |
| `options` | [`ForkIsolatedOptions`](../type-aliases/ForkIsolatedOptions.md) |

## Returns

[`IsolatedService`](../../../../@nhtio/adk/batteries/interfaces/IsolatedService.md)<`S`>

## Throws

@nhtio/adk/batteries/isolation!E\_ISOLATION\_UNSUPPORTED\_ENV when called outside node.

## Throws

@nhtio/adk/batteries/isolation!E\_INVALID\_ISOLATION\_OPTIONS when `options` fails the
mutual-exclusivity check documented on [ForkIsolatedOptions](../type-aliases/ForkIsolatedOptions.md), or when `createIsolatedService`'s
own option validation fails.
