Start a workflow via REST call

cancel
Showing results for 
Search instead for 
Did you mean: 
mangar
Established Member II

Start a workflow via REST call

Jump to solution

Real simple,  or should be,  but how do I start a workflow via REST? I have tried to POST to

/alfresco/service/api/workflow-instances/{workflow-id}
/alfresco/service/api/workflow-definitions/{workflow-id}

Both to no avail.  

And is ther a better API reference than this:

https://hub.alfresco.com/t5/alfresco-content-services-hub/workflow-rest-api/ba-p/290146 

1 Solution

Accepted Solutions
narkuss
Established Member II

Re: Start a workflow via REST call

Jump to solution

Hi,

You should send a POST call to <alfresco-url>/alfresco/api/-default-/public/workflow/versions/1/processes.

If you go to <alfresco-url>/api-explorer, you will see all available endpoints and their explanation. Select "workflow API" from the dropdown at the top. 

An example body could be:

{
  "processDefinitionKey": "string",
  "variables": {
    "bpm_assignee": "string",
    "bpm_sendEMailNotifications": true,
    "bpm_workflowPriority": 0
  }
}

Hope it helps

 

 

View solution in original post

5 Replies
narkuss
Established Member II

Re: Start a workflow via REST call

Jump to solution

Hi,

You should send a POST call to <alfresco-url>/alfresco/api/-default-/public/workflow/versions/1/processes.

If you go to <alfresco-url>/api-explorer, you will see all available endpoints and their explanation. Select "workflow API" from the dropdown at the top. 

An example body could be:

{
  "processDefinitionKey": "string",
  "variables": {
    "bpm_assignee": "string",
    "bpm_sendEMailNotifications": true,
    "bpm_workflowPriority": 0
  }
}

Hope it helps

 

 

EddieMay
Alfresco Employee

Re: Start a workflow via REST call

Jump to solution

Hi @mangar 

There is the Activiti github examples that might be useful.

HTH,

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!
mangar
Established Member II

Re: Start a workflow via REST call

Jump to solution

Thanks for the link!  I will us that a lot I am sure.  but I was after the REST api.

mangar
Established Member II

Re: Start a workflow via REST call

Jump to solution

@narkuss 

That worked and I am unblocked so thank you.  But I go to the api-exporer,  and there is nothing on processes.  I do a full text search on "processes"  and I get nothing.  Nothing on "workflow"  either.  How is there not one place a developer can go and get all the REST apis?

EddieMay
Alfresco Employee

Re: Start a workflow via REST call

Jump to solution

Hi @mangar 

Have you tried the public API explorer? Authentication is admin/admin.

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!