Updating a draft process with attributes using CS REST API

Hello everyone, we are trying to achieve a Workflow initiation where it has from the beginning attributes filled with data. For example, initiating a WF with the attribute "email" already with a value, to be used in an Email step.

But we can't seem to get the draft process to update.

This is what we've done: created a draft process using the Map ID, based on that we took the draftprocess_id, and then we made a PUT request with this body:

{"draftprocess_id" : 159998,
 "action": "formUpdate",
"values": { "WorkflowForm_2": "email@gmail.ro"}}

We make this request in Postman using body/form-data where we put the body as a key and the JSON above as a value.

This returns the error:

{ "error": "Could not retrieve action"}

In this Workflow Map, we have exactly one WF attribute called email, I have a Start Step with Initiate in Smart View and a form that shows the attribute and it's set on editable.

Also, when we do the GET Request with /v1/forms/draftprocesses/update?draftprocess_id=159998 we get the information about this draft, what is weird is that in this section, we don't see an action with update as a key:

"data": {
    "actions": [
      {
        "key": "Initiate",
        "label": "Start"
      }
    ],

This why we believe we cannot do the update actions on this workflow, why? Do we need to make other configurations/settings in OTCS beforehand?

Thank you!

Comments


  • In case you have WebReports including the WebReport WF extension you may consider starting the WF by calling a WebReport.

  • Hello @Hans_Stoop, we are right now limited to use the Content Server REST API 21.4.

    Making a draft process and updating the Workflow attributes before initiating is exactly what we would need. But it seems that now the PUT request with either "action":"Initiate" or "action":"formUpdate" does return the "Could not retrieve action" error.

    Any chance this is fixable? In the 2020 thread people have managed to achieve this functionality of adding attributes to a Workflow before initiating it.


  • You can call the WR with REST.

    For any fixes you need to contact support.