Skip to content

Task Due Date

Within a workflow definition, a task definition can be given with a due date. The due date takes the form of a liquid expression enclosed within {{ }} and are evaluated upon the task's instantiation. More details about liquid available here. The due dates are presented in two views which supports furnishing the information.

UI view

The UI view consists of input fields to capture the base date and then additional options to increments or round up to a desired date/time. It provides the following option

  • The first row of fields support specifying the base date. It can be specified as "now" which would be the date/time when the task gets instantiated. The other option is to specify a date/time the user prefers.
  • The second row of fields provides options to supply increments by months, weeks, days, hours and minutes.
  • The third row of field provides options to rounding to the next month, weekday, hour or a day of the week.

To note:

  • When the task gets instantiated, the due date is derived by first applying any increments to the base date and secondly by applying the rounding.
  • If multiple rounding options are selected, they are applied in the order in which they were selected.

Code view

The Code view is an alternative view to express the selection that was done in the UI view and to also customize or apply a more advanced configuration that can be done using the UI view.

To note:

  • The due date expression takes the form of a liquid expression enclosed within
  • If a fixed date/time is required, it can be specified in the format "YYYY-MM-DDTHH:mm:ss" or "YYYY-MM-DD HH:mm:ss" (without the time separator)
  • When the liquid expression gets modified, the system tries to refresh the UI view according to the changes. If unsuccessful, it disables the UI view.
  • The custom liquid filter to increment is plus_time and comes with named arguments and their corresponding values. One filter can be used to specify multiple options.
  • The custom liquid filter to applying rounding is round_to_next and can only one value at a time. Hence separate filters are to be used to specify multiple options in the desired order.

Some example expressions are as follows:

liquid
{{ 'now' | round_to_next: 'weekday' }}
{{ 'today' | round_to_next: 'SUNDAY' }}
{{ '2020-10-05T12:34:56.0000000Z' | plus_time: months: 1, days: 1, hours: 2 }}
{{ '2020-10-05 12:34:56' | plus_time: days: 1, months: 1, hours: 1 | round_to_next: 'weekday' }}

Changing due date using a mutation

Due dates can also be updated in a mutation, either using the same kind of expression as described above, or by adding time to the current due date.

liquid
{{ task.ActivityContext.Due | plus_time: hours: 1 }}