Thank you for your feedback.
Form temporarily unavailable. Please try again or contact docfeedback@servicenow.com to submit your comments.

Wait for a duration flow logic

Log in to subscribe to topics and get notified when content changes.

Wait for a duration flow logic

Use this flow logic to give your users time to act during automated processes or to wait for a specific date and time to complete actions.

Inputs

Input Description
Duration Type
  • Explicit Duration: Type to provide a specific time period, such as 5 minutes.
  • Relative Duration: Type to specify a wait time relates to a duration data pill.
  • Percentage Duration: Type to specify a certain percentage of time duration between the start of the flow logic and specified end time.
    Note: The percentage value must be from 0 through 100 only.
Wait for Set this value manually or select a Duration data pill that uses the data pill picker (Data pill picker).
  • For Explicit Duration: Wait duration in days, hours, minutes, and seconds.
  • For Relative Duration: Wait duration in days, hours, minutes, and seconds before or after a specific time.
    Note: Past dates don't affect the wait duration.
Choose Relative Duration to run the timer for a specific date.
Note: The actual wait duration can vary due to the instance processing time. The flow always waits for the time that you specify for this field, but other work in the queue may add to the wait time.
Wait for Percentage Wait duration as a percentage of the time period between the start of flow logic and specified end time. If you select a past date for the end time, the wait duration is set to 0. This field appears when Percentage Duration is selected from Duration Type.
During the following schedule Schedule that you can select from the [cmn_schedule] table. If you leave this fieldblank, the timer runs without a schedule. For information on creating schedules, see Define a schedule

Outputs

Output Description
Total duration Total time that the flow ran in milliseconds. You can drag this data pill into the duration fields.
End at time/date Date/time that the flow completed. You can drag this data pill into the date/time fields.

Example: Close an incident if it has been in the resolved state for 10 days

In this example, a flow is created to close incidents that have been in the Resolved state for 10 days. Next, a trigger is created when the state of an incident changes to resolved.

Flow trigger.

Example: Wait 10 days after the last update to a record

In this example, the Wait for a Duration flow logic has been added. To create a 10-day wait, the Relative Duration duration type is selected, and the wait period is set for 10 days. Then, the Updated data pill is dragged in for the triggering incident. The flow waits 10 days after the record is updated.

Wait for Duration flow logic.

Example: Update a record after 10 days

In this example, a new action is created after the duration. In this action, the incident state is changed to Closed, and an update is made to the Additional Comments field.

Action used to close the incident.

Example: Wait for a duration of 50% of the time between the start of the flow logic and end date

In this example, when a critical problem is created, a notification email is sent to the relevant manager when 50% of the time between the problem record creation and problem due date has lapsed.

Wait for percentage time duration flow logic.

Relative Duration type

When the duration type is Relative Duration, the flow logic first evaluates the relative date/time, the schedule, and finally, the duration. Schedules and date/times set in the past do not affect the wait duration. This table provides examples of how the flow processes the wait duration in these scenarios.

Duration Setting Relative Date/Time Schedule Effect
Set to 0. None None Duration ends immediately.
Greater than 0. Past date None Duration ends immediately.
Greater than 0. Future date None Flow waits for the date/time, and then waits for the duration.
Greater than 0 Past date Future date Flow waits for schedule, and then waits for the duration.
Greater than 0. Future date Past date Flow waits for the date/time, and then waits for the duration.
Greater than 0. Future date Future date Flow waits for the future date, then for the schedule, and then for the duration.

The timer waits for the next instance of a selected schedule. For example, if you set a schedule for Monday through Friday from 8 a.m. to 5 p.m., and the timer is initiated on Saturday, the timer waits until Monday at 8 a.m. before starting.

Execution details

Figure 1. Execution details for Wait for a duration flow logic
Example execution details for a wait for duration flow.
  1. The header shows the state, start time, and runtime for the flow logic.
    Note: The runtime value in the header only includes the time that is taken to execute the flow logic and does not include the wait duration that is specified in the flow.
  2. The Configuration Details section shows details about the variables that are used by the flow, including the type, configuration, and runtime values for each variable.
Feedback