# 触发器 · cron

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

`trigger: { type: "cron", cron: "0 8 * * 1" }`

程序在计划上进行,没有人在场 触发因素使得批准规则变得最重要

Status: a cron expression · nobody watching · input comes from the schedule

```javascript
trigger: { type: "cron", cron: "0 8 * * 1" }    // Mondays at 08:00
```

## 保留什么输入 {#input}

不管时间表提供什么条件,都没有人可以通过任何东西。 计划链链需要某个日期,从输入开始计算,而不是从输入中读取。

## 这是人类一步步 挣取其生存的 {#approval}

> **计划运行可发送、 发布或更改 DNS 仅在批准后**
>
> 链条运行,到达人类的脚步,停止等待 — — 无限期地。有人批准它,其他人继续。一个在世界上运行的工作流程,如果它被保存,它就会被拒绝,而没有它。

## 等待运行是一个收件箱 {#waiting}

```javascript
const waiting = (await workflow.runs()).filter((r) => r.data.status === "waiting");

for (const run of waiting) {
  const step = run.data.steps.find((s) => s.status === "waiting");
  console.log(run.id, step.config?.title);
}
```

## 注意重叠 {#overlap}

连锁火速超过尾声的火速计划会造成重叠。 得到批准的一个链可以等待几天,每周的火速计划是排队,而不是循环。

## 单凭日程开支 {#cost}

每起射击都付出了每起步骤的代价, 每次都没有人决定。 `run.data.credits` 设置频繁的日程安排前,横贯横贯运行。

- [人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人](/zh/sdk/workflows/steps/human): 批准
- [runs()](/zh/sdk/ref/workflow/runs): 看见什么被射中了

```python
trigger = {"type": "cron", "cron": "0 8 * * 1"}    # Mondays at 08:00
```

```python
waiting = [r for r in workflow.runs() if r.data["status"] == "waiting"]

for run in waiting:
    step = next(s for s in run.data["steps"] if s["status"] == "waiting")
    print(run.id, (step.get("config") or {}).get("title"))
```
