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

# Advanced Input Tools

> Advanced input tools for webhooks, Slack events, Twilio SMS, image files, and text files

## Overview

Advanced Input Tools provide specialized input capabilities for handling different types of data sources including webhooks, Slack events, Twilio SMS/MMS, image files, and text files. These tools are essential for building comprehensive workflows that integrate with external systems.

## Key Features

### INPUT\_WEBHOOK

* Receive webhook requests from various services
* Handle HTTP POST requests to your publishable URL
* Parse JSON and form data automatically
* Essential for API integrations

### INPUT\_SLACK\_EVENT

* Receive Slack App event subscriptions
* Handle real-time Slack workspace events
* Process messages, reactions, and user interactions
* Requires Slack App configuration

### INPUT\_IMAGE\_FILE

* Input image files from direct download URLs
* Convert images to base64-encoded strings
* Support for various image formats
* Optimized for AI processing workflows

### INPUT\_FILE\_AS\_TEXT

* Input text files from URLs
* Support for multiple text formats (plain text, CSV, JSON, XML, YAML, HTML)
* Returns the file content as text
* Accepts a single URL or an array of URLs

### INPUT\_TWILIO\_SMS

* Receive incoming SMS and MMS messages via Twilio webhooks
* Supports text messages and media attachments (images, videos, PDFs)
* Requires configuring your Twilio phone number to send webhooks to your Jinba Flow URL
* See the [Twilio page](/en/pages/tools/communication/twilio) for details

## Setup Instructions

**Note**: INPUT\_ tools are crucial for MCP (Model Context Protocol) and API integrations. Their IDs must match exactly in your MCP configuration and API endpoints.

## Example: Webhook Processing Workflow

```yaml theme={null}
- id: receive_webhook
  name: receive_webhook
  tool: INPUT_WEBHOOK
  input:
    - name: description
      value: "Receive order notification from e-commerce platform"
    - name: use_as_input
      value: true

- id: process_order
  name: process_order
  tool: OPENAI_INVOKE
  config:
    - name: version
      value: gpt-4
  input:
    - name: prompt
      value: |
        Process this order data and extract key information:
        {{steps.receive_webhook.result.body}}
        
        Extract: customer info, order items, total amount, shipping details
```

## Example: Slack Event Processing

```yaml theme={null}
- id: slack_listener
  name: slack_listener
  tool: INPUT_SLACK_EVENT
  input:
    - name: description
      value: "Listen for mention events in Slack"
    - name: use_as_input
      value: true

- id: respond_to_mention
  name: respond_to_mention
  tool: SLACK_POST_MESSAGE
  input:
    - name: channel
      value: "{{steps.slack_listener.result.channel}}"
    - name: text
      value: "Thanks for mentioning me! I'll process your request."
```

## Example: Image Analysis Pipeline

```yaml theme={null}
- id: input_image
  name: input_image
  tool: INPUT_IMAGE_FILE
  input:
    - name: value
      value: "https://example.com/image.jpg"
    - name: description
      value: "Product image for analysis"

- id: analyze_image
  name: analyze_image
  tool: GEMINI_INVOKE_WITH_IMAGE
  config:
    - name: version
      value: gemini-1.5-flash
  input:
    - name: prompt
      value: "Analyze this product image and describe its features"
    - name: base64_image
      value: "{{steps.input_image.result}}"
```

## Example: Text File Processing

```yaml theme={null}
- id: input_config_file
  name: input_config_file
  tool: INPUT_FILE_AS_TEXT
  input:
    - name: value
      value: "https://example.com/config.json"
    - name: description
      value: "Configuration file for processing"
    - name: use_as_input
      value: true

- id: parse_configuration
  name: parse_configuration
  tool: PYTHON_SANDBOX_RUN
  input:
    - name: code
      value: |
        import json
        
        # INPUT_FILE_AS_TEXT returns the file content as text
        config = json.loads('''{{steps.input_config_file.result}}''')
        
        print("Configuration loaded:")
        for key, value in config.items():
            print(f"  {key}: {value}")
        
        # Extract specific settings
        database_url = config.get('database_url', 'Not found')
        api_key = config.get('api_key', 'Not found')
        
        print(f"\nDatabase URL: {database_url}")
        print(f"API Key: {'*' * len(api_key) if api_key != 'Not found' else 'Not found'}")

- id: validate_config
  name: validate_config
  tool: CHECKER_CHECK_BY_JSON
  input:
    - name: text
      value: "{{steps.parse_configuration.result.stdout | join(' ')}}"
    - name: task
      value: "Configuration Validation"
    - name: rules
      value: |
        [
          {
            "name": "Database URL present",
            "description": "The configuration must contain a database_url entry with a valid connection URL."
          },
          {
            "name": "API key configured",
            "description": "The configuration must contain a non-empty api_key entry."
          }
        ]
```

## Example: CSV Data Import

```yaml theme={null}
- id: import_csv_data
  name: import_csv_data
  tool: INPUT_FILE_AS_TEXT
  input:
    - name: value
      value: "https://example.com/sales_data.csv"
    - name: description
      value: "Monthly sales data CSV file"

- id: process_csv
  name: process_csv
  tool: PYTHON_SANDBOX_RUN
  input:
    - name: code
      value: |
        import csv
        from io import StringIO
        
        # INPUT_FILE_AS_TEXT returns the file content as text
        csv_content = '''{{steps.import_csv_data.result}}'''
        
        # Parse CSV
        csv_reader = csv.DictReader(StringIO(csv_content))
        rows = list(csv_reader)
        
        print(f"Loaded {len(rows)} rows from CSV")
        print(f"Columns: {', '.join(csv_reader.fieldnames)}")
        
        # Calculate summary statistics
        if 'amount' in csv_reader.fieldnames:
            amounts = [float(row['amount']) for row in rows if row['amount']]
            total = sum(amounts)
            average = total / len(amounts) if amounts else 0
            
            print(f"\nSales Summary:")
            print(f"  Total Sales: ${total:,.2f}")
            print(f"  Average Sale: ${average:,.2f}")
            print(f"  Number of Sales: {len(amounts)}")

- id: generate_report
  name: generate_report
  tool: OPENAI_INVOKE
  config:
    - name: version
      value: gpt-4
  input:
    - name: prompt
      value: |
        Based on the following CSV processing results, generate a sales report:
        
        {{steps.process_csv.result.stdout | join('\n')}}
        
        Please create a markdown report with:
        1. Executive summary
        2. Key metrics
        3. Trends and insights
        4. Recommendations
```

## File Format Support

### INPUT\_FILE\_AS\_TEXT Supported Formats:

* **text/plain**: Plain text files (.txt)
* **text/csv**: Comma-separated values (.csv)
* **text/html**: HTML documents (.html)
* **text/xml**: XML documents (.xml)
* **text/json**: JSON files (.json)
* **text/yaml**: YAML configuration files (.yml, .yaml)

## Use Cases

* **API Integration**: Receive data from external services via webhooks
* **Real-time Processing**: Handle Slack events and notifications
* **Image Processing**: Analyze images with AI models
* **Document Processing**: Handle text files and documents
* **Event-driven Workflows**: Trigger workflows based on external events
