KNIME Server REST Execution Immediate Return

I’m trying to trigger a long job on KNIME Server via a company httpCall() method. I’m using the ‘execution’ REST API as follows (with the trailing :execution):

'https://my.company.com:8443/knime/rest/v4/repository/Examples/Test%20Workflows%20(add%20your%20own%20for%20databases)/02%20-%20Extract%20System%20and%20Environment%20Variables%20(Linux%20only)%20-%2020140703:execution?reset=true'

It looks like the REST API doesn’t return until the job has completely finished running. Unfortunately, because my job takes so long, the company httpCall() method times out and restarts the call. This results in an endless loop with this job being triggered over and over again.

After snooping the KNIME Server network, I discovered a similar REST API which uses ‘:interactive-execution’. This is what is used when triggering the workflow from the KNIME Server website before monitoring its progress. I tried this, but I think I need to ‘POST’ and my company is only letting me ‘GET’.

'https://my.company.com:8443/knime/rest/v4/repository/Examples/Test%20Workflows%20(add%20your%20own%20for%20databases)/02%20-%20Extract%20System%20and%20Environment%20Variables%20(Linux%20only)%20-%2020140703:interactive-execution?reset=true'

I’d like to trigger the job and then have the REST API return immediately (I don’t care yet about monitoring the job’s progress). Is there another REST API I should be using?

I’m making some progress. I didn’t realize that I needed to first create a job and then use the uuid unique Job ID to execute the workflow. I found the Swagger page. Any good getting started tutorials or videos on how to use REST with KNIME Server?

1 Like

Hello @Edlueze,

there should definitely be enough materials to get you started.

For beginning there is REST API description on KNIME Docs as part of Server User Guide:

https://docs.knime.com/latest/server_user_guide/index.html#rest-api

Then there is also a blog post by @wkhan that focuses on functionality:

Finally there is video on KNIME YouTube channel:
(But be aware. Video is almost 2 years old and things change rapidly so not sure how accurate it is :warning:)

And if you’ll still have issues or questions about best practices you already know where to ask :wink:

Br,
Ivan

4 Likes

Very cool video! I can see so much potential for this!!

1 Like

Hi Edlueze,

I’d also recommend looking at job-pools to increase the throughput. Job-pools will help eliminate the job’s loading time so you should see a faster response. KNIME Server Administration Guide

-Wali Khan

2 Likes