Request human input

View as Markdown

Pause automation while a person provides one response. human.request is asynchronous only: it returns a ToolCall that remains in requires_input until the response is submitted or the request expires.

Request a response

1const call = await bctrl.tools.start("human.request", {
2 prompt: "Please confirm the account email before continuing.",
3 responseSchema: {
4 type: "object",
5 properties: { confirmed: { type: "boolean" } },
6 required: ["confirmed"],
7 },
8 expiresInSeconds: 1800,
9}, { runtimeId: runtime.id });
10
11console.log(call.id, call.status);

The Runtime must be active. Human input can be used with browser, desktop, and spreadsheet Runtime types.

Request parameters

ParameterTypeRequiredDescription
promptstringYesQuestion or instruction shown to the person, from 1 to 10,000 characters.
responseSchemaJsonObjectNoJSON Schema that constrains the response.
expiresInSecondsintegerNoResponse deadline. Defaults to 1800; maximum 259200 seconds.

Complete the request

Submit the response with the ToolCall ID, then read the completed result:

1await bctrl.toolCalls.respond(call.id, {
2 confirmed: true,
3});
4
5const result = await bctrl.toolCalls.result(call.id, {
6 waitSeconds: 30,
7});
8
9console.log(result);

The result is a JSON value: a string, number, boolean, null, array, or object. Cancel an outstanding request with bctrl.toolCalls.cancel(call.id). An expired or cancelled request does not produce a human response.

ToolCall lifecycle

StatusMeaning
queuedThe request is waiting to run.
runningThe request is active.
requires_inputThe request is waiting for a response.
succeededA response was accepted.
failedThe request failed.
cancelledThe request was cancelled.
timed_outThe request exceeded its allowed time.

Next

  • Views — give a person a live surface for automation
  • Tools — understand ToolCalls and Toolsets
  • Runs — inspect the execution record