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

# App Task

> This page gives you an overview of the App Task in Agent Builder

## Overview

App Tasks enable integration with external tools and applications in your workflow. These tasks are designed for
operations like data processing, file operations, and API integrations.

## Visual Example

<img src="https://mintcdn.com/gaife/BMVDmEfGqS5tsfj9/agent/tasks/images/app-task.png?fit=max&auto=format&n=BMVDmEfGqS5tsfj9&q=85&s=0beac9228a905090224b7e3227c56fed" alt="APP Task Example" width="413" height="231" data-path="agent/tasks/images/app-task.png" />

## Configuration Structure

```json theme={null}
{
  "type": "APP_TASK",
  "block": {
    "name": "App Task Name",
    "type": "APP_TASK",
    "instructions": "Task instructions",
    "provider": "provider_name",
    "tool_name": "tool_name",
    "tool_id": 123,
    "org_integration_id": null,
    "input_parameters": [],
    "expected_output": [],
    "dependencies": [],
    "error_policy": "RAISE"
  }
}
```

## Required Fields

| Field | Type | Description | Required |
| - | - | - | - |
| name | string | Task identifier | Yes |
| instructions | string | Task instructions | Yes |
| provider | string | Tool provider | Yes |
| tool\_name | string | Name of the tool | Yes |
| tool\_id | integer | Tool identifier | Yes |
| org\_integration\_id | integer | Organization integration ID | No |
| input\_parameters | array | Input configuration | Yes |
| expected\_output | array | Output configuration | Yes |

## Provider Types

Available providers for App Tasks:

* PDF
* CSV
* Drive
* Code
* Email
* Notion
* Custom

## Input Parameters

### Basic Input

```json theme={null}
{
  "name": "filename",
  "type": "STRING",
  "description": "Name of the file to process",
  "required": true,
  "source": "task_config"
}
```

### File Content Input

```json theme={null}
{
  "name": "file_content",
  "type": "STRING",
  "description": "Content to write to file",
  "required": true,
  "source": "task_config"
}
```

### Configuration Input

```json theme={null}
{
  "name": "settings",
  "type": "OBJECT",
  "description": "Tool configuration settings",
  "properties": [
    {
      "name": "format",
      "type": "STRING",
      "description": "Output format",
      "required": true
    },
    {
      "name": "options",
      "type": "OBJECT",
      "description": "Additional options"
    }
  ]
}
```

## Output Parameters

### File Output

```json theme={null}
{
  "name": "processed_file",
  "type": "FILE",
  "description": "Processed file output"
}
```

### API Response

```json theme={null}
{
  "name": "api_response",
  "type": "OBJECT",
  "properties": {
    "status": {
      "type": "STRING",
      "description": "Response status"
    },
    "data": {
      "type": "OBJECT",
      "description": "Response data"
    }
  }
}
```

## Common Use Cases

### 1. PDF Generation

```json theme={null}
{
  "name": "Generate PDF",
  "provider": "pdf",
  "tool_name": "writer",
  "tool_id": 12,
  "input_parameters": [
    {
      "name": "html_content",
      "type": "STRING",
      "description": "HTML content for PDF",
      "required": true
    },
    {
      "name": "filename",
      "type": "STRING",
      "description": "Output filename",
      "required": true
    }
  ],
  "expected_output": [
    {
      "name": "pdf_url",
      "type": "STRING",
      "description": "URL of generated PDF"
    }
  ]
}
```

### 2. CSV Processing

```json theme={null}
{
  "name": "Process CSV",
  "provider": "csv",
  "tool_name": "processor",
  "tool_id": 34,
  "input_parameters": [
    {
      "name": "csv_data",
      "type": "ARRAY",
      "description": "CSV data to process",
      "required": true
    }
  ],
  "expected_output": [
    {
      "name": "processed_data",
      "type": "ARRAY",
      "description": "Processed CSV data"
    }
  ]
}
```

## Integration Configuration

### Tool Setup

```json theme={null}
{
  "provider": "provider_name",
  "tool_name": "tool_name",
  "tool_id": 123,
  "org_integration_id": 456
}
```

### Authentication

```json theme={null}
{
  "auth_type": "oauth|apikey|basic",
  "credentials": {
    "key": "value"
  }
}
```

## Best Practices

### 1. Tool Selection

✅ **Do**:

* Choose appropriate provider
* Verify tool capabilities
* Check authentication requirements
* Test integration thoroughly

❌ **Don't**:

* Use deprecated tools
* Ignore rate limits
* Skip error handling

### 2. Input Configuration

✅ **Do**:

* Validate input formats
* Document requirements
* Handle file types correctly
* Set appropriate timeouts

❌ **Don't**:

* Skip validation
* Ignore size limits
* Use hardcoded credentials

## Error Handling

### Common Errors

1. Authentication Failures
2. Rate Limiting
3. Invalid Input
4. Network Issues

### Error Policy

```json theme={null}
{
  "error_policy": "RAISE|IGNORE|RETRY",
  "max_retries": 3,
  "retry_delay": 60
}
```

## Provider-Specific Examples

### PDF Provider

```json theme={null}
{
  "provider": "pdf",
  "tool_name": "writer",
  "input_parameters": [
    {
      "name": "template",
      "type": "STRING",
      "description": "PDF template"
    },
    {
      "name": "data",
      "type": "OBJECT",
      "description": "Template data"
    }
  ]
}
```

### Drive Provider

```json theme={null}
{
  "provider": "drive",
  "tool_name": "file_manager",
  "input_parameters": [
    {
      "name": "file_id",
      "type": "STRING",
      "description": "Drive file ID"
    }
  ]
}
```

## Integration Flow

```mermaid theme={null}
graph TD
    A[Input Data] --> B[App Task]
    B --> C[External Tool]
    C --> D[Process Result]
    D --> E[Output Data]
```

## Common Issues and Solutions

| Issue | Solution |
| - | - |
| Authentication Failed | Verify credentials and permissions |
| Rate Limit Exceeded | Implement backoff strategy |
| Invalid Input Format | Validate input before processing |
| Tool Unavailable | Check tool status and fallback |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.