# {{ display_name }}

{{ description }}

## Overview

This webhook handler automation processes incoming webhook events through
validation, processing, and response stages.

## Supported Event Types

- `created` - Resource creation events
- `updated` - Resource update events
- `deleted` - Resource deletion events
- `triggered` - Manual trigger events

## Handler Stages

1. **Validate** - Validate incoming webhook data and event type
2. **Process** - Handle the event based on its type
3. **Respond** - Generate appropriate response for the caller

## Installation

```bash
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```

## Usage

### Local Development

```bash
# Run the automation
torivers run --input sample_input.json

# Run tests
torivers test

# Validate before submission
torivers validate
```

### Input Schema

```json
{
  "event_type": "created",
  "payload": {
    "id": "123",
    "data": {...}
  },
  "headers": {},
  "timestamp": "2024-01-01T00:00:00Z"
}
```

### Output Schema

```json
{
  "processed": true,
  "event_id": "uuid",
  "actions_taken": ["action1", "action2"],
  "response": {
    "status": "success",
    "code": 200,
    "message": "Event processed successfully"
  }
}
```

## Project Structure

```
{{ name }}/
├── automation.yaml    # Automation manifest
├── main.py            # Main automation class
├── state.py           # State definition
├── nodes/
│   ├── __init__.py
│   ├── validate.py    # Event validation
│   ├── process.py     # Event processing
│   └── respond.py     # Response generation
├── tests/
│   ├── __init__.py
│   └── test_automation.py
├── .gitignore
├── requirements.txt
├── README.md
└── sample_input.json
```

## Development

1. Add supported event types in `nodes/validate.py`
2. Implement event handlers in `nodes/process.py`
3. Customize response format in `nodes/respond.py`
4. Add tests in `tests/test_automation.py`

## Author

{{ author_name }} <{{ author_email }}>
