K2 Workflow (Preview)

K2 Workflow (Preview)

Use the K2 Workflow API service to remotely work with workflows and tasks.

Throttling Limits

Name Calls Renewal Period
API calls per connection 100 60 seconds

Creating a connection

To connect your account, you will need the following information:

K2 URL
string
Your K2 URL (Example: https://[K2ID].onk2.com).
Username
securestring
The username for this api
Password
securestring
The password for this api

Actions

Action Task

Performs a workflow action.

Required Parameters

Serial Number
string
The serial number of the task. Ex: 1234_5678
Custom Action
string
The task action, defined by the workflow.

Optional Parameters

XML Field Name
string
The name of an XML field.
XML Field Value
string
The value of the XML field.

Assign Task

Assigns a task to the current user.

Required Parameters

Serial Number
string
The serial number of the task. Ex: 1234_5678

Finish Server Event

Send a finish response to an async server task awaiting a response

Required Parameters

Server Event Serial Number
string
The serial number of the server event. Ex: 1234_5678

Optional Parameters

XML Field Name
string
The name of an XML field.
XML Field Value
string
The value of the XML field.

Get Server Event

Gets a server event by serial number.

Required Parameters

Server Event Serial Number
string
The serial number of the server event. Ex: 1234_5678.

Returns

Get Task

Gets a task by serial number.

Required Parameters

Serial Number
string
The serial number of the task. Ex: 1234_5678

Returns

Body
Task

Get Task Actions

Gets a list of actions for the task.

Required Parameters

Serial Number
string
The serial number of the task. Ex: 1234_5678

Returns

Get Tasks

Obtain a list of tasks available to the connected user.

Optional Parameters

All, Allocated, Sleeping, SharedFrom, SharedTo
string
Returns list of tasks for the connected user.

Returns

Get Workflow

Gets a workflow definition by ID.

Required Parameters

Workflow ID
integer
The ID of the workflow.

Returns

Get Workflows

Get a list of available workflows.

Optional Parameters

Workflow Type
string
The type of workflow. Startable or Owned.

Returns

Redirect Task

Sends a task to another person.

Required Parameters

Serial Number
string
The serial number of the task. Ex: 1234_5678
Redirect Information
string
The person to whom the task is redirected.

Release Task

Releases a task.

Required Parameters

Serial Number
string
The serial number of the task. Ex: 1234_5678

Sleep Task

Sleeps a task for a duration, either number of seconds or until a date.

Required Parameters

Serial Number
string
The serial number of the task. Ex: 1234_5678

Optional Parameters

Sleep For
integer
The number of seconds to sleep a task.
Sleep Until
date-time
The date and time to wake the task. Format: yyyy-MM-ddTHH:mm:ss:fffZ UTC

Start Workflow

Creates and starts a new workflow instance.

Required Parameters

Workflow ID
integer
Specify a workflow ID to start instance.
Workflow Instance Details
dynamic
Send workflow instance object to start workflow.

Returns

integer

Wake Task

Awakens a sleeping task.

Required Parameters

Serial Number
string
The serial number of the task. Ex: 1234_5678

Definitions

ServerEventDataResponse

Server Event Activity Data Fields
object
The data fields of the activity.
Server Event Activity Destination ID
integer
The activity instance destination ID of the server event.
Server Event Activity Instance ID
integer
The activity instance ID of the server event.
Server Event Activity Name
string
The activity name of the server event.
Server Event Activity XML Fields
array of UserDefinedXmlField
The XML fields of the activity.
Server Event Event Description
string
The event description of the server event.
Server Event Event Name
string
The event name of the server event.
Server Event Item References
object
The item references of the workflow instance.
Server Event Item References String
string
String representing the item references of the workflow instance.
Server Event Serial Number
string
The serial number of the server event. Ex: 1234_5678
Server Event Workflow Category
string
The category of the workflow associated with the server event.
Server Event Workflow Data Fields String
string
String representaation of the data fields of the Workflow Instance.
Server Event Workflow Display Name
string
The display name of the workflow associated with the server event.
Server Event Workflow Folio
string
The folio of the workflow instance associated with the server event.
Server Event Workflow ID
integer
The ID of the workflow associated with the server event.
Server Event Workflow Instance ID
integer
The instance ID of the workflow associated with the server event.
Server Event Workflow Name
string
The name of the workflow associated with the server event.
eventInstance
EventInstanceWrapper
originator
User
viewFlowURL
string

EventInstance

Event Instance Description
string
Description of the event instance.
Event Instance Expected Duration
integer
Expected duration of the event instance.
Event Instance ID
integer
ID of the event instance.
Event Instance Metadata
string
Metadata for the event instance.
Event Instance Name
string
Name of the event instance.
Event Instance Priority
integer
Priority of the event instance.
Event Instance Start Date
date-time
Date and time the event instance started.

UserDefinedXmlField

XML Field Name
string
The name of an XML field.
XML Field Value
string
The value of the XML field.

TasksResponse

Task Count
integer
The count of tasks returned.
Tasks
array of TaskLite
One or more tasks.

TaskLite

Task Activity Destination ID
integer
The activity instance destination ID of the task.
Task Activity Name
string
The activity name of the task.
Task Event Description
string
The event description of the task.
Task Event Name
string
The event name of the task.
Task Form URL
string
The form URL of the task.
Task Instance ID
integer
The activity instance ID of the task.
Task Instructions
string
The instructions associated with the task.
Task Priority
integer
The priority of the task.
Task Serial Number
string
The serial number of the task. Ex: 1234_5678
Task Sleep Duration
date-time
The date and time when the task will wake.
Task Start Date
date-time
The start date of the task.
Task Status
string
The status of the task. Ex: Open, Completed, Sleep, Allocated, Available
Task View Flow URL
string
The View Flow URL of the task.
Task Workflow Category
string
The category of the workflow associated with the task.
Task Workflow Display Name
string
The display name of the workflow associated with the task.
Task Workflow Folio
string
The folio of the workflow instance associated with the task.
Task Workflow ID
integer
The ID of the workflow associated with the task.
Task Workflow Instance ID
integer
The instance ID of the workflow associated with the task.
Task Workflow Name
string
The name of the workflow associated with the task.
actions
TaskActionsResponse
originator
User

User

User Display Name
string
Display name of the person.
User Email
string
Email address of the person.
User FQN
string
Fully qualified name of the person. Ex: bob@denallix.com, K2:Denallix\Bob
User Manager
string
Manager of the person.
User Name
string
User name of the person.

TaskActionsResponse

Batchable Actions
array of string
List of actions that can be taken without assigning the task.
Nonbatchable Actions
array of string
List of actions that cannot be taken without assigning the task.
System Actions
array of string
List of system actions.

Task

Task Activity Data Fields
object
The data fields of the activity.
Task Activity Name
string
The activity name of the task.
Task Destination ID
integer
The activity instance destination ID of the task.
Task Event Description
string
The event description of the task.
Task Event Name
string
The event name of the task.
Task Form URL
string
The form URL of the task.
Task Instance ID
integer
The activity instance ID of the task.
Task Item References
object
The item references of the workflow instance.
Task Item References String
string
String representing the item references of the workflow instance.
Task Priority
integer
The priority of the task.
Task Serial Number
string
The serial number of the task. Ex: 1234_5678
Task Sleep Duration
date-time
The date and time when the task will wake.
Task Start Date
date-time
The start date of the task.
Task Status
string
The status of the task. Ex: Open, Completed, Sleep, Allocated, Available
Task View Flow URL
string
The View Flow URL of the task.
Task Workflow Category
string
The category of the workflow associated with the task.
Task Workflow Data Fields
object
The data fields of the workflow instance.
Task Workflow Data Fields String
string
String representaation of the data fields of the Workflow Instance.
Task Workflow Display Name
string
The display name of the workflow associated with the task.
Task Workflow Folio
string
The folio of the workflow instance associated with the task.
Task Workflow ID
integer
The ID of the workflow associated with the task.
Task Workflow Instance ID
integer
The instance ID of the workflow associated with the task.
Task Workflow Name
string
The name of the workflow associated with the task.
Task Workflow XML Fields
array of UserDefinedXmlField
The XML fields of the workflow instance.
actions
TaskActionsResponse
instruction
string
originator
User

WorkflowLabelsResponse[WorkflowLabel]

Item Count
integer
The number of workflows.
Workflows
array of WorkflowLabel
A list of workflows.

WorkflowLabel

Workflow Default Version
integer
The default workflow version.
Workflow Folder
string
The workflow folder.
Workflow ID
integer
The ID of the workflow.
Workflow Name
string
The workflow name.
Workflow System Name
string
The workflow system name.

WorkflowDataResponse

Workflow Schema
string
The schema of the workflow.
workflowInfo
WorkflowDefinition

WorkflowDefinition

Workflow Description
string
The description of the workflow.
Workflow Expected Duration
integer
The expected duration of the workflow.
Workflow Folder
string
The folder (category) of the workflow.
Workflow Name
string
The name of the workflow.
Workflow System Name
string
The system name of the workflow.

EventInstanceWrapper

Event Instance Description
string
Description of the event instance.
Event Instance Expected Duration
integer
Expected duration of the event instance.
Event Instance ID
integer
ID of the event instance.
Event Instance Metadata
string
Metadata for the event instance.
Event Instance Name
string
Name of the event instance.
Event Instance Priority
integer
Priority of the event instance.
Event Instance Start Date
date-time
Date and time the event instance started.
EventInstance
EventInstance