Hello all, we are doing something similar to @ooobii ’s awesome git hub actions market place item:
Hi Everyone!
I thought I’d share a creation that could prove useful to others. My employer recently developed a need to trigger KNIME Workflows as a step in GitHub actions. To fulfill this need, I’ve created a GitHub action that can call service-deployed workflows!
GitHub: ooobii/execute-knime-hub-workflow-service
Full details on how to utilize this GitHub action are available in the README. Please feel free to open issues for bug fixes or pull requests for improvements! …
This works via sending parameters into the business hub job API and has been working great.
i.e. the javascript snippet for executing the job with parameters from input nodes
var executeJobUrl = new URL( `${baseUrl}/jobs/${jobId}`);
executeJobUrl.searchParams.append('reset', resetWorkflow ? "true" : "false");
executeJobUrl.searchParams.append('async', "true");
executeJobUrl.searchParams.append('timeout', '-1');
var executeJobResponse = await fetch(
executeJobUrl,
{
method: 'POST',
headers: getHeaders(),
body: JSON.stringify(JSON.parse(core.getInput('parameters') ?? "{}"))
}
);
And everything works great. However, it looks like the parameters are tied to the legacy Input nodes which look to be deprecated soon.
How would you do this with the newer configuration and/or widget nodes? I’ve been running around in circles on this one for a bit. I’ve only found references to the configuration nodes and not widget nodes which seem to be the right replacement for the older quick forms. If there is any documentation on this from the business hub side, that would also be fantastic.
Well, apparently you can use configuration parameters with an undocumented api ‘wizardExecution=true’ which is what the KNIME Business Hub uses.
Ex
curl 'http://api.hub.fake.com/jobs?itemVersion=most-recent&workflowUri=*XXXXXXXXXX&wizardExecution=true' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Content-Type: application/json' \
--data-raw '{"actions":[],"executionContext":"xxxxxx","configuration":{"double-input-198":0.4,"string-input-201":"foobar","boolean-input-199":false,"integer-input-200":100,"integer-slider-209":50,"list-box-input-210":"foo\nbar\nbaz\nboo\nfu"}}'
Without wizardExecution=true the job stays in IDLE state.
So now I have two questions:
Is there another way to switch the job from IDLE to EXECUTING
Should I really be using this undocumented API?
Plus the how do I do the same thing with the Widget inputs.
Thanks in advance.