# Human in the loop

Example OrchaJS human-in-the-loop agent that pauses for approval, then resumes.

Source: https://orcha.sh/docs/tutorial/client-actions
Markdown: https://orcha.sh/docs/tutorial/client-actions.mdx

<CodeExplorer {...clientActionsAgentExample} className="tutorial-code-explorer" />

## Move work into the caller

This example is a complete purchase approval agent. It can prepare the request,
but it cannot approve a purchase itself. The `request_human_approval` action
has `execution: "client"`, so Orcha describes the action to the model without
providing executable server code.

When the model requests approval, Orcha stores the request and pauses safely.
The application receives the action name, validated arguments, and a `callId`.
After the human decides, the application resumes that same session with the
result. The process can restart or the decision can happen much later; the
model context is already durable.

Human approval is only one client-action pattern. The same boundary can ask a
browser to upload a document, request a device location, open a confirmation
screen, collect a signature, or use any capability owned by the caller.

Select any file in the editor to inspect the complete standalone project.

## Understand each file

<TutorialFileReference files={clientActionsAgentFiles} />

Next: [compose agents with subagents](/docs/tutorial/subagents).
