Running Server Side Workflow via REST Endpoint
Hi,
We have a Workflow 5 Server Side Workflow that is working great, but we would now like to automate (via a webhook from another process). I've looked at how the server side workflows are called, but can't find any documentation describing this. Is it supported to call server side workflows via the workflows REST endpoint, and is there some documentation for the process?
From what I can see you first call 'Geocortex/Workflow/service/auth/token/run' with an ArcGIS Portal token to obtain a 'GeoCortex' token, and then submit a job with the token to Geocortex/Workflow/service/job/run that runs the workflow.
This works and I have been able to test from our external service, but I'd like to know if I have followed the steps correctly and this is a supported use for GeoCortex Workflow 5?
Thanks and have a good weekend all,
Andrew
-
Hi Andrew,
Yes, your approach sounds correct.
Also, we will be providing documentation of the Workflow Server REST API in an upcoming version (similar to what we do for Printing and Reporting). In the mean time you can load the attached swagger.json file into any Swagger editor (like https://editor.swagger.io/) to see a preliminary version of the documentation.
--Ryan
0 -
Great thanks Ryan for your reply.
Good to see in Swagger that the API that it will accept webhooks directly from Survey123 (this is what we are doing at the moment but via Integromat). That will really help us being able to link the two together 😀
0 -
@Andrew Kesterton? You can run a server workflow from a survey123 webhook now, although I think we've not yet documented it. It was added in v5.15 (April 2020)
Here's a brief summary of the steps:
- Create and save an empty server workflow
- Sign in to https://survey123.arcgis.com/surveys and create a new survey.
- Edit the Settings of the survey.
- Add a webhook.
- Set the "Payload URL" to `https://server/geocortex/workflow/service/webhook/survey123/{workflowId}?foo=bar` where `{workflowId}` is the ID of your server workflow. Querystring parameters are optional.
- Enable the "Portal info" event data (required for secured workflows), and any other event data you like.
- Save and publish the survey
- Open the live survey
- Open the browser's dev console
- Complete the survey
- Notice the webrequest to the webhook endpoint in the network traffic
- Modify your server workflow to do something useful with the workflow inputs. For example, use `$getWorkflowInputs1.inputs.body` with the Write File activity to write the "body" input to a file. There is also a "queryString" input.
- Rerun the workflow and observe that the body contains the event info from the webhook request from Survey123.
- Disable the "Portal info" event data and confirm that now the workflow must be shared with everyone.
0 -
Ken Lyon Where can we find the swagger documentation for the workflow server rest api? I'd expect it to be here, but can't find anything.
1 -
Berend Veldkamp If you have an on-prem installation, it's here:
https://<your-server>/vertigisstudio/workflow/service/specification1 -
Hello - I am following this youtube video. I got this to work in 2021 but now with a new version of worklow and reporting its failing to work and my portal version changed to 11.1. Do you know if this still can work?
https://www.youtube.com/watch?v=seQiQ1uz3jc
Reporting Version 5.21.2
Workflow Version 5.35.0
Thanks,
Claire
0
Please sign in to leave a comment.
Comments
6 comments