How to use HITL?
Human-in-the-Loop (HITL) Instructions
HITL is a powerful approach that combines artificial intelligence with human expertise to enhance decision-making and improve task outcomes. Follow these steps to implement HITL within CrewAI:
Step 1: Configure Your Task
Set up your task with human input enabled:
Step 2: Provide Webhook URL
When kicking off your crew, include a webhook URL for human input:
Step 3: Receive Webhook Notification
Once the crew completes the task requiring human input, you'll receive a webhook notification containing:
- Execution ID
- Task ID
- Task output
Step 4: Review Task Output
The system will pause in the "Pending Human Input" state. Review the task output carefully.
Step 5: Submit Human Feedback
Call the resume endpoint of your crew with the following information:
Caution: Feedback Impact on Task Execution
It's crucial to exercise care when providing feedback, as the entire feedback content will be incorporated as additional context for further task executions. This means:
- All information in your feedback becomes part of the task's context.
- Irrelevant details may negatively influence it.
- Concise, relevant feedback helps maintain task focus and efficiency.
Always review your feedback carefully before submission to ensure it contains only pertinent information that will positively guide the task's execution.
Step 6: Handle Negative Feedback
If you provide negative feedback:
- The crew will retry the task with added context from your feedback.
- You'll receive another webhook notification for further review.
- Repeat steps 4-6 until satisfied.
Step 7: Execution Continuation
When you submit positive feedback, the execution will proceed to the next steps.