Obsolete Pages{{Obsolete}}
The official documentation is at: http://docs.alfresco.com
This page provides details on the workflow REST API being introduced in the 3.4 release. The page covers the design for the whole API but only a subset has been implemented in this release, mainly driven by the requirements of the new advanced workflow features added to Share.
The URLs that have not been implemented are clearly marked in each individual section.
JSON will be used for payloads throughout the API.
{
'filePath': string
}
or
{
'nodeRef': string
}
Notes:
{
'workflowDefinitionId': string
'packageContainer': string
'packageContents':
[
string,
string,
...
],
'properties':
{
'key': string, boolean, number, array or map,
...
}
}
Notes:
{
'key': string, boolean, number, array or map,
...
}
{
'transition':
{
'id': string,
'package':
{
'added':
[
string,
string,
....
],
'removed':
[
string,
string,
....
]
},
'properties':
{
'key': string, boolean, number, array or map,
...
}
}
}
{
'event':
{
'id': string,
'package':
{
'added':
[
string,
string,
....
],
'removed':
[
string,
string,
....
]
},
'properties':
{
'key': string, boolean, number, array or map,
...
}
}
}
TODO
{
'id': string,
'url': string,
'name': string,
'title': string,
'description': string,
'version': string
}
{
'id': string,
'url': string,
'name': string,
'title': string,
'description': string,
'version': string,
'startTaskDefinitionUrl': string,
'startTaskDefinitionType': string,
'taskDefinitions':
[
{
'url': string,
'type': string
},
...
]
}
{
'id': string,
'url': string,
'name': string,
'title': string,
'description': string,
'isActive': boolean,
'startDate': string,
'endDate': string,
'dueDate': string,
'priority': number,
'message': string,
'context': string,
'package': string,
'initiator':
{
'userName': string,
'firstName': string,
'lastName': string
},
'definitionUrl': string
}
Notes:
{
'id': string,
'url': string,
'name': string,
'title': string,
'description': string,
'isActive': boolean,
'startDate': string,
'endDate': string,
'dueDate': string,
'priority': number,
'message': string,
'context': string,
'package': string,
'initiator':
{
'userName': string,
'firstName': string,
'lastName': string
},
'definitionUrl': string,
'diagramUrl': string // 4.0 onwards
'startTaskInstanceId': string,
'definition':
{
'id': string,
'url': string,
'name': string,
'title': string,
'description': string,
'version': string
'startTaskDefinitionUrl': string,
'startTaskDefinitionType': string,
'taskDefinitions':
[
{
'url': string,
'type': string
},
...
]
},
'tasks':
[
{
'id': string,
'url': string,
'name': string,
'title': string,
'description': string,
'state': string (IN_PROGRESS|COMPLETE),
'path': string,
'isPooled': boolean,
'isEditable': boolean,
'isReassignable': boolean,
'isClaimable': boolean,
'isReleasable': boolean,
'outcome': string,
'owner':
{
'userName': string,
'firstName': string,
'lastName': string
},
'properties':
{
'key': string, boolean, number, array or map,
...
},
'workflowInstance':
{
'id': string,
'url': string,
'name': string,
'title': string,
'description': string,
'isActive': boolean,
'startDate': string,
'endDate': string,
'dueDate': string,
'priority': number,
'message': string,
'context': string,
'package': string,
'initiator':
{
'userName': string,
'firstName': string,
'lastName': string
},
'definitionUrl': string
}
},
...
]
}
Notes:
{
'id': string,
'url': string,
'name': string,
'title': string,
'description': string,
'state': string (IN_PROGRESS|COMPLETE),
'path': string,
'isPooled': boolean,
'isEditable': boolean,
'isReassignable': boolean,
'isClaimable': boolean,
'isReleasable': boolean,
'outcome': string,
'owner':
{
'userName': string,
'firstName': string,
'lastName': string
},
'properties':
{
'key': string, boolean, number, array or map,
...
},
'workflowInstance':
{
'id': string,
'url': string,
'name': string,
'title': string,
'description': string,
'isActive': boolean,
'startDate': string,
'endDate': string,
'dueDate': string,
'priority': number,
'message': string,
'context': string,
'package': string,
'initiator':
{
'userName': string,
'firstName': string,
'lastName': string
},
'definitionUrl': string
}
}
Notes:
{
'id': string,
'url': string,
'name': string,
'title': string,
'description': string,
'state': string (IN_PROGRESS|COMPLETE),
'path': string,
'isPooled': boolean,
'isEditable': boolean,
'isReassignable': boolean,
'isClaimable': boolean,
'isReleasable': boolean,
'outcome': string,
'owner':
{
'userName': string,
'firstName': string,
'lastName': string
},
'properties':
{
'key': string, boolean, number, array or map,
...
},
'workflowInstance':
{
'id': string,
'url': string,
'name': string,
'title': string,
'description': string,
'isActive': boolean,
'startDate': string,
'endDate': string,
'dueDate': string,
'priority': number,
'message': string,
'context': string,
'package': string,
'initiator':
{
'userName': string,
'firstName': string,
'lastName': string
},
'definitionUrl': string
}
'definition':
{
'id': string,
'url': string,
'type':
{
'name': string,
'title': string,
'description': string,
'url': string
},
'node':
{
'name': string,
'title': string,
'description': string,
'isTaskNode': boolean,
'transitions':
[
{
'id': string,
'title': string,
'description': string,
'isDefault': boolean,
'isHidden': boolean
},
...
]
}
}
}
Notes:
{
'id': string,
'typeName': string,
'typeTitle': string
'typeUrl': string
}
{
'id': string,
'type':
{
'name': string,
'title': string,
'description': string,
'url': string
},
'node':
{
'name': string,
'title': string,
'description': string,
'isTaskNode': boolean,
'transitions':
[
{
'id': string,
'title': string,
'description': string,
'isDefault': boolean,
'isHidden': boolean
},
...
]
}
}
Notes:
{
'id': string,
'url': string,
'isActive': boolean,
'workflowInstanceUrl': string,
'node':
{
'name': string,
'title': string,
'description': string,
'isTaskNode': boolean,
'transitions':
[
{
'id': string,
'title': string,
'descirption': string,
'isDefault': boolean,
'isHidden': boolean
},
...
]
}
}
Notes:
{
'url': string,
'name': string,
'error': string,
'dueDate': string,
'pathUrl': string,
'taskInstanceUrl': string
}
Retrieves the latest version of all deployed workflow definitions in the system.
GET /api/workflow-definitions?exclude={exclude?}
Example response data:
{
'data':
[
{
'id' : 'jbpm$2',
'url': 'api/workflow-definitions/jbpm$2',
'name': 'jbpm$wf:adhoc',
'title': 'Adhoc Task',
'description': 'Assign task to colleague'
},
{
'id' : 'jbpm$1',
'url': 'api/workflow-definitions/jbpm$1',
'name': 'jbpm$wf:review',
'title': 'Review & Approve',
'description': 'Review & approval of content'
},
...
]
}
See SimpleWorkflowDefinitionResponse for payload definition.
A workflow definition defines the structure of a workflow, for example, the tasks it contains and what metadata those tasks provide.
Retrieves a specific workflow definition.
NOTE: This URL has not been implemented yet.
GET /api/workflow-definitions/{workflow_definition_id}
Example response data:
{
'data':
{
'id' : 'jbpm$2',
'url': 'api/workflow-definitions/jbpm$2',
'name': 'jbpm$wf:adhoc',
'title': 'Adhoc Task',
'description': 'Assign task to colleague'
'version': '1.0',
'startTaskDefinitionUrl': 'api/classes/wf_submitAdhocTask',
'startTaskDefinitionType': 'wf:submitAdhocTask',
'taskDefinitions':
[
{
'url': 'api/classes/wf_adhocTask',
'type': 'wf:adhocTask'
},
{
'url': 'api/classes/wf_completedAdhocTask',
'type': 'wf:completedAdhocTask'
}
]
}
}
See DetailedWorkflowDefinitionResponse for payload definition.
Deploys a new workflow definition and returns a detailed representation of the newly deployed workflow definition.
NOTE: This URL has not been implemented yet.
POST /api/workflow-definitions
=>WorkflowDefinitionRequest
Example request data:
{
'nodeRef': 'workspace://SpacesStore/19c3c4e6-86f1-4640-ae48-673a39a3ce87'
}
See WorkflowDefinitionRequest for payload definition.
For example response data see the Get Workflow Definition method.
Updates (redeploys) the provided workflow definition and returns a detailed representation of the redeployed workflow definition.
NOTE: This URL has not been implemented yet.
PUT /api/workflow-definitions
=>WorkflowDefinitionRequest
Example request data:
{
'filePath': '/usr/opt/alfresco/uploads/my_process_definition.xml'
}
See WorkflowDefinitionRequest for payload definition.
For example response data see the Get Workflow Definition method.
Removes (undeploys) the provided workflow definition.
NOTE: This URL has not been implemented yet.
DELETE /api/workflow-definitions/{workflow_definition_id}
Retrieves all workflow instances, the returned list can be optionally filtered by the state of the workflow instance, the authority that initiated the workflow instance, the priority and the due and start date.
GET api/workflow-instances?state={active|completed?}&initiator={authority?}&priority={priority?}&dueBefore={isoDate?}&dueAfter={isoDate?}&definitionId={workflow_definition_id?}&
startedBefore={isoDate?}&startedAfter={isoDate?}&completedBefore={isoDate?}&completedAfter={isoDate?}&maxItems={maxItems?}&skipCount={skipCount?}&exclude={exclude?}
Example response data:
{
'data':
[
{
'id': 'jbpm$45',
'url': 'api/workflow-instances/jbpm$45',
'name': 'Adhoc',
'title': 'Adhoc Task (Assign task to colleague)',
'description': 'Assign task to colleague',
'isActive': true,
'startDate': '2010-07-08T22:51:07.000+01:00',
'endDate': null,
'initiator':
{
'userName': 'gavinc',
'firstName': 'Gavin',
'lastName': 'Cornwell'
},
'definitionUrl': 'api/workflow-definitions/jbpm$12'
},
{
'id': 'jbpm$94',
'url': 'api/workflow-instances/jbpm$94',
'name': 'Adhoc',
'title': 'Adhoc Task (Assign task to colleague)',
'description': 'Assign task to colleague',
'isActive': true,
'startDate': '2010-05-15T09:26:09.000+01:00',
'endDate': null,
'initiator':
{
'userName': 'gavinc',
'firstName': 'Gavin',
'lastName': 'Cornwell'
},
'definitionUrl': 'api/workflow-definitions/jbpm$12'
},
....
],
'paging':
{
'totalItems': 145,
'maxItems': 50,
'skipCount': 100
}
}
See SimpleWorkflowInstanceResponse for payload definition.
Retrieves all workflow instances that are based on the specified workflow definition. The returned list can be optionally filtered by the state of the workflow instance, the authority that initiated the workflow instance, the priority and by the due, started and completed dates.
GET /api/workflow-definitions/{workflow_definition_id}/workflow-instances?state={active|completed?}&initiator={authority?}&priority={priority?}&dueBefore={isoDate?}&dueAfter={isoDate?}&
startedBefore={isoDate?}&startedAfter={isoDate?}&completedBefore={isoDate?}&completedAfter={isoDate?}&maxItems={maxItems?}&skipCount={skipCount?}&exclude={exclude?}
For example response data see the Get Workflow Instance Collection method.
Retrieves all active workflow instances that the given node is part of.
GET api/node/{store_type}/{store_id}/{id}/workflow-instances
For example response data see the Get Workflow Instance Collection method.
A workflow instance represents an 'in-flight' workflow.
Retrieves a specific workflow instance, optionally with all the tasks.
GET api/workflow-instances/{workflow_instance_id}?includeTasks={includeTasks?}
Example response data:
{
'data':
{
'id': 'jbpm$45',
'url': 'api/workflow-instances/jbpm$45',
'name': 'jbpm$wf:adhoc',
'title': 'Adhoc Task (Assign task to colleague)',
'description': 'Assign task to colleague',
'isActive': true,
'startDate': '2010-07-08T22:51:07.000+01:00',
'dueDate': '2010-09-09T10:00:00.000+01:00',
'endDate': null,
'priority': 2,
'initiator':
{
'userName': 'gavinc',
'firstName': 'Gavin',
'lastName': 'Cornwell'
},
'context': 'workspace://SpacesStore/19c3c4e6-86f1-4640-ae48-673a39a3ce87',
'package': 'workspace://SpacesStore/19c3c4e6-92f6-2481-fq43-123e56a3ce45',
'diagramUrl: null,
'startTaskInstanceId': 'jbpm$56',
'definition':
{
'id' : 'jbpm$2',
'url': 'api/workflow-definitions/jbpm$2',
'name': 'jbpm$wf:adhoc',
'title': 'Adhoc Task',
'description': 'Assign task to colleague'
'version': '1.0',
'startTaskDefinitionUrl': 'api/classes/wf_submitAdhocTask',
'startTaskDefinitionType': 'wf:submitAdhocTask',
'taskDefinitions':
[
{
'url': 'api/classes/wf_adhocTask',
'type': 'wf:adhocTask'
},
{
'url': 'api/classes/wf_completedAdhocTask',
'type': 'wf:completedAdhocTask'
}
]
},
'tasks':
[
{
'id': 'jbpm$18',
'url': 'api/task-instances/jbpm$18',
'name': 'wf:adhocTask',
'title': 'Adhoc Task',
'description': 'Adhoc Task allocated by colleague',
'state': 'COMPLETED',
'outcome': 'Task Done',
'completedDate': '2010-07-08T22:51:07.000+01:00',
'typeDefinitionTitle': 'Adhoc Task',
'isPooled': false,
'owner':
{
'userName': 'gavinc',
'firstName': 'Gavin',
'lastName': 'Cornwell'
},
'properties':
{
'bpm_description': 'Please have a look at this',
'bpm_percentComplete': 50,
'bpm_priority': 1,
...
}
},
...
]
}
}
See DetailedWorkflowInstanceResponse for payload definition.
Retrieves a diagram representing the current state of a specific workflow instance.
GET api/workflow-instances/{workflow_instance_id}/diagram
NOTE: This URL is available in 4.0 onwards.
Starts a workflow instance and returns a representation of the newly started workflow. By default the first task in the workflow will be signalled to end, to avoid this the autoEndFirstTask parameter can be set to false.
NOTE: These URLs have not been implemented yet.
POST api/workflow-instances?autoEndFirstTask={autoEndFirstTask?}
=> WorkflowInstanceRequest
POST api/workflow-definitions/{workflow_definition_id}?autoEndFirstTask={autoEndFirstTask?}
=> WorkflowInstanceRequest
Example request data:
{
'workflowDefinitionId': 'jbpm$12',
'packageContents':
[
'workspace://SpacesStore/19c3c4e6-86f1-4640-ae48-673a39a3ce87',
'workspace://SpacesStore/19c3c4e6-92f6-2481-fq43-123e56a3ce45'
],
'properties':
{
'bpm_description': 'This is a description of the workflow.',
'bpm_percentComplete': 0,
'bpm_priority': 2,
...
}
}
See WorkflowInstanceRequest for payload definition.
For example response data see the Get Workflow Instance method.
Either cancels or deletes the specified workflow instance. If the force parameter is omitted the workflow instance is cancelled, to delete the workflow instance pass the forced parameter set to true.
DELETE api/workflow-instances/{workflow_instance-id}?forced=true|false
Retrieves all task instances in the system. The list can optionally be filtered by an authority (the task assignee), the task state, priority and due date. The properties to return can also be defined if desired.
GET api/task-instances?authority={authority_id?}&state={in_progress|completed?}&priority={priority?}&pooledTasks={true|false?}&
dueBefore={isoDate?}&dueAfter={isoDate?}&properties={prop1, prop2, prop3...?}&maxItems={maxItems?}&skipCount={skipCount?}&exclude={exclude?}
Example response data:
{
'data':
[
{
'id': 'jbpm$2',
'url': 'api/task-instances/jbpm$2',
'name': 'wf:reviewTask',
'title': 'Review',
'description': 'Review Documents to Approve or Reject them',
'state': 'IN_PROGRESS',
'typeDefinitionTitle': 'Review',
'isPooled': false,
'owner':
{
'userName': 'gavinc',
'firstName': 'Gavin',
'lastName': 'Cornwell'
},
'properties':
{
'bpm_description': 'This is a description of the workflow.',
'bpm_percentComplete': 0,
'bpm_priority': 2,
...
}
},
{
'id': 'jbpm$18',
'url': 'api/task-instances/jbpm$18',
'name': 'wf:adhocTask',
'title': 'Adhoc Task',
'description': 'Adhoc Task allocated by colleague',
'state': 'IN_PROGRESS',
'typeDefinitionTitle': 'Adhoc Task',
'isPooled': false,
'owner':
{
'userName': 'gavinc',
'firstName': 'Gavin',
'lastName': 'Cornwell'
},
'properties':
{
'bpm_description': 'Please have a look at this',
'bpm_percentComplete': 50,
'bpm_priority': 1,
...
}
},
...
],
'paging':
{
'totalItems': 145,
'maxItems': 50,
'skipCount': 100
}
}
See SimpleTaskInstance for payload definition.
Retrieves all task instances belonging to the provided workflow instance. The list of tasks can optionally be filtered by an authority (the task assignee), state, priority and due date. The properties to return can also be defined if desired.
GET api/workflow-instances/{workflow_instance_id}/task-instances?state={in_progress|completed?}&priority={priority?}&
dueBefore={isoDate?}&dueAfter={isoDate?}&properties={prop1, prop2, prop3...?}&maxItems={maxItems?}&skipCount={skipCount?}&exclude={exclude?}
For example response data see the Get Task Instance Collection method.
A task instance represents a step in a workflow.
Retrieves a specific task instance.
GET api/task-instances/{task_instance_id}
Example response data:
{
'data':
{
'id': 'jbpm$2',
'url': 'api/task-instances/jbpm$2',
'name': 'wf:reviewTask',
'title': 'Review',
'description': 'Review Documents to Approve or Reject',
'state': 'IN_PROGRESS',
'path': 'api/task-instances/jbpm$2/paths/jbpm$43-@',
'isPooled': false,
'owner':
{
'userName': 'gavinc',
'firstName': 'Gavin',
'lastName': 'Cornwell'
},
'properties':
{
'bpm_priority': 1,
'bpm_description': 'Please have a look at these'
...
},
'workflowInstance':
{
'id': 'jbpm$94',
'url': 'api/workflow-instances/jbpm$94',
'name': 'Review and Approve',
'title': 'Review and Approve',
'description': 'Review and Approve',
'isActive': true,
'startDate': '2010-05-15T09:26:09.000+01:00',
'endDate': null,
'initiator':
{
'userName': 'gavinc',
'firstName': 'Gavin',
'lastName': 'Cornwell'
},
'definitionUrl': 'api/workflow-definitions/jbpm$98'
}
'definition':
{
'id': 'wf:reviewTask',
'url': 'api/task-definitions/jbpm$8'
'type':
{
'name': 'wf:reviewTask',
'title': 'Review',
'description': 'Review',
'url': 'api/classes/wf_reviewTask'
},
'node':
{
'name': 'review',
'title': 'Review',
'description': 'Review',
'isTaskNode': true,
'transitions':
[
{
'id': 'approve',
'title': 'Approve',
'description': 'Approve',
'isDefault': true,
'isHidden': false
},
{
'id': 'reject',
'title': 'Reject',
'description': 'Reject',
'isDefault': false,
'isHidden': false
}
]
}
}
}
}
See DetailedTaskInstanceResponse for payload definition.
Signals a transition for the specified task instance. This will end the current task and move the workflow to the next task.
NOTE: This URL has not been implemented yet.
POST api/task-instances/{task_instance_id}
=> TransitionRequest
Example request data:
{
'transition':
{
'id': 'approve',
'package':
{
'added':
[
'workspace://SpacesStore/19c3c4e6-86f1-4640-ae48-673a39a3ce87'
],
'removed':
[
'workspace://SpacesStore/19c3c4e6-92f6-2481-fq43-123e56a3ce45'
]
},
'properties':
{
'bpm_description': 'This is a description of the workflow.',
'bpm_percentComplete': 0,
'bpm_priority': 2,
...
}
}
}
See TransitionRequest for payload definition.
For example response data see the Get Task Instance method.
Updates the properties of a specific task and returns a detailed representation of the updated task instance.
Note: Only the task owner or the initiator of the workflow instance the task is part of may update the task properties.
PUT api/task-instances/{task_instance_id}
=> TaskInstanceRequest
Example request data:
{
'bpm_description': 'Please review these documents.',
'bpm_priority': 3
}
See TaskInstanceRequest for payload definition.
For example response data see the Get Task Instance method.
Retrieves all task definitions contained in the specified workflow definition.
NOTE: This URL has not been implemented yet.
GET api/workflow-definitions/{workflow_definition_id}/task-definitions
Example response data:
{
'id': 'wf:reviewTask',
'typeName': 'wf:reviewTask',
'typeTitle': 'Review'
'typeUrl': 'api/classes/wf_reviewTask'
}
See SimpleTaskDefinitionResponse for payload definition.
Retrieves all the workflow paths associated with the specified workflow instance.
NOTE: This URL has not been implemented yet.
GET api/workflow-instances/{workflow_instance_id}/workflow-paths
A workflow path represents a specific point in an 'in-flight' workflow instance.
Retrieves a specific workflow path.
NOTE: This URL has not been implemented yet.
GET api/workflow-instances/{workflow_instance_id}/workflow-paths/{path_id}
Signals a transition or fires an event against the provided workflow path and returns the updated workflow path. A set of properties to update
NOTE: This URL has not been implemented yet.
POST api/workflow-paths/{path_id}
=> TransitionRequest or EventRequest
Retrieves all the timers associated with the provided workflow instance.
NOTE: This URL has not been implemented yet.
GET api/workflow-instances/{workflow_instance_id}/timers
A task query allows a list of task instances that match the provided criteria to be retrieved.
Retrieves a list of task instances matching the provided search criteria.
NOTE: This URL has not been implemented yet.
POST api/task-instances
=> TaskQueryRequest
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.