Create Task workflow activity

The Create Task activity generates a record on any of the tables that extend Task [task].

If the Wait for completion check box is selected, the workflow context waits for a user action on the task, such as Complete or Incomplete, and then progresses based on the user action.

Note: If a workflow contains a Create Task activity that has executed on the current record, additional Create Task activities in the workflow or in subflows cannot create new task records. To create additional tasks in this situation, you can add a Run Script workflow activity activity to the workflow that creates a task with a script.

Results

You can assign a result value using activity.result from within a script field of the activity. By default, the final State value of the task record determines the result value for the Create Task activity. Possible result values are:
  • Closed complete
  • Closed incomplete
  • Closed skipped
  • Deleted
  • Cancelled

Input variables

The following variables determine the behavior of the activity.
Table 1. Create Task activity input variables
Field Description
Create Task Activity Settings

The following fields specify the behavior of the Create Task Activity.

Task type The type of task to create. Select from the corresponding task table for the workflow.
Priority The priority that is assigned to the task.
Wait for completion If selected, the workflow activity waits for the task to complete before continuing. If cleared, the task is created but the workflow proceeds.
Create Task Record Settings

The following fields specify the field values that this activity sets for the task it creates.

Task values from The values used to create the task may either come from:
  • Fields: a predefined set of fields including Fulfillment group, Assigned to, Short description and Instructions.
  • Template: an existing template for the selected task table.
  • Values: values that you specify using a Set Values widget.
Fulfillment group The group that is responsible for completing the task.
Assigned to The user that is responsible for completing the task.
Short description A short description for the task.
Instructions The task instructions for the user to complete prior to closing the task. These instructions appear in the Description field.
Task template

Only appears when Task values from is set to Template.

A template that is used to fill in values for the task.
Set values

Only appears when Task values from is set to Values.

A widget that is used to specify values for any fields of the task.
Advanced
Advanced If selected, the Advanced script is called to allow for additional task values to be set.
Advanced Script Set additional values for the task in this script. Use the variable task when setting additional values. This script is run after the task values are set using the Fields, Template or Values you have specified. For example:

task.short_description = current.short_description;

Task Schedule
Due date based on The due date fields are used to determine the values to use for setting Expected Start Time and Due Date for the task. The type determines how the due date is computed:
  • A user specified duration: The duration is based on a user specified value.
  • A relative duration: The duration is calculated from a relative duration (such as End of Next Business Day).
  • A date/time or duration field: The duration is based on the value of a field on the current record.
  • Script: The duration is returned by a script.
Duration The specific number of days and hours. This field is available only when Due date based on is A user specified duration.
Relative duration The general number and length of business days. This field is available only when Due date based on is A relative duration.
Due date field The date/time or duration field. This field appears when the Due date based on is A date/time or duration field.
Due date script The script that sets 'answer' to the number of seconds for the duration. This field is available only when Due date based on is Script.
Schedule based on The basic schedule the timer uses to count working hours. If a schedule is specified, the duration will only be considered for times that are specified on the schedule. For example, if the duration is 2 hours and the workflow begins at 4:00pm on a schedule that is 8am - 5pm, then it ends at 9:00am the next day. The options are:
  • This workflow's schedule: The schedule uses workflow context date, time, and an optional Time zone based on value.
  • A specific schedule: The schedule uses a pre-defined Schedule and an optional Time zone based on value.
  • A schedule field: The schedule uses a value from a table and an optional Time zone based on value.
Schedule The predefined Schedule from a list. This field available only when Schedule based on is A specific schedule.
Schedule field A date and time or duration field for the schedule, that is associated with the table. Valid fields appear in blue on the Select the element from a tree dialog. This field is available only when Schedule based on is A schedule field.
Time zone based on The time zone for calculating the duration. The time zone may be based on:
  • No time zone: Default. Workflow uses the GMT time zone.
  • A specific time zone: A predefined Time zone.
  • A time zone field: A Time zone field to track time duration from a field on the form.
Time zone The predefined time zone. This field is available only when Time zone based on is A specific time zone.
Time zone field A date and time or duration field for the schedule, that is associated with the table. Valid fields appear in blue on the Select the element from a tree dialog. This field is available only when Time zone based on is A time zone field.

States

The activity state tells the workflow engine what to do with the activity.
Table 2. Create Task activity states
State Description
Executing The workflow engine knows to start the onExecute function of the activity.
Waiting The workflow engine ignores the activity until a specific event to restart the activity is fired.
Finished The activity finished running. See the result value for the outcome of the activity.
Cancelled This activity, or the workflow that contains this activity, was canceled.
Error A JavaScript error occurred. Review the logs for error details.