Skip to main content

Human in the Loop Step

The Human in the Loop step pauses flow execution and requests manual approval or review from designated team members. Use it for high-stakes decisions, quality control, compliance requirements, or any situation where human judgment is required.
Agent + Human Collaboration: Let agents handle routine decisions automatically, but pause for human review when decisions are critical, uncertain, or require empathy and judgment.

How It Works

Human in the Loop pauses the flow, sends notification to reviewers, waits for their decision, then continues based on their response:

When to Use Human in the Loop


Configuration

Reviewers

reviewers
array
required
Email addresses of people who can approveExamples:
Add multiple reviewers - any one can approve (OR logic, not AND)
requiredApprovals
number
default:"1"
Number of approvals required before continuingExamples:
  • 1 - Any single reviewer can approve (most common)
  • 2 - Two reviewers must approve
  • all - All reviewers must approve
Use multi-approval for: Very high-stakes decisions, compliance requirements

Request Details

title
string
required
Short description of what needs approvalExamples:
  • “Refund Request Approval”
  • “Content Review Required”
  • “High-Value Order Approval”
  • “Customer Escalation Review”
description
string
Detailed context for reviewersCan include data from previous steps:
data
object
Structured data to display to reviewersExample:
Displayed in structured format for easy review

Response Options

approvalOptions
array
default:"[\"approve\", \"reject\"]"
Custom approval optionsDefault: Approve or RejectCustom examples:
allowComments
boolean
default:"true"
Let reviewers add commentsComments are included in the step output and can be used in subsequent steps.
allowEdit
boolean
default:"false"
Let reviewers edit the submitted dataUse when: Reviewers might need to modify details (e.g., adjust refund amount, edit generated content)

Timeout

timeout
number
How long to wait before auto-action (in hours)Examples:
  • 24 - Wait 24 hours
  • 72 - Wait 3 days
  • No timeout - Wait indefinitely
timeoutAction
enum
What to do when timeout is reachedOptions:
  • auto_approve - Automatically approve
  • auto_reject - Automatically reject
  • escalate - Send to escalation reviewers
  • notify - Send reminder notification

Response Structure

Human in the Loop returns the reviewer’s decision:

Accessing Response

Reference in subsequent steps:

Common Patterns

Review when agent confidence is low
Use when: Agent handles most cases, humans review uncertain ones
Require approval above threshold
Use when: Financial controls, spending limits
Review agent-generated content before sending
Use when: Customer-facing content, compliance requirements
Multi-tier approval for complex decisions
Use when: Risk-based escalation, org hierarchy
Required approval for regulated actions
Use when: GDPR, HIPAA, financial regulations
Human takeover for complex support issues
Use when: Complex issues, angry customers, ambiguous situations
Auto-escalate if not reviewed in time
Use when: Time-sensitive approvals, SLA requirements

Real-World Examples

Example 1: Refund Approval Workflow


Example 2: Marketing Content Review


Example 3: High-Value Sales Approval


Best Practices

Use Sparingly

Only require human approval when truly necessary. Over-use creates bottlenecks and reduces efficiency.

Provide Context

Give reviewers all information needed to make informed decisions. Include agent reasoning, data, and recommendations.

Set Reasonable Timeouts

Don’t let requests sit forever. Set timeouts with appropriate fallback actions.

Make It Easy

Simple approve/reject options work best. Complex choices slow decisions.

Notify Appropriately

Use email, Slack, or your team’s communication channel. Don’t rely on reviewers checking the platform.

Track and Optimize

Monitor approval rates and times. If humans always approve, consider removing the step.

Troubleshooting

Causes:
  • Email address incorrect
  • Notifications in spam
  • Email service configuration issue
Solutions:
  • Verify email addresses
  • Check spam folders
  • Add noreply@quiva.ai to contacts
  • Check notification settings
Causes:
  • Reviewers haven’t responded
  • No timeout set
  • Notification not received
Solutions:
  • Set reasonable timeouts
  • Add reminder notifications
  • Add multiple reviewers
  • Contact reviewers directly
Causes:
  • Wrong variable path
  • Step not completed
Solutions:
  • Use ${step_name.approved} or ${step_name.decision}
  • Check step executed in logs
  • Verify step name matches
Causes:
  • Threshold too low
  • Agent confidence not high enough
  • Unnecessary approvals
Solutions:
  • Raise approval threshold
  • Improve agent prompts for higher confidence
  • Review if approvals are truly needed
  • Consider batch approvals for similar requests

Next Steps

Condition Step

Route based on approval decision

Agents

Configure agents that recommend decisions

Delay Step

Add time-based pauses to flows

Notifications

Configure notification channels