Select to view content in your preferred language

Workflow Manager REST APIs

727
3
Jump to solution
12-11-2025 05:52 PM
IanTidy-ET
Esri Contributor

I am trying to build a Widget for Experience Builder to integrate with Workflow Manager.

My problem is that I can't figure out how to update the step with the result from the user via the REST API.

I can:

  1. 'Run' a 'Update Job Properties' step via the '/${workflowItemId}/jobs/${encodeURIComponent(selectedJobId)}/action' end point,
  2. Update the Job Properties values via the '/${workflowItemId}/jobs/${encodeURIComponent(selectedJobId)}/update' end point

But when I try to 'Finish' the step, I get a 'WaitingForInfo' response.

{
    "success": false,
    "stepResponses": [
        {
            "stepId": "c764e20c-8d5e-4b1d-b043-9e09e30485d0",
            "status": "WaitingForInfo",
            "statusDescription": "The step is waiting for information"
        }
    ]
}

 It looks like I need to post something to the step itself, but I can't find what in the documentation.

Any help would be greatly appreciated.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JFarmer
Esri Contributor

Hi @IanTidy-ET 

Lets see if I can help get you on track here. To start, I want to go over what's expected. 

When you run an Update Job Properties step (I'm demoing in the web application here for simplicity), you should see both step started and step info required messages

JFarmer_0-1765807105676.png

When you add in your values and send proceed, you should then see these messages below, starting with the step information message which is the update that you sent.

JFarmer_1-1765807160476.png

 

Our WebSocket Message API has the information you're looking for on what to submit to the step. Specifically, this is what you'll need https://developers.arcgis.com/workflow-manager/api-reference/web-sockets/#message-updateJobPropertie...

The updateJob REST API call is specifically for updating a job when you are not running a step. https://developers.arcgis.com/workflow-manager/api-reference/rest/update-job/. In this case, you're running a step and so I would expect that when you send this request, you get an error that the job is currently running. If that's not happening, then we'd want to look into that.

Hope that helps get you going, let me know if you have any further questions.

Jonathan

View solution in original post

3 Replies
JFarmer
Esri Contributor

Hi @IanTidy-ET 

Lets see if I can help get you on track here. To start, I want to go over what's expected. 

When you run an Update Job Properties step (I'm demoing in the web application here for simplicity), you should see both step started and step info required messages

JFarmer_0-1765807105676.png

When you add in your values and send proceed, you should then see these messages below, starting with the step information message which is the update that you sent.

JFarmer_1-1765807160476.png

 

Our WebSocket Message API has the information you're looking for on what to submit to the step. Specifically, this is what you'll need https://developers.arcgis.com/workflow-manager/api-reference/web-sockets/#message-updateJobPropertie...

The updateJob REST API call is specifically for updating a job when you are not running a step. https://developers.arcgis.com/workflow-manager/api-reference/rest/update-job/. In this case, you're running a step and so I would expect that when you send this request, you get an error that the job is currently running. If that's not happening, then we'd want to look into that.

Hope that helps get you going, let me know if you have any further questions.

Jonathan

IanTidy-ET
Esri Contributor

Thanks Jonathon,

I will leave this until the new year, but I now can see the traffic (which I couldn't before).  I had guessed that it was a WebSocket call, but I couldn't find it.

I didn't think about when the WebSocket was being setup, which is when the page initially loads (which makes complete sense), I was looking at the point the form is displayed and the actions of the form.

Thanks Ian.

0 Kudos
IanTidy-ET
Esri Contributor

Thanks to @JFarmer, this is now working.

You need to use the WebSocket, I used the native WebSocket (not the ESRI Notification Manager).  I also used a Node JS Test Harness to debug the WebSocket connection setup and get it stable.  This removed my ArcGIS Experience Builder - Dev configuration from the debugging process.

Some lessons (these may have just been my implementation):

  1. Don't try to subscribe to all jobs, instead load the jobs from a REST call and subscribe to specific jobs.
  2. When updating the Step Information, make sure to Start the step and Stop the step when you have finished.
  3. Don't try to do too much at once (this is more for me 😊), focus on the required functionality.
  4. Use the ArcGIS Workflow Manager UI to help with the messaging patterns and expected payloads (this was super critical).
  5. AI Tools (like CoPilot) are useful, but check that the answer makes sense, and make sure you tell it about key decisions you have made (i.e. to use the native Websocket and not Notification Manager).  Sometimes, you need to tell the AI that it is wrong.
  6. Create a test harness for debugging, once I did this I was able to quickly get everything working , several days of trouble shooting WebSocket closing for no apparent reason was resolved in about 2 hours (all related to trying to subscribe to all jobs).
  7. You only need one WebSocket connection per endpoint, not a separate connection for each Job Id.

Thanks again to Jonathon for getting me on the correct path.

Ian