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

# askForInput, handoff

> [!NOTE]
>
> This feature is in **preview**. The API may change before general availability. To try it out, contact [support@intunedhq.com](mailto:support@intunedhq.com) and we'll enable it for your workspace.

Pause the Run to ask for input or hand over the browser. A person, your own system or an agent can answer. See [Human in the loop](https://intunedhq.com/docs/main/02-features/human-in-the-loop.md) for how interactions are delivered and answered.

## askForInput

```typescript theme={null}
import { askForInput } from "@intuned/runtime/interactions";

function askForInput<T = unknown>(options: AskForInputOptions<T>): Promise<T>;
```

Asks a question and waits for the JSON answer.

**Parameters**

| Name | Type | Description |
| - | - | - |
| `prompt` | `string` | The question shown to whoever answers. |
| `schema` | `ZodType<T>` | Optional. The answer must match it. It's sent as JSON Schema so whoever answers knows what to submit. |
| `url` | `string` | Optional. Public HTTPS URL that receives the interaction with its `inputUrl`. |
| `headers` | `Record<string, string>` | Optional. Headers sent with the delivery to `url`. |
| `timeout` | `number` | Optional. Milliseconds to wait. Default 15 minutes, max 60 minutes. |
| `extendRunTimeout` | `boolean` | Optional. Keep the Run alive while waiting. Default `true`. |
| `signal` | `AbortSignal` | Optional. Stops waiting when aborted. The Run's abort signal always applies. |

**Returns**

The answer, typed and validated by `schema` when you pass one.

## handoff

```typescript theme={null}
import { handoff } from "@intuned/runtime/interactions";

function handoff(options?: HandoffOptions): Promise<void>;
```

Hands over live control of the Run's browser. Resolves when **Done** is pressed. Needs `headful` set to `true` in Intuned.json.

**Parameters**

| Name | Type | Description |
| - | - | - |
| `prompt` | `string` | Optional. Instructions shown on the handoff page. |
| `url` | `string` | Optional. Public HTTPS URL that receives the interaction with its `handoffUrl`. |
| `headers` | `Record<string, string>` | Optional. Headers sent with the delivery to `url`. |
| `timeout` | `number` | Optional. Milliseconds to wait. Default 10 minutes, max 30 minutes. |
| `extendRunTimeout` | `boolean` | Optional. Keep the Run alive while waiting. Default `true`. |
| `signal` | `AbortSignal` | Optional. Stops waiting when aborted. |

**Returns**

`void`, once **Done** is pressed.

## getAbortSignal

```typescript theme={null}
import { getAbortSignal } from "@intuned/runtime";

function getAbortSignal(): AbortSignal;
```

Returns the Run's abort signal. It fires when the Run is aborted or canceled. Pass it to your own long waits so they stop with the Run.

## Errors

| Error | Thrown when |
| - | - |
| `InteractionTimeoutError` | No one answered before `timeout`. |
| `InteractionCanceledError` | The interaction was canceled: **Cancel** on a handoff, the interaction's `cancelUrl`, or **Esc** in the terminal. |
| `InteractionDeliveryError` | `url` couldn't be reached after retries. |
| `InteractionInputValidationError` | The answer doesn't match `schema`. The answer is in its `input` property. |
| `HandoffActiveError` | `handoff` was called while another handoff is open in the Run. |
| `InteractionUnsupportedError` | Nobody can answer here: agent runs, non-interactive CLI runs, or `handoff` in a headless Run. |

All are exported from `@intuned/runtime/interactions`.

## Related

* [Human in the loop](https://intunedhq.com/docs/main/02-features/human-in-the-loop.md) — How interactions are delivered and answered, the webhook payload, and best practices.
* [extendTimeout](https://intunedhq.com/docs/main/05-references/runtime-sdk-typescript/extend-timeout.md) — Reset the timeout timer for the current attempt.


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