Configure and run REST deployment endpoint from Business Hub best practices.

I have a simple workflow with Configuration nodes and a single JSON Input Container. I can’t seem to find a rest api where I can use both at the same time, the simple question is whether we should expose the configuration nodes or use the JSON Container to completely define our REST interface.

image

The AD-HOC run of a workflow allows has a nice GUI for all the Configuration nodes, but when executed, it uses the example json in the JSON Container Input and doesn’t allow changes there.

When you create a job using the ad-hoc jobs interface:
https://api.hub.knime.com/api-doc/?service=execution-service

you can send in a new configuration. This is what the Knime UI does.

curl 'http://api.hub.fake.com/jobs?itemVersion=1&workflowUri=*A7AZwSffDkjCh6zw&wizardExecution=true' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Accept-Language: en-US,en;q=0.9' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Origin: http://hub.glysade.com' \
  --data-raw '{"actions":[],"configuration":{"boolean-input-199":false}}' \
  --insecure

This runs, but you can’t seem to send in the input parameters for the json container during an ad-hoc execution.

Unknown keys 'inputParameters' in provided body: valid keys are 'configuration' and 'actions'

conversely, in the execution in the REST api for the deployment, you can only send the json for the input container.

So the question is, for REST best practices, should we ignore configuration nodes and design a new schema? I like the configuration nodes as they already exist and are discoverable, but I may be missing the expected usage for them.

Thanks in advance.

Hi @frenemie

so the configuration nodes are mainly used within components to create a configuration dialogs which behave like with native nodes.
For the use case you show here they can’t be used. The Container input (JSON) is the only input in service workflows that is possible. To make this work and make sure the container can accept input you need to deploy the workflow as a Service on the KNIME Business Hub.

Here you can find an example on how a workflow can look like for a JSON Input.

Does it make sense or did I misunderstand your issue?

Best,
Martyna

That’s what I figured. We have deployed knime workflows as services, it looks like we will need to use the container json example itself to document how the workflow should be called from REST or make a secondary endpoint with the json schema for the workflow. Thanks for your response.

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