# Trigger · webhook

Canonical URL: https://developers.iagenify.com/sdk/workflows/triggers/webhook/
Language: en

`trigger: { type: "webhook" }`

An inbound request starts a run, and what it carries becomes the input. The trigger where the input is not yours to trust.

Status: an inbound request · input is the body · untrusted by nature

```javascript
trigger: { type: "webhook" }

// A step reads what arrived
{ id: "classify", type: "model.generate", config: {
    model: "gemini-3.5-flash",
    prompt: "Classify this event: {{input.event}}" } }
```

## The input came from outside {#untrusted}

> **Treat it as data, never as instructions**
>
> A body that reaches a model's prompt is somebody else's text inside your instruction. Say what the step should do with it — « classify this », « extract the fields » — rather than letting the content set the task.

## Validate the shape yourself {#shape}

Nothing guarantees a field is there. A `condition` step early in the chain, checking that what you need exists, turns a malformed call into a branch rather than a failure five steps later.

```javascript
{ id: "has_id", type: "condition", config: {
    left: "{{input.id}}", operator: "exists" } }
```

## The approval rule applies {#approval}

An inbound request is the least supervised trigger there is. A chain that sends, publishes or writes DNS from one needs a `human` step upstream, and a definition without it is refused.

## Volume is cost {#volume}

Every call that arrives is a run, and every run costs what its steps cost. Put the cheap checks first — a condition before a model call is free, the other way round is not.

- [condition](/sdk/workflows/steps/condition): Checking what arrived.
- [human](/sdk/workflows/steps/human): The approval.

```python
trigger = {"type": "webhook"}

# A step reads what arrived
{"id": "classify", "type": "model.generate", "config": {
    "model": "gemini-3.5-flash",
    "prompt": "Classify this event: {{input.event}}"}}
```

```python
{"id": "has_id", "type": "condition", "config": {
    "left": "{{input.id}}", "operator": "exists"}}
```
