TheDocumentation Index
Fetch the complete documentation index at: https://docs.optexity.com/llms.txt
Use this file to discover all available pages before exploring further.
human_in_loop_action lets you pause an automation at any point so a human can take over the browser session. Once the human signals they’re done, the automation resumes from where it left off.
Overview
- Use when: A step requires human judgment, sensitive credentials, or manual verification that cannot be automated.
- How it works: The agent pauses, the task owner receives a magic-link email to a live browser stream, the human completes the step, then clicks a “Done” button to resume the agent.
- Timeout: If no completion signal arrives within
max_wait_timeseconds, the task fails with aHumanInLoopTimeoutException. The hard task timeout is 10 minutes, somax_wait_timemust be less than600.
Properties
| Property | Type | Unit | Description |
|---|---|---|---|
max_wait_time | float | seconds | Maximum time to wait for human completion before timing out |
JSON Example
The HITL Flow
When the agent reaches ahuman_in_loop_action node:
- Agent pauses — execution halts at this node.
- Email sent — Optexity sends a magic-link (OTP) email to the task owner.
- Human takes over — the link opens the live browser stream at the task-logs page.
- Human signals done — the task owner clicks the “Done” button in the dashboard.
- Agent resumes — the agent picks up execution at the next node.
max_wait_time seconds, the task fails.
Complete Automation Example
Timeout Behavior
Ifmax_wait_time elapses without a completion signal, the agent raises HumanInLoopTimeoutException and the task is marked failed. Choose a value that gives the human enough time to respond — common values:
| Scenario | Suggested max_wait_time |
|---|---|
| Quick manual entry (~1 min) | 120 |
| Short review (~3 min) | 180 |
| Longer step (~8 min) | 480 |
Best Practices
Place HITL nodes at natural breakpoints
Put the pause node immediately before the step that requires human action, not after. The agent stops at the HITL node; all prior nodes will have already executed.Keep max_wait_time realistic
Setting an extremely large timeout (e.g. hours) keeps the cloud worker occupied. If you expect a long human delay, consider splitting the automation into two separate runs instead.
Only one HITL pause per task at a time
A secondhuman_in_loop_action node will not trigger while the first is already active. Design your automation so HITL nodes are sequential, not concurrent.
Next Steps
- See Timing & Retries for retry strategies around HITL failures
- See Agentic Tasks for AI-driven steps that can precede a human handoff