@Kevin Thanks for reaching out.
To create a new workflow in your standard logic app. You can change the kind to Stateless or Stateful as per your requirement and update the trigger/action/output in the request body as per your requirement.
POST
https://management.azure.com/subscriptions/{subscription ID}/resourceGroups/{resource group name}/providers/Microsoft.Web/sites/{logic app name}/deployWorkflowArtifacts?api-version=2018-11-01
Authorization: Bearer <your bearer token>
Request Body:
{"files":{"<<yourworkflowname>>/workflow.json":{"definition":{"$schema":https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#,"actions":{},"contentVersion":"1.0.0.0","outputs":{},"triggers":{"manual":{"inputs":{},"kind":"Http","type":"Request"}}},"kind":"Stateful"}}}
To Update the existing workflow in standard logic app
POST
https://management.azure.com/subscriptions/{subscription ID}/resourceGroups/{resource group name}/providers/Microsoft.Web/sites/{logic app name}/hostruntime/runtime/webhooks/workflow/api/management/workflows/{yourworkflowname}/validate?api-version=2018-11-01
Authorization: Bearer <your bearer token>
Request Body:
{"properties":{"definition":{"$schema":https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#,"actions":{},"contentVersion":"1.0.0.0","outputs":{},"triggers":{"manual":{"inputs":{},"kind":"Http","type":"Request"}}},"kind":"Stateful"}}
The standard logic app is built on top of the azure function app runtime, and it uses the same REST API as azure function. Make sure to add Content-Type as application/json in the header
To get familiar with function REST API you can refer to this document. To get familiar with Azure Management API and generating token refer to this document.
@Kevin Have you tried to do the hard refresh the page? It may take a few seconds to reflect on the change. I will also suggest you to test with another logic app just to confirm if there is no runtime error with your existing logic app. In case you still facing the issue please refer to my private comment so I can review the request to assist you further.
Nevermind it worked, there was a small issue from my end. Thanks!
Useful article, thanks so much.
I would like to confirm that you are indeed able to update a workflow using the 2nd POST. This only appears to validate (a.k.a save) a newly minted workflow. Also very useful if you are deploying the workflows through the file system upload.
Please confirm that workflows can be changed with this method as the API reference doesn't; suggest anything.
Sign in to comment