Disable auto-discarding of job

Hello everybody,

in my workflow i trigger a second workflow via the KNIME Rest Api. However, if something goes wrong, the job disappears from the KNIME Explorer and cannot be opened via the Remote Workflow Editor. I can then no longer investigate where the problem lies in the workflow. How do I prevent the job from disappearing from the KNIME Explorer?

Best Regards
Maaarty

Hi @maaartyN

Are you using the call workflow node? If so, you can tick the image option. This way the job is not discarded if there is an error.

Let me know if this helps!

Best wishes,
Ana

1 Like

Hey, Ana,
thanks for your help, but i use the “post-request node” to trigger the start of the second workflow. Are there similar options for this? At least I didn’t find anything under Preferences.

Best Regards
Marty

Hi MaaartyN,

You can use the call workflow node to do this. It might be easier, using the PUT request automatically discards the jobs. But with the call workflow node you can control the behaviour. Like this: https://hub.knime.com/knime/spaces/Examples/latest/06_Control_Structures/07_Workflow_Orchestration/02_Call_Workflow_and_REST/04_call_workflow_(Table)

You need to use the KNIME Server connector node to make the connection with your KNIME Server, like this: https://hub.knime.com/knime/spaces/Examples/latest/06_Control_Structures/07_Workflow_Orchestration/02_Call_Workflow_and_REST/03_call_server_workflow_(Table)

Best wishes,
Ana

Hi Ana,
the main reason I want to stick to the post-request node is that I can set a timeout inside the node and leave the checkbox "Fail on Connection Problems("timeout etc…) empty. The user, who has logged into the web portal, and started the first Workflow receives the message that the workflow has ended successfully.

The second workflow starts in the background, which the user does not notices. This workflow simply performs a Get-request every 2min, until a specific event is triggered. Afterwards, the user will be notified via the send-email node.

The problem here is that every time exactly after 10min the workflow automatically discards itself.
So i looked in the server config but the relevant Parameter were set to:

com.knime.server.job.max_execution_time = 1d
com.knime.server.job.discard_after_timeout = false

Then i also looked into server log-files, but the only thing i found:

WARN : KNIME-Worker-7-Wait… 176:1232 : “job-id” : Node : Wait… : 176:1232 : Execution canceled

Is there anything I’m missing? I just don’t understand why just the auto-discarding occurs after 10min.

Best Regards
Marty

Hi @maaartyN

What endpoint are you using? If you are using the POST request to execute a workflow, according to the documentation of the endpoint itself (that you can find in the KNIME Server), it is stated that the job will be automatically discarded after execution. Therefore, it does not matter if you change those KNIME Server configuration parameters, as this is the behaviour of the endpoint. But if I did understand your question correctly, your job is not finished after 10 minutes but it is still automatically discarded, correct? What server version are you using?

Additionally, perhaps you would like to try a different approach if you do not want to use the Call Workflow node. You could perhaps first create the job, and then collect the job id to execute the given job using another endpoint from the jobs category.

Best wishes
Ana

Hi Ana,

yes I use the post-request node and yes, you have understood my question correctly. I am using KNIME Server version 4.10.

Your additional suggestion also sounds interesting. Could you perhaps go into it a bit more detail or provide a simple example workflow?

Best Regards
Marty

Hi maartyN,

Now I re-read your question and I understand it better. The problem is that your current timeout is too low. For instance, if you use the GET request node, you can increase your timeout to something bigger than the default timeout (that is 10 minutes). For instance, with an URL like http://localhost:8080/knime/rest/v4/repository/[PATH-TO-WORKFLOW]:execution?timeout=[TIMEOUTINMS].

I think this will be an easier approach with your current workflow.

Best wishes
Ana

As I meant, the jobs will still be dis

1 Like

In any case, here is an example of the approach I mentioned before: https://kni.me/w/WK4ocXripq5o9quY

Thank you very much Ana. Adding the query parameter “Timeout” to my URL and increasing the value of it has solved my problem.

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