Remote Execution on KNIME Server
Articles,  Blog

Remote Execution on KNIME Server


You deployed a workflow to KNIME Server and
want to execute it? There are different options to choose from
to run your workflow on the server: via KNIME Analytics Platform, via the KNIME WebPortal,
via the Remote Workflow Editor, and via REST. To execute a workflow via KNIME Analytics
Platform we have to connect to the server. Whenever a workflow is executed on KNIME Server
a new job is created. This happens regardless of whether you trigger
execution from KNIME Analytics Platform, the WebPortal or REST. Jobs are children of their corresponding workflow,
and can be run on-demand, or scheduled. A job can have a different status, represented
by different icons in the KNIME Explorer. Here are some examples. Scheduled jobs for single execution have an
icon with a single clock. If a job is scheduled at regular intervals,
it is marked by 3 clocks, which you can see here. A successfully executed job, indicated by
the green circle, is one where all nodes have executed successfully. Currently executing jobs have three green
horizontal arrows. An unsuccessfully executed workflow where
an error occurred during execution has a red circle. By using the remote workflow editor or “Show
Workflow” messages for a quick view, we can check what caused the error. The red circular arrow shows that the original
workflow was overwritten and the job was executed using a previous version of the workflow. Let’s now execute this deployed workflow. Right-click and select “Execute” to open the
Execute dialog. Here are your execution and scheduling options. Reset before Execution will fully reset the
workflow before it is run on the server. If you want it to run in its executed state
– as it was uploaded to the server, then uncheck this option.This is useful for debugging long-running jobs, where you don’t want to always start the execution from the beginning. The option “Discard Workflow Job after Execution”
will remove the job immediately after completion without saving it. This is useful to conserve memory and disk
space. If unchecked, the job will stay in-memory
for one hour and on disk for 7 hours after execution, per default. When a workflow runs successfully, you might
want to let the relevant team members know, or even automatically send out a report. Or if there is a problem with the workflow,
perhaps you want to notify someone so that they can fix the problem. Therefore you can configure a set of email
actions based on success only, failure only, and success or failure. Multiple email addresses, separated by a comma
or semicolon, can be added to the dialogue. The default job name is the workflow name
plus execution time. However, you can change this to a custom name
by entering the name in this box. Please note, if the workflow contains a BIRT
report, you can select the formats of the reports that are attached to the notification
emails. The second tab allows you to save a report
on the server. You can decide whether you always want to
overwrite the report or whether to add a timestamp and save a new report for each workflow execution. You can also define where on the server you
want to store your report, and in what formats. If you click the ok button, a job is created
and the workflow is executed right away. Another option is to schedule a job to be
executed at a later time, or on a regular basis. We will now show you how to set this up in
the next tab, “Scheduling options”. Here you can see the options for setting the
date and time of the execution. When executing the workflow just once, keep
schedule job selected, and choose the date and time you want the workflow to run. To schedule repeated or periodic workflow
execution, select repeat execution. Once selected, you can choose between either
executing the workflow in a fixed interval based on minutes, hours, or days, or to start
execution at fixed start times. For both options you can further restrict
the executions by selecting the days of the week, days of a month, months, and the start
times for when a job should be executed. So for example, if you want to execute a workflow
every hour between 9 am and 10 pm on weekdays you select “Repeat every hour”. By unchecking the checkbox “Saturday” and “Sunday”
the execution of the workflow is restricted to weekdays. In the start times tab you can also restrict
the time to have the workflow executed between 9am and 10 pm only. Another option is to define a fixed execution
at 9 am every morning, also taking daylight saving times into account. You select repeat at fixed start times and
set the execution time in the start time tab. In addition, you have the option to skip the
next execution if the previous execution is not yet complete, as well as to temporarily
disable the schedule. Let’s click “OK” and move on. Another option to execute a workflow is via
the KNIME WebPortal. You can do this by either connecting to the
WebPortal via a web browser directly or by right clicking a workflow and selecting open
in WebPortal. To trigger execution via REST from any other
application, you can check out the possible request options by right-clicking and selecting
“Show API definition”. Another option is to execute the workflow via the Remote Workflow Editor by right-clicking the workflow and selecting “Open as new Job on Server”. That’s all for today on executing workflows remotely on KNIME Server.

Leave a Reply

Your email address will not be published. Required fields are marked *