cancel
Showing results for 
Search instead for 
Did you mean: 

Start a workflow via REST call

mangar
Star Contributor
Star Contributor

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 ACCEPTED ANSWER

narkuss
Star Contributor
Star Contributor

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 answer in original post

5 REPLIES 5

narkuss
Star Contributor
Star Contributor

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

mangar
Star Contributor
Star Contributor

@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
World-Class Innovator
World-Class Innovator

Hi @mangar 

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

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

EddieMay
World-Class Innovator
World-Class Innovator

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
Star Contributor
Star Contributor

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