Configure Tasks

This section covers the creation and configuration of tasks.

About Tasks

Tasks are short, functional blocks of code you can piece together into a flow as part of job or promote to jobs themselves.

Tasks are the primary building blocks of all workflows in Oracle AI Data Platform. The type of task determines the type of code it uses. As part of a job, you connect tasks to determine their sequence and priority when the job is run.

Task type Description
Notebook task A task that has been saved to a notebook you can access
Python task A task using a snippet of Python programming language
If/else condition A task that uses if/else conditions
Nested job task A task that uses an existing job and its tasks as a nested task

When you have more than one task, you can create sets of task dependencies where the success or failure of one task can trigger subsequent tasks in sequence. You can only create dependencies in jobs that have more than one task. See Create a Notebook Task.

Tasks can be run in parallel with one another. You can do this by making two or more tasks dependent on the success or failure of another task in the same workflow, causing them to run at the same time.

Tasks can fail due to transient issues, such as network disruptions, resource unavailability, or temporary service failures. In these cases, your AI Data Platform automatically retries the task based on retry policies you configure when the task is created. As part of these policies, you define:

  • Retry Count: The maximum number of retry attempts.
  • Retry Interval: The wait time between retries.

In addition to standard task retries, AI Data Platform also supports Retry on timeout. If a task exceeds its execution time limit due to resource constraints or slow processing and you want to retry only for these scenarios, you can choose to automatically trigger a retry. These retry policies enhance workflow resilience, ensuring tasks have a higher chance of successful execution without manual intervention.

When and How to Use Compute Logs

You should check your compute logs if your task fails with resource or system related errors, such as out-of-memory errors or CPU use exceeding limits.

Review Spark logs if you see long wait times, unexpected retries, or job performance bottlenecks. These logs provide insight into the driver and worker nodes of the compute cluster backing your task and can help identify the source of possible problems.

For guidance on how to check your logs, see Monitor a Specific Job Run.

You must have appropriate compute-level RBAC permission to view metadata and logs for the compute instance associated with the job. Contact your administrator to obtain these permissions if you are unable to view compute logs. For more information, see About Permissions.

Create a Python Task

You can create a task as part of workflow job that uses Python scripting.

  1. On the Home page, click Workflow.
  2. Click on the job you want to make a task for.
  3. Click Add task.
  4. Enter a task name.
  5. For Task type select Python.
  6. Click Browse and navigate to the Python script you want to add as a task. Click Select.
  7. Select a compute cluster for the Python task, if one is not already attached.
  8. Select the number of retries a task should attempt on failure. If you select more than 0, you must also specify how much time the job run should wait between retries and if retries should be attempted on timeout.

    Task retry options when the number of retries is 1 or greater

  9. From Depends on, select any tasks you want to make this task dependent on. Select the conditional response to that dependency from the Run if dropdown.
  10. Add additional parameters by providing their Key and Value. Click Add parameter to provide multiple parameters.

Create a Notebook Task

You create tasks using notebooks you have built in your AI Data Platform.

  1. On the Home page, click Workflow.
  2. Click on the job you want to make a task for.
  3. Click Add task.
  4. Enter a task name.
  5. For Task type select Notebook.
  6. Click Browse and navigate to the notebook you want to add as a task. Click Select.
  7. Select a compute cluster for the notebook task, if one is not already attached.
  8. Select the number of retries a task should attempt on failure. If you select more than 0, you must also specify how much time the job run should wait between retries and if retries should be attempted on timeout.

    Task retry options when the number of retries is 1 or greater

  9. From Depends on, select any tasks you want to make this task dependent on. Select the conditional response to that dependency from the Run if dropdown.
  10. Add additional parameters by providing their Key and Value. Click Add parameter to provide multiple parameters.

Create a Nested Job Task

You can use another workflow job and its contained tasks as a nested task within another workflow.

  1. On the Home page, click Workflow.
  2. Click on the job you want to make a task for.
  3. Click Add task.
  4. Enter a task name.
  5. For Task type select Nested job task.
  6. Select a job in your Intelligent Data Lake from the Jobs dropdown.
  7. Select the number of retries a task should attempt on failure. If you select more than 0, you must also specify how much time the job run should wait between retries and if retries should be attempted on timeout.

    Task retry options when the number of retries is 1 or greater

  8. From Depends on, select any tasks you want to make this task dependent on. Select the conditional response to that dependency from the Run if dropdown.
  9. Add additional parameters by providing their Key and Value. Click Add parameter to provide multiple parameters.

Create an If/Else Task

You can create a task that uses if/else conditions based on catalog data to determine if the task triggers.

  1. On the Home page, click Workflow.
  2. Click on the job you want to make a task for.
  3. Click Add task.
  4. Enter a task name.
  5. For Task type select If/Else.
  6. Enter the conditions that determine if the task triggers. Click Add icon Add to set multiple conditions.
  7. Enter the condition expression.
  8. Select the number of retries a task should attempt on failure. If you select more than 0, you must also specify how much time the job run should wait between retries and if retries should be attempted on timeout.

    Task retry options when the number of retries is 1 or greater

  9. From Depends on, select any tasks you want to make this task dependent on. Select the conditional response to that dependency from the Run if dropdown.
  10. Add additional parameters by providing their Key and Value. Click Add parameter to provide multiple parameters.

Modify a Task

You can change existing attributes of a task, such as name, type, and parameters to alter how it functions in your job.

  1. On the Home page, click Workflow.
  2. Click on the job you want to configure tasks for.
  3. In the Tasks tab, click the task you want to edit.
  4. In the Task Details pane on the right, modify the task attributes as needed. Changes are saved automatically.

View Task Logs

You can view the run logs of individual tasks in a job.

  1. On the Home page, click Workflows.
  2. Click Job Runs.
  3. Click the job you want to see the task logs for.
  4. Click the task nodes to see the logs for that task.

Delete a Task

You can delete a task by removing the task node from a job.

  1. On the Home page, click Workflow.
  2. Click on the job you want to delete tasks from.
  3. On the task node, click Actions then click Remove node.
  4. Click Delete.