Thursday, December 18, 2025

#1111 - OIC Agentic AI Basics - Human in the Loop (HITL)

 

Introduction

Agentic AI human-in-the-loop (HITL) allows one to intentionally add human intervention to the agent's decision making process.

This could be for compliance purposes, or just an integral part of the business use case.

Back to my order processing example from the previous post, Irish orders are posted to Netsuite, while German orders end up in SAP. But what about orders from other countries? Here I want to inject HITL into the mix. A sales manager needs to decide where the order should go, i.e. Netsuite or SAP.

HITL in OIC

There are 2 parts to HITL -

  1. the workflow definition
  2. the UI

The UI

The form builder is essentially the one we already know from OIC Process.

This is a simple form, where I surface the order details and allow the sales manager to choose the target ERP.

The Workflow Definition

The Start event is defined as follows -

The End event is defined as follows - 


We will do the Data Association later.

Now to the Human Task configuration - 
Now to the Data Association - 

Simple stuff!

I activate both artifacts - 

This HITL workflow will be invoked via an integration - 

This is, by nature of the HITL invoke, an async integration. The trigger is defined as follows -

Request Payload - 

Note the custom header, x-agentic-callback-url. This needs to be defined to enable the callback to our "orchestrator" integration.

That's it!

Now let's amend the Agent Guideline as follows - 

You are an order processing agent responsible for validating incoming orders.

### Order Processing Steps

#### 1. Validate Order
Use the **Validate Order** tool to check if an order passes our validation rules. If the order is invalid, then use the **Notify Customer** tool to inform the customer. Also include the "message" returned by Validate Order. If an order is invalid, processing stops immediately; in such cases, detail exactly why this order failed validation.

#### 2. Check Inventory
Use the **Check Inventory** tool to check if the product is in stock. If the product is out of stock, use the **Notify Customer** tool to inform the customer. Ensure the "message" passed to the Notify Customer tool is relevant and friendly. Remember, we are razor focused on customer satisfaction. If an order's product is no longer in stock,  processing stops immediately; in such cases, detail exactly why this order's processing has been terminated.

#### 3. Create Order in one of our ERP systems
Use the **Create Order SAP** tool to create orders for German customers.
Use the **Create Order Netsuite** tool to create orders for Irish customers.

#### 4. Use HITL to assign orders from other countries to one of our ERP systems 
For orders from other countries, use the  ** HITL For ERP Assignment** tool to enable our sales manager to assign the order to one of our ERP systems. Depending on the output from the ** HITL For ERP Assignment** tool, use either the Create Order SAP or Create Order Netsuite tool to create the order.  


#### 4. Send a confirmation email to the customer
Use the**Notify Customer** tool for this and ensure the email is very friendly.

Run the Agent

I see that the HITL tool has been invoked for the Austrian order -

I check out Project Observability - 

I click the link - Open in workspace -

I click the Assign button, thus completing the human workflow.

I now open the integration observability - 

note the callback to the "orchestrator" integration - ReAct Pattern Intg.

Also note the the Create Order in SAP tool has been invoked. The Notify Customer tool has also been invoked, to send the confirmation email to the customer.

Summa Summarum

This is a very compelling addition to our Agentic AI toolkit. Googling "What is Agentic AI HITL" gives us many buzzwords; phrases such as HITL for nuanced judgement or  HITL enabling ethical considerations. In my case, it was used because my agent alone couldn't reach the confidence level required to route the order to an ERP system.

Net, net, though - you decide when to use leverage this, based on your business requirements.   



















 







#1110 - Moving Integrations to Projects via Factory API

Introduction


Projects are a key feature in OIC3 and you need to start using them, in order to take advantage of all the cool new features we have.

Today you can copy your integrations from the "global space" into projects - Here's a simple example - 

 
I use the copy integration option -

As you can see, I have 3 integrations in the global space. In this case, I want to copy both ERP integrations into this projects, but as you can see, there is no multiple select option here, so I need to do this one at a time.


Now I will look at implementing a more complete solution, using the factory api.

In my simple use case, I want to move all integrations prefixed with ERP_ to my ERP Project,  AA_MY_ERP_PROJECT.

First step is to retrieve the ERP integrations - here's the api call -
https://design.integration.us-phoenix-1.ocp.oraclecloud.com/ic/api/integration/v1/integrations?q={name: /ERP_/}&integrationInstance=myOICInstance

The response is as follows -

{
    "hasMore": false,
    "items": [
        {
            "code": "ERP_CREATEORDER",
            "compatible": true,
        ...
    "id": "ERP_CREATEORDER|01.00.0000",
        ...
    "percentageComplete": 100,
            "projectType": "DEVELOPED",
        ...
    "status": "CONFIGURED",
       ...
        {
            "code": "ERP_GETORDER",
          ...
    "totalResults": 2
}

The following api call copies the integration to a project -

POST - https://design.integration.us-phoenix-1.ocp.oraclecloud.com/ic/api/integration/v1/projects/myProject/integrations/copy?integrationInstance=myOICInstance

Note the request payload - 

{"projectCode":null,"integrations":[{"code":"ERP_GETORDER","version":"01.00.0000"}]}

I check my new project - 

ERP_GETORDER is still present in the global space. 
In the meantime, I've activated the ERP_CreateOrder integration.

This will set the status accordingly. 

  "status": "ACTIVATED",


I copy this integration to the project - 

Excellent! My ERP integrations are in my ERP Project. But wait a minute, they're still in the global space. I need to delete them form there, this is, after all, a move.

Activated integrations cannot be deleted, so I need to check the status field, shown above. 

If status = ACTIVATED then I need to deactivate -

For this I use the following api -

Here I need the id field from the GET Integrations response.

https://design.integration.us-phoenix-1.ocp.oraclecloud.com/ic/api/integration/v1/integrations/ERP_CREATEORDER|01.00.0000?integrationInstance=myOICInstance

Now to deletion, here I use - 

https://design.integration.us-phoenix-1.ocp.oraclecloud.com/ic/api/integration/v1/integrations/ERP_CREATEORDER|01.00.0000?integrationInstance=myOICInstance






ERP_CREATEORDER Integration is deleted - 

Finally, let's build a UI around this; starting point is the following OIC Project -


These 3 integrations encapsulate the api calls we've already discussed.

Get Integrations: retrieves a list of integrations, based on a filter - 

 

I invoke this from a simple VB app - 

This page includes a table, I activate multiselect on its rows - 
The table gets its data from the following service connection endpoint -

Back to OIC, the next integration we'll look at is Move Integrations. This integration does the following - For the integrations list received, iterate over each integration, invoking the 3rd integration, Copy Integration, which copies the integration to the target project specified in the VB app. It then checks whether the integration status = ACTIVATED; if this is the case, the integration is deactivated. Finally, the integration is deleted from the global space.

I will now show you how to add the endpoint of Move Integrations to the VB Service Connection.

That's it - simple stuff!

Summa Summarum

The OIC UI will soon support the ability to do multi-selects on a list of integrations and then move them to a project. You can consider using the option described in this post, until the OIC UI supports such.