Widgets not exposed in REST API

Hi all,

We have an application which uses the KNIME Server REST API to retrieve workflow definitions and run them.
Until know we were using Quickforms inputs which are now legacy. Thus we’ve been wanting to switch to using Widgets instead. However, we seem to not be able to extract input parameters from Widget through the REST API, either from the workflow root or in a Component.

Based on this post I thought Widgets would be exposed in the API.

Here is an example workflow that I deployed to our server:
image

And here is the output of the REST :openapi endpoint:

"InputParameters" : {
  "type" : "object",
  "properties" : {
    "string-input-1" : {
      "type" : "string",
      "default" : "",
      "description" : "Enter Description",
      "example" : ""
    }
  }
},

As expected, the Configuration node is not exposed, but neither is the Widget whereas the post says they are meant to be used in Web Portal.

Are we missing something?

Hi @MaxDNG

no neither Widgets nor Configuration nodes are exposed via the REST API. You need to use Container nodes for this. I would recommend the Container Input (Row) it can receive multiple parameters at once.

image

1 Like

You can find an example for this also here

Thanks Iris for the quick reply.

I did try to use Container nodes and for your use-case Container variables work very well.

However on the same topic, I have not been able to properly use the Container Input File node. When I add it, it is not listed in the inputParameters on the :openapi definition. To see it, I need to make a request to :jobs and only then I see it in inputResources. Is there a way to read it from the openapi definition?

Also, on the KNIME Hub it is indicated that a multipart/form-data call must be done, but not to which endpoint. Is it to the /rest/v4/jobs/ path?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.