Postwork scripts are commonly used to perform tasks after task is completed. This script may be useful for updating databases or generating documents by the user entered data.

Because task is already completed, some operations (example; trying to set an action on a current work item) are invalid at this stage and error is thrown.

Postwork script defined area is reached from a related task. When you click on the "Postwork script" button on the task, postwork script page will open.


In postwork script following objects are available:

Current workitem instance.

Xml data navigator for data model.

Current workflow instance.

Initiator of workflow instance.

A boolean value that specifies the current workflow instance is in test mode.

A number value between 0 to 5 that specifies the priority of workflow instance.

A string value that specifies the initiated culture of workflow instance. (Example: "en" or "de" or "tr")

Translation dictionary that provides localized texts.

Provides methods to query relational database.

Provides methods to access organization database.

Provides methods for time based calculations and working hours calendar.

Provides methods to query non-relational database.

Allows to access domain preferences.

Allows to access defined web services.

Allows to send email messages.

Performs cryptographic and digital signature operations.

Allows to access user delegation library.

Allows to access file repository.

Allows to access document repository. 

Common operations

Updating data model by action

Assigns completion date to Data Model if user selects "Approve" action.

Assign action
if ( $WorkItem.SelectedAction == 'Approve' ) {
   $Xml.SetValue("ApprovedAt", $WorkItem.End );
  • No labels