> ## Documentation Index
> Fetch the complete documentation index at: https://docs.promptloop.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Concepts & Capabilities

> Understanding PromptLoop tasks, web browsing capabilities, and the difference between batch and single job processing

## What are PromptLoop Tasks?

**PromptLoop Tasks are no-code AI agents** that take structured inputs (like websites or search terms) and return clean, formatted data at any scale. They're the core building blocks of the PromptLoop platform, designed to automate research that would normally take hours per prospect or company.

### Key Benefits

* **Automate research** that normally takes hours per prospect or company
* **Scale instantly** from a single test row to thousands of data points
* **Keep results consistent** with strict formats, confidence scores, and guardrails
* **Process any format** from millions of company page types using optimized AI models

## Task Types & Capabilities

### 1. Website Tasks

**Best when you have:** A list of URLs\
**What it does:** Crawls websites and extracts specific data points\
**Example use case:** Find pricing information on competitor websites

```json theme={null}
{
  "data_uuid": "1",
  "inputs": ["https://acme-corp.com"]
}
```

### 2. Search Tasks

**Best when you have:** Only a company name or keyword\
**What it does:** Searches for relevant websites first, then crawls them\
**Example use case:** Get LinkedIn URL for "Acme Corp"

```json theme={null}
{
  "data_uuid": "2",
  "inputs": ["Acme Corp"]
}
```

## Web Browsing Capabilities

### Crawl Depth Options

Choose the appropriate browsing depth based on your data requirements:

| Depth                       | How Deep It Goes                            | When to Use                            | Cost     |
| --------------------------- | ------------------------------------------- | -------------------------------------- | -------- |
| **Single Page**             | Only the exact URL provided                 | Data only from that specific page      | Lowest   |
| **Smart Crawl** *(default)* | Follows relevant links a few levels deep    | Most website tasks—fastest & cheapest  | Standard |
| **Deep Research**           | Explores far more pages throughout the site | Hard-to-find info buried deep in sites | Higher   |

### Data Format Options

Tasks support multiple output formats to match your exact needs:

| Format                  | Best For                                 | Example                               |
| ----------------------- | ---------------------------------------- | ------------------------------------- |
| **Text**                | Descriptions & summaries                 | Company descriptions                  |
| **True/False**          | Yes/no checks                            | "Does this company offer API access?" |
| **Number**              | Counts, prices, metrics                  | Employee count, revenue               |
| **Link**                | URLs                                     | Contact page URLs, social links       |
| **Single Category**     | One label from predefined options        | Industry classification               |
| **Multiple Categories** | Multi-label tagging                      | Services offered                      |
| **List**                | Multiple items (creates additional rows) | List of team members                  |
| **JSON**                | Complex structured data                  | Contact information objects           |

## Single Jobs vs Batch Processing

### Single Jobs

**Use case:** Real-time processing, testing, or individual requests\
**How it works:** Send one input, get immediate results\
**Best for:**

* Testing task configurations
* Real-time integrations
* Processing individual records on-demand

**API Endpoint:** `POST /v0/tasks/{id}`

**Example Request:**

```bash theme={null}
curl --request POST \
  --url https://api.promptloop.com/v0/tasks/YOUR_TASK_ID \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: YOUR_API_KEY' \
  --data '{
    "task_version": 0,
    "inputs": ["https://example.com"]
  }'
```

**Response Format:**

```json theme={null}
{
  "status": "success",
  "data": {
    "job_id": "uuid-here",
    "error_detected": false,
    "list": false,
    "data_json": {
      "Company Description": "AI platform for sales teams...",
      "Contact Email": "team@example.com"
    }
  }
}
```

### Batch Processing

**Use case:** Large-scale data processing (hundreds to thousands of inputs)\
**How it works:** Upload JSONL data, monitor progress, retrieve results when complete\
**Best for:**

* Processing entire datasets
* Bulk research operations
* Building comprehensive databases

**API Endpoints:**

* `POST /v0/batches` (launch)
* `GET /v0/batches/{id}` (monitor)
* `GET /v0/batches/{id}/results` (retrieve)

**Input Format (JSONL):**

```json theme={null}
{"data_uuid": "1", "inputs": ["https://example.com"]}
{"data_uuid": "2", "inputs": ["https://another-example.com"]}
{"data_uuid": "3", "inputs": ["https://third-example.com"]}
```

**Batch Workflow:**

<Steps>
  <Step title="Launch Batch Job">
    Submit your JSONL data to start processing multiple inputs simultaneously
  </Step>

  <Step title="Monitor Progress">
    Check job status periodically using the batch ID
  </Step>

  <Step title="Retrieve Results">
    Download completed results once processing is finished
  </Step>
</Steps>

## Input & Output Structure

### Input Requirements

Each task defines specific input requirements:

* **Website tasks:** Valid URLs (e.g., `https://example.com`)
* **Search tasks:** Search terms or company names (e.g., `"Acme Corp"`)
* **Data UUID:** Unique identifier for tracking each input through processing

### Output Structure

Task outputs are structured as key-value pairs:

```json theme={null}
{
  "data_uuid": "1",
  "Company Name": "Acme Corp",
  "Industry": "Software",
  "Employee Count": 150,
  "Has API": true,
  "Contact Email": "contact@acme-corp.com",
  "Technologies": ["React", "Node.js", "AWS"]
}
```

**For List Tasks:** Additional rows are created for each list item:

```json theme={null}
[
  {
    "data_uuid": "1",
    "Company Name": "Law Firm LLC",
    "Partner Name": "John Smith",
    "Partner Title": "Managing Partner",
    "Partner Email": "jsmith@lawfirm.com"
  },
  {
    "data_uuid": "1",
    "Company Name": "Law Firm LLC",
    "Partner Name": "Jane Doe",
    "Partner Title": "Senior Partner",
    "Partner Email": "jdoe@lawfirm.com"
  }
]
```

## Advanced Features

### Search Engine Techniques

Enhance your search tasks with standard search operators:

* `site:domain.com` - Results only from specific site
* `-site:domain.com` - Exclude specific site
* `term1 AND term2` - Results containing both terms
* `"exact phrase"` - Exact phrase matching

### Chained Tasks

Connect multiple tasks in sequence for complex workflows:

1. **Website Discovery:** Find company website from name
2. **Data Extraction:** Extract contact information from website
3. **Social Enrichment:** Find LinkedIn profiles for key contacts

### Webhooks for Batch Processing

Receive real-time notifications when batch jobs complete:

```json theme={null}
{
  "status": "completed",
  "message": "Your data processing is complete",
  "data": [...], // Array of processed results
  "timestamp": "2024-07-23T03:57:20.643Z",
  "batch_id": "12345"
}
```

## Best Practices

### Task Design

* **Focus:** Create tasks for specific purposes and only ask for the data you need
* **Testing:** Use the single job endpoint to test and iterate on task configurations
* **Formatting:** Select the correct output format for each data type to ensure consistency

### Performance Optimization

* Start with **Smart Crawl**, upgrade to **Deep** only if data is missing
* Keep search queries generic (not company-specific) for better consistency
* Use **Categories** for any data you'll filter or group on later

### Error Handling

* Implement proper retry logic for rate limits (429 errors)
* Validate input data using the `/v0/batches/validate-data` endpoint
* Monitor job status regularly for batch processing

## Rate Limits & Constraints

### Batch Limits

* **File size:** 100MB maximum per JSONL upload
* **Processing:** Subject to account usage limits
* **Results:** Use `output_type=stream` for large result sets

### API Rate Limits

* **Single jobs:** 5 TPM for task execution
* **Batch jobs:** 4 TPM for batch creation
* **Monitoring:** 20 TPM for status checks

## Next Steps

<CardGroup cols={2}>
  <Card title="API Overview" icon="server" href="/get-started/api-overview">
    Learn about authentication, data formats, and API workflow
  </Card>

  <Card title="Quick Start" icon="rocket" href="/get-started/quickstart">
    Run your first task and see results immediately
  </Card>

  <Card title="Create Tasks" icon="plus" href="https://promptloop.com/account/custom">
    Build custom tasks in the PromptLoop dashboard
  </Card>

  <Card title="View Templates" icon="template" href="https://promptloop.com/templates">
    Browse proven task templates for common use cases
  </Card>
</CardGroup>
