iii-trigger-schemas

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Trigger Schemas

触发器模式

Use this skill when an agent needs the exact config shape for built-in trigger registrations and the payload shape delivered to handlers.
当Agent需要内置触发器注册的精确配置格式以及传递给处理器的负载格式时,使用此Skill。

HTTP Trigger

HTTP Trigger

Registration config:
json
{
  "api_path": "/orders/:id",
  "http_method": "POST",
  "condition_function_id": "optional::condition"
}
Handler payload:
json
{
  "query_params": {},
  "path_params": {},
  "headers": {},
  "path": "/orders/123",
  "method": "POST",
  "body": {}
}
api_path
must use a leading slash.
注册配置:
json
{
  "api_path": "/orders/:id",
  "http_method": "POST",
  "condition_function_id": "optional::condition"
}
处理器负载:
json
{
  "query_params": {},
  "path_params": {},
  "headers": {},
  "path": "/orders/123",
  "method": "POST",
  "body": {}
}
api_path
必须以斜杠开头。

Cron Trigger

Cron Trigger

Registration config:
json
{
  "expression": "0 0 9 * * * *",
  "condition_function_id": "optional::condition"
}
Handler payload:
json
{
  "trigger": "cron",
  "job_id": "job-id",
  "scheduled_time": "2026-05-19T09:00:00Z",
  "actual_time": "2026-05-19T09:00:00Z"
}
Use
expression
, not
cron
.
注册配置:
json
{
  "expression": "0 0 9 * * * *",
  "condition_function_id": "optional::condition"
}
处理器负载:
json
{
  "trigger": "cron",
  "job_id": "job-id",
  "scheduled_time": "2026-05-19T09:00:00Z",
  "actual_time": "2026-05-19T09:00:00Z"
}
使用
expression
字段,而非
cron

Queue Trigger

Queue Trigger

Registration config:
json
{
  "topic": "payments",
  "condition_function_id": "optional::condition",
  "queue_config": {}
}
Handler payload is the message payload that was enqueued or published for that topic.
注册配置:
json
{
  "topic": "payments",
  "condition_function_id": "optional::condition",
  "queue_config": {}
}
处理器负载即为针对该主题入队或发布的消息负载。

Pub/Sub Subscribe Trigger

Pub/Sub Subscribe Trigger

Registration config:
json
{
  "topic": "orders.created",
  "condition_function_id": "optional::condition"
}
Handler payload is the event payload published to the topic.
注册配置:
json
{
  "topic": "orders.created",
  "condition_function_id": "optional::condition"
}
处理器负载即为发布到该主题的事件负载。

State Trigger

State Trigger

Registration config:
json
{
  "scope": "orders",
  "key": "optional-key",
  "condition_function_id": "optional::condition"
}
Handler payload:
json
{
  "type": "state",
  "event_type": "state:updated",
  "scope": "orders",
  "key": "order-123",
  "old_value": {},
  "new_value": {}
}
event_type
can be
state:created
,
state:updated
, or
state:deleted
.
注册配置:
json
{
  "scope": "orders",
  "key": "optional-key",
  "condition_function_id": "optional::condition"
}
处理器负载:
json
{
  "type": "state",
  "event_type": "state:updated",
  "scope": "orders",
  "key": "order-123",
  "old_value": {},
  "new_value": {}
}
event_type
可以是
state:created
state:updated
state:deleted

Stream Trigger

Stream Trigger

Registration config:
json
{
  "stream_name": "chat",
  "group_id": "room-1",
  "item_id": "optional-item",
  "condition_function_id": "optional::condition"
}
Stream join/leave configs use
stream_name
plus optional
condition_function_id
.
Handler payload contains stream event details such as stream name, group, item, event type, and data. Use
iii-realtime-streams
for worker-backed stream functions, and
iii-channels
for channel refs/binary transport.
注册配置:
json
{
  "stream_name": "chat",
  "group_id": "room-1",
  "item_id": "optional-item",
  "condition_function_id": "optional::condition"
}
流加入/离开配置使用
stream_name
及可选的
condition_function_id
处理器负载包含流事件详情,如流名称、分组、条目、事件类型及数据。基于Worker的流函数请使用
iii-realtime-streams
,通道引用/二进制传输请使用
iii-channels

Log Trigger

Log Trigger

Registration config:
json
{
  "level": "warn"
}
Handler payload contains OpenTelemetry-style log data: timestamp, severity, body, attributes, trace/span IDs, resource attributes, service metadata, and instrumentation scope fields.
注册配置:
json
{
  "level": "warn"
}
处理器负载包含OpenTelemetry风格的日志数据:时间戳、严重级别、内容、属性、跟踪/跨度ID、资源属性、服务元数据及工具范围字段。

Pattern Boundaries

模式边界

  • For registering and invoking functions, prefer
    iii-functions-and-triggers
    .
  • For HTTP endpoint behavior, prefer
    iii-http-endpoints
    .
  • For trigger action modes, prefer
    iii-trigger-actions
    .
  • For custom trigger type authoring lifecycle, prefer
    iii-custom-triggers
    .
  • 若需注册和调用函数,优先使用
    iii-functions-and-triggers
  • 若需了解HTTP端点行为,优先使用
    iii-http-endpoints
  • 若需了解触发器操作模式,优先使用
    iii-trigger-actions
  • 若需自定义触发器类型的创作生命周期,优先使用
    iii-custom-triggers

When to Use

使用场景

  • Use this skill when the task asks for built-in trigger config, handler payload shape, validation schemas, or generated function input types for built-in triggers.
  • 当任务需要内置触发器配置、处理器负载格式、验证模式或为内置触发器生成函数输入类型时,使用此Skill。

Boundaries

边界说明

  • Use
    expression
    for cron config, not
    cron
    .
  • Use leading slashes for HTTP
    api_path
    values.
  • Do not generate removed service APIs or adapter-extension APIs.
  • Cron配置使用
    expression
    字段,而非
    cron
  • HTTP的
    api_path
    值必须以斜杠开头。
  • 请勿生成已废弃的服务API或适配器扩展API。