# 触发器 · webhook

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

`trigger: { type: "webhook" }`

输入请求的源头开始运行, 输入内容就会变成输入。 输入内容并非您信任的触发点 。

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}}" } }
```

## 输入来自外部 {#untrusted}

> **把它当作数据, 绝不作为指示**
>
> 达到模型提示的机体是您指令中其他人的文字。 说一下该用它做什么 —— “ 分类 ” , “ 提取字段 ” , 而不是让内容设置任务 。

## 自己校验形状 {#shape}

没有什么能保证有田地存在。 `condition` 早期一步在链条中,检查你需要的东西是否存在, 将错误的调用转换成分支, 而不是失败的五个步骤之后 。

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

## 批准规则适用 {#approval}

发出、发布或写 DNS 需要a `human` 上上一步,没有定义的定义被拒绝。

## 量是成本 {#volume}

每一个到达的电话都是一次运行,每次运行的成本都与其步骤的成本有关。 将廉价的支票放在首位 — — 一种条件是模型电话是免费的,另一种方式不是。

- [条件条件条件](/zh/sdk/workflows/steps/condition): 检查到什么了
- [人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人](/zh/sdk/workflows/steps/human): 批准

```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"}}
```
