Workflow Runtime APIs and Services

This section describes the available APIs and Services that can be used to interact with workflows at runtime.

Technology Available interfaces Typical use and additional notes
Workflow REST API https://[DOMAIN:PORT]/api/workflow/v1/Workflows Use the Workflow REST API to remotely manage workflows and tasks using REST.
https://[DOMAIN:PORT]/api/workflow/v1/Tasks
.NET Assemblies  

K2 provides a rich set of .NET Class Libraries to allow developers to interact with workflows at runtime.

K2 client API .DLLs that you reference (such as HostClientApi.dll, SmartObject.Client.dll and the Workflow client API), are thread safe.
If you open a connection with the API, you should close and dispose of the connection object.
Workflow Client API (SourceCode.Workflow.Client.dll) The workflow Client API enables developers to interact with workflow instances, worklists and workflow items at runtime. Typical uses include starting workflows, retrieving worklist items, completing workflow tasks
Workflow Management API

The workflow management API allows developers to manage and administer workflows on a K2 environment. Typical uses include administration of running workflows, setting workflow permissions, managing workflow versions and redirecting worklist items.

SmartObject Runtime APIs and Services If a workflow has been exposed as a K2 SmartObject, the workflow methods will be exposed as SmartObject methods and can be accessed with the SmartObject Runtime APIs.
The Workflow Web Service (.asmx) http://[servername]/K2Services/ws.asmx?wsdl This service is intended as a legacy-protocol interface. It has been superseded by the WCF and REST services, but it is still available for applications that require an .asmx-based service interface. Typical uses include starting workflows; retrieving worklist items and completing workflow tasks.
Workflow WCF services   The WCF services are intended for use by .NET applications that require a service-based interface for integration. SOA-centric enterprise platforms and applications are ideally suited for this interface.
http://[servername]/K2Services/WCF.svc Start workflows, retrieve worklist items, complete workflow tasks
http://[servername]/K2Services/SyncWCF.svc Synchronous service to start workflows, retrieve worklist items, complete workflow tasks, mostly used for batch-processing
http://[servername]:[port]/SmartObjectServices/wcf/[smartobject] If a workflow has been exposed as a K2 SmartObject, the workflow methods will be exposed as SmartObject methods and can be accessed through the K2 SmartObject WCF services
Workflow REST Services   The REST services are intended for use by applications that require a REST-based interface for integration. Modern applications (especially lightweight clients like Smartphone applications and JavaScript-heavy web pages are ideally suited for REST-based integration since the technology is very lightweight and is easily consumed by any technology that understands common web protocols.
http://[servername]/K2Services/REST.svc Start workflows, retrieve worklist items, complete workflow tasks
http://[servername]/K2Services/SyncREST.svc Synchronous service to start workflows, retrieve worklist items, complete workflow tasks, mostly used for batch-processing
http://[servername]:[port]/SmartObjectServices/rest/[smartobject] If a workflow has been exposed as a K2 SmartObject, the workflow methods will be exposed as SmartObject methods and can be accessed through the K2 SmartObject REST services