RemoveCurrentWorkflow API¶
Permanently removes the running workflow from a document. All workflow tasks, task attachments, running workflow steps, and the workflow execution record are deleted. The document's workflow fields are cleared so it can be submitted to a new workflow.
This is a hard delete with no email notifications. To stop a workflow gracefully (with notifications to task assignees), use StopCurrentWorkflow instead.
Endpoint¶
Methods¶
- GET
/srv.asmx/RemoveCurrentWorkflow?authenticationTicket=...&path=... - POST
/srv.asmx/RemoveCurrentWorkflow(form data) - SOAP Action:
http://tempuri.org/RemoveCurrentWorkflow
Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
authenticationTicket |
string | Yes | Authentication ticket obtained from AuthenticateUser. |
path |
string | Yes | Full path of the document whose running workflow should be removed (e.g. /Cabinet/Project/document.pdf). |
Response¶
Success Response¶
Error Response¶
Required Permissions¶
The calling user must be either: - The workflow submitter (the user who submitted the document to the workflow), or - A workflow supervisor for the running workflow.
Anonymous access is not permitted.
Preconditions¶
| Condition | Required |
|---|---|
| Document must exist at the specified path | Yes |
Document must currently be in a workflow (CurrentFlowId > 0) |
Yes |
| No tasks in the workflow may have been both started and finished | Yes |
If any task has both a StartDate and a FinishDate set (i.e., it was completed), the operation is rejected. Use StopCurrentWorkflow if completed tasks are present.
What Happens on Success¶
- All workflow task attachments linked to the running workflow are deleted.
- All workflow tasks (IRTASKS) belonging to the running workflow are deleted.
- All running workflow steps (RUNNINGWFSTEPS) are deleted.
- The running workflow record (RUNNINGWF) is deleted.
- The document's workflow fields in the PUBLICATION table are cleared (e.g.,
CurrentFlowIdreset to 0). - No email notifications are sent to task assignees or the submitter.
Example¶
GET Request¶
GET /srv.asmx/RemoveCurrentWorkflow
?authenticationTicket=3f7a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c
&path=/Cabinet/ProjectDocs/proposal.pdf
HTTP/1.1
Host: yourserver
POST Request¶
POST /srv.asmx/RemoveCurrentWorkflow HTTP/1.1
Host: yourserver
Content-Type: application/x-www-form-urlencoded
authenticationTicket=3f7a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c&path=/Cabinet/ProjectDocs/proposal.pdf
JavaScript¶
Every call answers XML with HTTP 200, success or not, so success is the thing to branch on and
errorCode is the number to report.
async function call(action, params) {
const response = await fetch(`/srv.asmx/${action}?${new URLSearchParams(params)}`);
const root = new DOMParser()
.parseFromString(await response.text(), 'text/xml')
.documentElement;
if (root.getAttribute('success') !== 'true') {
throw new Error(`${root.getAttribute('errorCode')}: ${root.getAttribute('error')}`);
}
return root;
}
Takes the running workflow off a document. Unlike StopCurrentWorkflow it does not leave it behind
in the history.
await call('RemoveCurrentWorkflow', {
authenticationTicket: ticket,
path: '/Public/Invoices/inv-1001.pdf'
});
Notes¶
- After a successful call, the document is no longer associated with any workflow and can be submitted to a new workflow via SubmitDocumentToFlow.
- This operation is irreversible. All task history for the removed workflow is permanently deleted.
- To check whether a document is currently in a workflow, use GetDocument and inspect the
CurrentFlowIdfield. - If you need to stop a workflow while preserving the ability for assignees to be notified, use StopCurrentWorkflow.
Related APIs¶
- StopCurrentWorkflow -" Stop a running workflow gracefully, with notifications to task assignees.
- SubmitDocumentToFlow -" Submit a document to a workflow.
- GetTask -" Get details of a specific workflow task.
- getTasks -" Get a filtered list of workflow tasks.
- DeleteTask -" Delete a specific task from a running workflow.
Error Codes¶
The errorCode values this operation returns, checked against a running server:
errorCode |
When |
|---|---|
4010 |
the ticket is expired or unknown |
4041 |
no document at that path |
4000 |
the document is not in a workflow |
4030 |
the caller may not change that document |
HTTP 400 |
a required string parameter was empty; refused by model binding, so there is no error document |