Skip to content

Commit d15d6cd

Browse files
authored
chore: add relative delays to mapi ref (#798)
1 parent d4115fb commit d15d6cd

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

content/mapi.mdx

+20-2
Original file line numberDiff line numberDiff line change
@@ -802,11 +802,13 @@ Contains all properties of the <a href="#workflowstep-definition">`WorkflowStep`
802802

803803
Must set either `settings.delay_for` or `settings.delay_until_field_path`.
804804

805+
Use both to describe a <a href="/designing-workflows/delay-function#wait-until-a-relative-timestamp">relative delay</a>.
806+
805807
<Attributes>
806808
<Attribute
807809
name="settings.delay_for"
808810
type="object"
809-
description="A duration object that describes how long to wait before proceeding to the next step."
811+
description="A duration object that describes how long to wait before proceeding to the next step. When used in conjunction with `delay_until_field_path`, describes a delay relative to the specified timestamp."
810812
/>
811813
<Attribute
812814
name="settings.delay_for.unit"
@@ -816,7 +818,7 @@ Must set either `settings.delay_for` or `settings.delay_until_field_path`.
816818
<Attribute
817819
name="settings.delay_for.value"
818820
type="number"
819-
description="A non-negative integer."
821+
description="The count of units to delay for. Must be a non-negative integer unless used in conjunction with `delay_until_field_path` (where a negative integer describes a relative delay prior to the specified timestamp)."
820822
/>
821823
<Attribute
822824
name="settings.delay_until_field_path"
@@ -829,6 +831,7 @@ Must set either `settings.delay_for` or `settings.delay_until_field_path`.
829831
<ExampleColumn>
830832

831833
```json title="Delay step"
834+
// Delay for 30 seconds
832835
{
833836
"ref": "delay_1",
834837
"settings": {
@@ -841,6 +844,21 @@ Must set either `settings.delay_for` or `settings.delay_until_field_path`.
841844
}
842845
```
843846

847+
```json title="Delay step with relative delay"
848+
// Delay until 3 days before the appointment time
849+
{
850+
"ref": "delay_1",
851+
"settings": {
852+
"delay_for": {
853+
"unit": "days",
854+
"value": -3
855+
},
856+
"delay_until_field_path": "data.appointment_time"
857+
},
858+
"type": "delay"
859+
}
860+
```
861+
844862
</ExampleColumn>
845863
</Section>
846864

0 commit comments

Comments
 (0)