KNIME workflow API call - Keep jobs

Hi,

We have started to use the KNIME Rest API functionality to run workflows from other applications. What we have noticed is that those jobs do not get saved when completed. We need to keep the jobs that have been executed via the REST API call. Is there a setting that be configured so that these jobs will be saved the same way a scheduled job can be kept on successful and failure outcomes?

Hi @Willem,

this is possible by using a different set of requests:

  • create job: POST ​/rest​/v4​/repository​/{path}:jobs
    • The response JSON will contain a URL to the job
  • set job properties: PUT ​/rest​/v4​/jobs​/{uuid}
    • Body: {"discardAfterSuccessfulExec": false}
  • execute job: POST ​/rest​/v4​/jobs​/{uuid}

I wanted to build an example as a KNIME workflow, but haven’t found the time – may update this thread in the following days.

Kind regards
Marvin

1 Like

Hi Again,

I figured the second bullet point is not needed, as jobs created in this manner are not deleted by default.
In any case, here is a KNIME workflow that demos the job creation and configuration prior to execution:

Kind regards
Marvin

Thanks Marvin,

Only issue that we are having with the two step process is that the software that is calling the KNIME workflow cannot retrieve responces from the first API call to get the JobID and then call the second API to execute the job. The software only calls an API and can wait for it to complete.

The only workaround that I can think of then is that we need to create a Job that would then go and call the other workflow so that the workflow’s Job can be saved after execution.

Thanks for the responce.

1 Like