How to Use Sequential Workflow Agent Teams

Create the tools, agents, and tasks for each stage, define task dependencies, list agent-task pairs in workflow order, and run prompts against the team.

  1. Grant the required privileges. The database user must have EXECUTE privilege on DBMS_CLOUD_AI_AGENT, access to required credentials, and the required network ACLs for external provider calls. See Prerequisites for Using Select AI Agent for more information.
  2. Create the tools used by each workflow stage, such as PL/SQL functions or built-in SQL, RAG, web search, or notification tools. See Example: Create Built-In Tools for more information.
  3. Create the agents and tasks. Keep each task focused on one workflow stage and configure the tools available to that task. See Example: Create a Task for more information.
  4. Define task dependencies. On a downstream task, use the input attribute to name the upstream task whose result it consumes. See CREATE_TASK Procedure for more information.
  5. Create the team with process set to sequential, and list the agent-task pairs in the required run order. See CREATE_TEAM Procedure for more information.
  6. Set the team for the session or call DBMS_CLOUD_AI_AGENT.RUN_TEAM, and then submit a natural-language prompt. See SET_TEAM Function for more information.
  7. Review team, task, tool, and conversation history to confirm ordered runs, handoffs, failures, and human-input wait states. See Example: View Agent Prompts and Responses from the Latest Team Run for more information.

For example:

BEGIN
      DBMS_CLOUD_AI_AGENT.create_team(
        team_name  => 'Ops_Issues_Solution_Team',
        attributes => '{"agents": [{"name":"Data_Engineer","task" : "fetch_logs_task"},
                                    {"name":"Ops_Manager","task" : "analyze_log_task"}],
                "process": "sequential"
                }');
    END;

Note: The agents array defines the workflow plan. Reorder the array to change the run sequence. To pass the fetch result to the analysis task, define "input": "FETCH_LOGS_TASK" on ANALYZE_LOG_TASK.