Skip to main content
This feature is in preview. The API may change before general availability. To try it out, contact support@intunedhq.com and we’ll enable it for your workspace.
Pause an automation and wait for a person. Use human_in_the_loop to ask a question and get a structured answer back, or hand_over_control_to_human to give an operator the live browser and let them finish the task themselves. Both helpers call an endpoint on your system, which you register in Intuned.json. Intuned doesn’t provide the operator UI—you decide who gets asked and how.
Time spent waiting on a person does not count toward the attempt’s request_timeout. The timeout you pass to these helpers is the only limit on the wait. See Human in the loop for the full request and callback contract.

Available helpers

Function reference

human_in_the_loop

Sends a request to your configured human-in-the-loop endpoint and waits. Returns the data your system posts back to the callback URL, validated against data_schema. Parameters
str
required
What you need from the person, in plain language. Shown to whoever handles the request.
type[BaseModel] | dict[str, Any]
required
The shape of the answer you expect. Sent to your endpoint as JSON Schema, and used to validate the callback payload before the automation resumes. Accepts a Pydantic model or a JSON Schema dictionary, like extract_structured_data.
int
default:"3600"
How long to wait for an answer, in seconds. After this, the call raises HumanInTheLoopTimeoutError.
list[SupportingMaterial] | None
Context to help the person answer—a screenshot of the page they’re deciding about, extracted text, or a link. See SupportingMaterial.
dict[str, Any] | None
Arbitrary JSON passed through to your endpoint untouched. Use it to route the request to the right queue, team, or end user.
Returns Returns the validated answer. When you pass a Pydantic model, you get an instance of it; with a JSON Schema dictionary, you get a dict. Raises
  • HumanInTheLoopTimeoutError — No valid answer arrived within timeout.
  • NonRetryableError — No human-in-the-loop endpoint is configured for the project.
Example

hand_over_control_to_human

Sends a request to your configured handoff endpoint with a stream URL, and waits for the person to finish. The stream URL renders the live browser session in an iframe or a browser tab, with full keyboard and mouse control and a Complete button in the top-right corner. The call returns when the person selects Complete.
Call this as the last step of your automation. Once control is handed over, the person can navigate, submit forms, and change page state—anything your code does afterward runs against a page you no longer control.
Requirements
  • The project must run in headful mode ("headful": true in Intuned.json). There’s no browser to stream otherwise.
  • A handoffEndpoint must be configured. See Configure your endpoints.
Parameters
str
required
What the person needs to do once they take over. Shown alongside the stream.
int
default:"3600"
How long the session stays open, in seconds. The remaining time is shown to the person in the stream UI. When it expires, the stream closes and the call raises HumanInTheLoopTimeoutError.
list[SupportingMaterial] | None
Context to show next to the stream. See SupportingMaterial.
dict[str, Any] | None
Arbitrary JSON passed through to your endpoint untouched.
Returns Returns None when the person selects Complete. Raises
  • HumanInTheLoopTimeoutError — The person didn’t complete the session within timeout.
  • NonRetryableError — No handoff endpoint is configured, or the project isn’t running in headful mode.
Example
A handoff streams a live browser to a person who may type a password or a one-time code. The trace keeps recording while they work, so wrap the handoff in tracing_paused when the session could involve credentials.

SupportingMaterial

Optional context delivered to your endpoint with the request.
  • TextMaterial — Plain text. Use it for extracted values, a page excerpt, or an explanation of why the automation stopped.
  • ImageUrlMaterial — An image at a URL your endpoint can fetch.
  • ImageBufferMaterial — An image as raw bytes. Buffers are uploaded by the runtime and delivered to your endpoint as short-lived signed URLs, so a page.screenshot() result can be passed straight through.