> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/getting-started/learning/stackai-building-challenges/1.-gather-data-with-hitl.md).

# 1. Gather Data with HITL

## Challenge overview

Build a chat assistant for procurement requests.

Users describe what they need in plain language. The assistant extracts the required fields, asks follow-up questions for anything missing, confirms the final summary, and sends the completed request by email.

### Scenario

> Our operations team spends too much time handling procurement requests manually.
>
> Employees usually describe what they need in Slack using plain language, but someone then has to rewrite that request into a structured format for the procurement team.
>
> This back-and-forth is slow, and important details are often missing or inaccurate by the time the request is forwarded.
>
> We want a chat assistant that lets an employee submit a procurement request in plain language.
>
> The assistant should extract the relevant details, identify any missing critical information, and ask follow-up questions until the request is complete.
>
> Once the employee reviews and confirms the final structured summary, the assistant should send the completed request directly to the procurement contact by email.

### Required fields

Every procurement request must include:

* Vendor name
* Product name
* Quantity
* Deadline
* Special specifications

### Missing information rules

Use these rules when a field is missing:

* **Vendor name**
  * Ask the user to choose one of these pre-approved vendors:
    * Apple
    * Lenovo
    * Dell
    * HP
* **Product name**
  * Ask the user to specify the product.
* **Quantity**
  * Ask the user to specify the quantity.
* **Deadline**
  * Default to `7 days`.
  * Ask the user to confirm or change it.
* **Special specifications**
  * Default to `none`.
  * Ask the user to confirm or add details.

### Sample inputs

* `Hello! I need a laptop for the new sales hire starting Monday`
* `Can you order 3 laptops for the engineering team. I want all Macbook Neo in pink.`

### What to build

Your assistant should:

1. Accept a plain-language request in chat.
2. Extract the required procurement fields.
3. Detect missing information.
4. Ask follow-up questions until the request is complete.
5. Present a structured summary for review.
6. Let the user confirm or correct the summary.
7. Send the final request to the procurement contact by email.

### Key considerations

{% hint style="info" %}

* Use **Ask Human in Chat Interface** when required information is missing.
* Use the tool inside the LLM node when possible.
* Run this workflow in a **Chat Assistant** interface.
* Choose the right response type for each follow-up:
  * `choice` for vendor selection
  * `approval` for default confirmations
  * `text` for open-ended corrections
* Design a clear correction path after the summary step.
  {% endhint %}

### Helpful docs

* [Human in the Loop](/workflow-builder/core-nodes/stackai/human-in-the-loop.md)
* [Chat Assistant](/interface-and-deployment/end-user-interfaces/chat-assistant.md)
* [Tools](/workflow-builder/core-nodes/ai-agent-node/tools.md)
* [Outlook](/workflow-builder/apps/outlook.md)
* [Gmail](/workflow-builder/apps/gmail.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.stackai.com/getting-started/learning/stackai-building-challenges/1.-gather-data-with-hitl.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
