Managing Tasks
Adding a task
To add a task to the designer:
- Select a task in the task navigator.
- Drag it to the workflow pane.
- Edit the task parameters.
Editing task
To start editing task settings, double-click on a task block. A dialog with several tabs wills pop-up.
The main Tab
Main tab contains specific parameters for each task.
“Start only if” parameter
Let you define if the task will be executed.
If the result of evaluation is False:
Workflow execution will stop.
If True:
Execute the task.
Logs
Allow workflow to feedback all needed information that could be useful in development mode. Beware this could be time consuming in production.
It’s a good practice to deactivate all logs but message, error, and error context logs from Root node, decreasing the amount of transferred information, and accelerating workflow execution/UI feedback.
Webhooks tab
A Webhook is a POST request sent to a predefined URL during a specific event. It allows you to send feedback information to your information system for example.
To add a new Webhook:
Press the “+ Webhook” button.
Enter the URL you wish to call. Select on which event you want the webhook to be called.
Callbacks tab
Callbacks are code executed at specific moments.
On Initialize
Triggered once before task execution. It’s a good place to import necessary libs or initialize variables.
If you want to have those import available globally for all the workflow tasks, use the Home task /Helper tab instead.
On Success
Triggered if execution is successful.
On Error
Triggered if execution generate an error.
On Max retry
Triggered if execution reach max level of Max Retry (defined in Error tabs).
Errors tab
This tab defines how workflow should behave in case of error.
On Reached
Possible values:
-
Abort Task; This is the default mode: When max retry is reached, task is terminated, and workflow execution will continue.
-
Abort Workflow; When max retry is reached, all the workflow tasks will be aborted, including pending transfers.
On Child Error
Possible values:
- Trigger OK Port.
- Trigger Error Port.
Execution tab
Mode
-
Bypass; This option is useful with serialized tasks schema, as it lets you deactivate some tasks without disrupt other execution.
-
Parent thread; Use this mode if a lot of instance of this task will be performed, and no threaded capabilities are needed. Typically a task message executed a lot a time could use less resources using “parent thread”mode.
-
New thread; Task execution will be performed inside a new python thread, letting you running several different tasks concurrently. When a task is created inside a new thread, caller (parent) task will wait for end of execution of all his children created in New thread mode.
-
Standalone; Use this mode when you need threading capabilities, but you don’t need to wait for the end of task, neither about task result.
Export Context
-
Don’t export; No variable of current context will be cloned. New tasks will have only loop_index, loop_loop_key, loop_value and gc accessible inside context.
-
Duplicate; will clone fist level variables of current context before assign it to a new task context. This is the default behavior, and let you access to a copy of parent context inside tasks descendants.
-
Through task key; Exporting context “Through task key”allow you to access to a single instance of an object inside the descendants of the task.
For example, you can declare “my_list = []” inside a task“my_task” , and add elements from any descendants tasks using “my_task. my_list.append(my_object).
This behavior is not possible with duplicate context, as all objects accessible inside context are cloned.
Loop_index, loop_loop_key and loop_value are always cloned.
Task info tab
Task key
This is the unique key name for the task.
Icon
Icon list can be found there: Bootstrap Icons
Deleting a task
To delete a task, select it and press Delete. All links from and to this task will be deleted.
Linking a task to another
The Different ports
Blue port
Blue port is the input port of every task except for Start task that have no Blue port.
Green port
Green port is used when a task execution ends without errors.
Red port
Red port is when a task or subtask execution failed.
Yellow port
Yellow port can be the one called for every value of an iterator.
Orange port
Orange port is used for the false value in “If or not” task.