How to use workflow API

I have a workflow that runs on servers. I want to call the workflow using API.
If I run just the retrieve information (via PowerShell):
Invoke-WebRequest -URI “$serverUrl/api/task-sets” -Method GET -Headers @{“Authorization”= “Bearer $accessToken”} I get 200
but now I want to execute the workflow.
I tried
Invoke-WebRequest -URI “$serverUrl/api/servers/27708/workflow?workflowId=108” -Method PUT -Headers @{“Authorization”= “Bearer $accessToken”}
Invoke-WebRequest -URI “$serverUrl/api/instances/27708/workflow?workflowId=108” -Method PUT -Headers @{“Authorization”= “Bearer $accessToken”}
and in both cases I get the same error
Invoke-WebRequest : The remote server returned an error: (404) Not Found.

Can someone know why?

Make sure you are defining the payload of which phase to run per the apidocs here.

This for example, works for me. (Note: Operational Workflows are a provisioning phase)


I added the taskPhase and customOptions, the error is the same.