Schedule JOB via POST request

I want to schedule a job from outside KNIME-Server using POST requests.
From the KNIME documentation I know that this is possible (second entry):

What is my idea: I uploaded a Workflow to the server and the workflow has to 2 configuration nodes, that can be configured in the workflow execution window under Configuration options.
image
With a respective GET request I can read the default values:

https:…knime/rest/v4/repository/{path}:configuration

giving me:
{
“Titel-803”: {
“label”: “Test1”,
“type”: “string”,
“default”: “Kanal1
},
“Messeinheit-810”: {
“label”: “Test1”,
“type”: “string”,
“default”: “Messung1
}
}
So far so good!

Now I want to schedule this workflow, but change the configuration let’s say to:
Kanal2” and “Messung2
Since I am not very familiar with GET, POST JSON etc., my idea is to use the GET Body (as JSON), make it a POST and include the new configuration dialogue.

This is (part of) the GET request of my Workflow:



“discardAfterSuccessfulExec”: true,
“discardAfterFailedExec”: false,
“workflowConfiguration”: {}
}
],
“executionRetries”: 0,
“spaceVersion”: null,
“user”: “user_name”,
“configuration”: {}
}
}
},
“scheduledJobs”: [ ],
@namespaces”: {
“knime”: {
“name”: “Open for Innovation | KNIME
}
}
}

I highlited the configuration part because I think, that I have to add it here? Can you help me finish this?

Best wishes

Hi @EngiP3,

You should be able to either create or update an existing schedule via the following REST API calls:

To create a schedule:

POST /rest/v4/repository/<wf>:scheduled-jobs
 {
 ....
 "configuration": {
   "Messeinheit-810": "Messung2",
   "Titel-803": "Kanal2"
 },
 ....
}

or for updating schedule:

PUT /rest/v4/scheduled-jobs/<job-id>
 {
 ....
 "configuration": {
   "Messeinheit-810": "Messung2",
   "Titel-803": "Kanal2"
 },
 ....
}

It might be useful to create a Schedule manually first and then have a look at all the schedules jobs and the specific one via

GET /rest/v4/scheduled-jobs
GET /rest/v4/scheduled-jobs/{uuid}

to get an overview of the configuration options.

For more information check this blog article and the follow ups: The KNIME Server REST API | KNIME

Hope this helps you,
Best,
Michael

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