# השהיה

> משהה את ההרצה לכמה דקות, שעות או ימים, או עד תאריך ושעה, ואז ממשיך.

Source: https://docs.go-lumen.ai/he/reference/steps/delay

## במבט אחד

| מאפיין | ערך |
| --- | --- |
| **שם השלב** | `delay` |
| **משאב** | ClusterStep (`lumen.ai/v1alpha1`) |
| **קבוצה וקטגוריה** | control, logic |
| **קרדיטים** | **0** קרדיטים בכל פעם שהוא מצליח |
| **השפעה חיצונית** | לא |
| **ההתקנה צריכה לספק** | כלום |

## קלט

| מאפיין | ערך |
| --- | --- |
| **צריך** | כלום |
| **מפיק** | כלום |
| **עובד על** | item: מסמך אחד בכל פעם |

״צריך״ ו״מפיק״ הם סוגי נתונים (file, text, fields, email). העורך מציע שלב רק במקום שבו מה שהוא צריך כבר נמצא במסלול. ראו [מסמכים ונתונים](https://docs.go-lumen.ai/he/concepts/how-flows-run.md#documents-and-data).

## פלט

אין פלטים בשם. הצמתים הבאים עדיין רואים את כל מה שהופק קודם במסלול, והשלב מעביר את המסמכים הלאה כמו שהם.

## הגדרות

מגדירים תחת `config:` בצומת של התהליך. הגדרות טקסט יכולות להכיל מצייני מקום כמו `{nodeId.field}`.

| הגדרה | סוג | ברירת מחדל | תיאור |
| --- | --- | --- | --- |
| `mode` | string | `"for"` | Mode is for (an amount of time, the default) or until (a moment). (one of for, until) |
| `amount` | integer |  | Amount and Unit are how long, for Mode for. (minimum 1; maximum 129600) |
| `unit` | string | `"minutes"` | Unit (one of minutes, hours, days) |
| `until` | string |  | Until is the moment to go on at, an RFC 3339 time or a date (the start of that day, UTC), for Mode until. A moment already past does not wait. (maxLength 64) |

ה-JSON Schema המלא של ההגדרות: [delay.schema.json](https://docs.go-lumen.ai/schemas/steps/delay.schema.json).

## דוגמה

```yaml title="config"
amount: 2
mode: for
unit: hours
```

## שימוש בתהליך

צומת שמריץ את `delay` נכנס תחת `spec.nodes` של [Flow](https://docs.go-lumen.ai/he/concepts/how-flows-run.md#the-flow-as-yaml). תנו לו כל מזהה, ורשמו ב-next את מזהי הצמתים הבאים.

```yaml title="flow.yaml"
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
  name: delay-example
  namespace: tenant-acme
spec:
  displayName: "Delay"
  triggers:
    - id: start
      ref: {name: manual-run}
      next: [delay]
  nodes:
    - id: delay
      stepRef: {name: delay}
      config:
        amount: 2
        mode: for
        unit: hours
```
