Running the AI agent as a task using Orchestration CLI

You can run the AI agent that is configured either in your local environment or in an external environment as a task using Orchestration CLI. The AI agents configured with either the basic agent type or Agentic AI builder can be run as a task using Orchestration CLI. After the run is completed, you an view the results in the task log.

Prerequisites

You must have completed the following:

Overview

An AI agent is a framework that utilizes an AI model (LLM) to interact with a context to obtain a user-defined objective. After you create an AI agent, you can run it as task to get the required results.

Syntax and command line options

You can run the command as follows to create a task with an AI agent.
Ocli model new
After running the command, complete the following template and add to create a task using AI agent:
---
kind: JobDefinition
def:
  folder: 
  name: 
  workstation: 
  description: 
  type: 
  subType: 
  task:
    unoaiagent:
      Action:
        run:
          agentRef: 
          agentId:
          prompt: 
  recovery:
    action: STOP
    repeatAffinity: false
The mandatory attributes to create the task is as follows:
folder
Specify a folder to save the task definition. The default value is the root folder (/). The name must start with a letter, and can contain alphanumeric characters, dashes, and underscores. The name of the folder cannot contain spaces. You must include a forward slash (/) before the folder name if you want to define an absolute path, while it is not required for relative paths.
name
Specify a name for the task. The name must start with a letter, and can contain alphanumeric characters, dashes, and underscores. The name cannot contain spaces.
workstation
You can specify the name of the workstation and also the name of the folder in which the workstation is defined, if any. The name must start with a letter, and can contain alphanumeric characters, dashes, and underscores. The name cannot contain spaces.
type
If the AI agent is configured in your local machine, then enter unoaiagent, or else remoteunoaiagent.
agentRef
Specify the AI agent that you want to run.
prompt
Enter the query or the information that you want to obtain by running the agent. You can add your query in free-form text.
The optional attribute that you can add is:
description
You can add a description for the task.
agentId
The unique ID for the AI agent that is automatically added to the definition when you specify the agentRef attribute.
Note: If required, you can add recovery option, affinity, or output conditions to the task.

You have successfully created the AI agent as a task. Now you can submit it in the plan to get the required results.

Example

  • The AI agent policy_recorder can provide the policy details of numerous clients. To get the coverage type and premium details for the client Aiwan Issac, create the task as follows:
    ---
    kind: JobDefinition
    def:
      folder: /
      name: Aiwan_issac_Policydetails
      workstation: /WS_AGT_0
      description: Get the policy details of Aiwan.
      type: unoaiagent
      subType: run
      task:
        unoaiagent:
          Action:
            run:
              agentRef: /policy_recorder
              agentId: 4885b212-b121-2345-82cf-34234b6f83b5
              prompt: Get the coverage type and premium details for AIiwan Issac.
      recovery:
        action: STOP
        repeatAffinity: false