Setting up Human in the Loop (HITL) ETL
Human-in-the-Loop (HITL) ETL extends standard ETL pipelines by adding manual review and approval capabilities for extracted data before it reaches the destination database.
Prerequisites
-
Export a Prompt Studio project as a tool

-
Configure your source filesystem connector
-
Configure your destination database connector
Creating the HITL Workflow
Step 1: Create Workflow with HITL Configuration
Follow the Workflow Setup Guide to create your workflow:
- Navigate to Workflows in the side navigation
- Create a new workflow
- Configure source, destination, and select your exported tool
- Enable HITL: In the destination connector configuration, access the Human in the Loop tab
- Configure HITL rules and settings:
- Percentage of files sent to Manual Review: The user can set the percentage of files to be sent to HITL (Human-in-the-Loop). Based on this percentage, files will be sent to HITL accordingly. For example, if the percentage is set to 50 and 2 files are processed, then 1 file will be sent to HITL, while the other will be sent directly to the Destination DB.
- Rule Logic: The user can set the logic to either
ANDorOR - Add Rule: Here, the user can set rules based on specific conditions. All prompt keys (used in Prompt Studio) will be listed, allowing the user to validate conditions. For example, if the key is 'Name,' the user can set a rule such as 'Name starts with Joseph.' Only files that satisfy the condition will be sent to HITL.
- After approval, send result to: Configure approval destination (Destination DB or Queue)
For detailed HITL rule configuration options, see the HITL Rule configuration guide.
Step 2: Deploy as ETL
Click Deploy as ETL to create your HITL-enabled ETL pipeline.

Once deployed, files matching your HITL rules will be routed to the review queue.
User Roles and Permissions
Invite users with appropriate access rights:
- Unstract Admin - Full access to Human Quality Review
- Unstract User - No access to Human Quality Review
- Unstract Reviewer - Can review documents in the queue
- Unstract Supervisor - Can review and approve documents

Reviewing Documents
Accessing the Review Queue
- Navigate to Human Quality Review in the side navigation
- Select the project from the dropdown
- Click Fetch Next to retrieve the next document for review (FIFO order)
- Click Queue Details to view queue status

Fetching a Specific Document
Instead of working strictly in first-in-first-out order, you can jump to a particular document. Click Fetch Specific in the review header, search the queue by file name, and select the document you want to load.

Navigating Between Pages
Supervisors and administrators can use the navigation menu in the review header to switch between the Review, Approve, and Download & Sync pages without leaving the review experience.

Seeing Who Is Reviewing
When you open the Select Document from Queue modal, documents that another user is currently reviewing show that reviewer's name, so multiple reviewers can avoid working on the same item.

Interacting with Results
-
Single-click on a result to highlight the corresponding text in the document

-
Double-click on a result to edit it

-
For table / list fields, you can add and remove rows directly while reviewing. The Add Row modal adapts to the field's structure — nested objects render as labelled inputs and arrays of objects render as an inline editable table.
-
Click History in the review header to see every change made to the current document — who changed each field, when, and the before/after values. See Change Tracking & Audit Logs for details.
-
Click Finish Review to send the document to the approval queue

Approving Documents
Reviewed files move to the Approval Queue where supervisors can:
- Review the extracted data
- Highlight and verify results
- Make final edits if needed
- Approve the document for final processing

Retrieving Approved Results
Option 1: Destination Database
If you configured "After approval, send result to" as "Destination DB", approved results are automatically inserted into your configured database table.
Option 2: Queue (API Retrieval)
If you configured the approval destination as "Queue", retrieve results using the API endpoint:
curl --location 'https://us-central.unstract.com/mr/api/<organization_id>/approved/result/<class_id>/' \
--header 'Authorization: Bearer <api_key>'
Getting Required Parameters:
Organization ID:
The organization ID is available in your ETL endpoint URL.

API Key:
Create an API key for Human Review:
- Navigate to Human Quality Review
- Click Create API Key (follow screenshots)

Class ID:
Get the class ID from Download and Sync Manager:
- Click on Profile Icon → Download and Sync Manager
- Find your class ID in the list

For downloading large numbers of approved records, use the Bulk Download API. It supports pagination, async downloads for large files, and email notifications when downloads are ready.
Once approved records are successfully downloaded via the API and acknowledged, they are automatically removed from the Download and Sync Manager. As per our data-handling policy, user data is not retained on our system after it has been downloaded/acknowledged. This means:
- Records will no longer be visible in the Download and Sync Manager
- Data cannot be recovered from our system after acknowledgment
- Important: Ensure the data was successfully pulled and stored on your side before acknowledging, as this action is irreversible