Wait task definition object
A Wait task (identified by "type": "Wait"
) causes the system to delay the process from continuing for a specified time. The time can be specified as a wait duration, specified in seconds, or an absolute expiry time, specified as an ISO-8601 extended offset date-time format string.
For example, the following Wait task introduces a ten-second delay into a process:
"Wait Ten Seconds" : {
"type": "Wait",
"seconds": 10,
"nextTask": "Next Task"
}
This waits until an absolute time:
"Wait Until" : {
"type": "Wait",
"timestamp": "2016-03-14T01:59:00Z",
"nextTask": "Next Task"
}
The wait duration does not need to be hardcoded. Here is the same example, reworked to look up the timestamp time using a JSONPath expression tothe data, which might look like { "expiryDate": "2016-03-14T01:59:00Z" }
:
"Wait Until" : {
"type": "Wait",
"timestampExpression": "${expiryDate}",
"nextTask": "Next Task"
}
The Wait task has following additional fields:
Field |
Type |
Required |
Description |
---|---|---|---|
|
Integer |
Yes |
The number of seconds to delay the process. |
|
String |
JSONPath expression to lookup reference data for duration in seconds. |
|
|
String |
The absolute time to wait until in ISO-8601 extended offset date-time format string. |
|
|
String |
JSONPath expression to lookup reference data for a future date time in ISO-8601 extended offset date-time format string. |
The JSONPath expression must be inside a placeholder ${ }
. To escape the expression, prefix it with an extra $
character, e.g. $${ }
. See JSONPath for more information about JSONPath.
JSONata expression can also be used instead of JSONPath, prefix the expression with jsonata
, e.g. ${jsonata: }
. See JSONata for more information about JSONata.
To reference workflow input, use ${workflow.input}
.
To reference task input and output, use ${<TASK_NAME>.input}
and ${<TASK_NAME>.output}
respectively.
Here are more examples of acceptable expressions:
-
${workflow.input.waitSeconds}
-
${TaskName.input.waitSeconds}
-
${['Task Name'].output.waitSeconds}
-
${jsonata:$now()}