Introduction
This is a simple demo on leveraging OIC Agents to monitor and resubmit errors. The business case is as follows, orders are received and need to be processed in a timely manner. The order processing is done by an asynchronous integration, I call it ASYNC_MAIN; the actual processing is done by 2 synchronous integrations, SYNC1 and SYNC2.
SYNC1 and SYNC2 are 2 steps in the order process. Naturally, if an error occurs in SYNC2, by resubmission, we don't want SYNC1 executed a second time. To ensure this, I have added a WAIT to ASYNC_MAIN, just after the invoke of SYNC1. This will ensure the process state is dehydrated, and, in case of resubmission, SYNC1 will not be re-executed.
Back to the business use case, any order processing errors in ASYNC_MAIN, need to be fixed and resubmitted ASAP, ergo, I need to monitor for errors in ASYNC_MAIN, I also need the ability to resubmit failed instances of ASYNC_MAIN. Here is the flow -
The error will be generated, when I enter an order for an invalid product, in my case, the non-existent iCar. To ease testing, I have added a lookup to the project, that contains the product value. This allows me to easily mimic fixing the error, before resubmission.
The next component is a DB table on ATP -
CREATE TABLE "NIALLC"."ERRORED_FLOWS"
( "INSTANCEID" VARCHAR2(30 BYTE) COLLATE "USING_NLS_COMP",
"PROJECTNAME" VARCHAR2(50 BYTE) COLLATE "USING_NLS_COMP",
"INTEGRATIONNAME" VARCHAR2(50 BYTE) COLLATE "USING_NLS_COMP"
) DEFAULT COLLATION "USING_NLS_COMP" ;
ALTER TABLE "NIALLC"."ERRORED_FLOWS" MODIFY ("INSTANCEID" NOT NULL ENABLE);
ALTER TABLE "NIALLC"."ERRORED_FLOWS" MODIFY ("PROJECTNAME" NOT NULL ENABLE);
ALTER TABLE "NIALLC"."ERRORED_FLOWS" MODIFY ("INTEGRATIONNAME" NOT NULL ENABLE);
On error, a row will be written to this table -
The flow, with instance id,
2HVm-j8dEfG8Ab8Y-P4nAQ, errors out.
Let's process a second order, with the same invalid product, iCar.
The flow, with instance id, O6f-Sj8eEfGQlVci_IGJCQ, errors out.
The result - 2 rows in my errors table -
Using the OIC Factory API to monitor errors
Back to the business use case, we need to monitor errors in ASYNC_MAIN. This we can do by monitoring the OIC Observability page, but we want to automate this, correct? Here's where the OIC factory api comes into play. Here is the api call to monitor errors in this integration -
https://design.integration.yourRegion.ocp.oraclecloud.com/ic/api/integration/v1/monitoring/errors?integrationInstance=yourOICInstance&q={timewindow: '1h', projectCode: 'AA_RESUBMIT_AGENT',code: 'ASYNC_MAIN'}
The response contains lots of interesting data, check out the excerpt here -
{
"dataFetchTime": "2026-04-23T14:13:26.594+0000",
"items": [
{
"creationDate": "2026-04-23T14:10:50.525+0000",
"currentTraceLevel": "Debug",
"errorCode": "500",
...
\"faultName: {{http://schemas.oracle.com/bpel/extension}remoteFault} cause: {Invalid Product: iCar}\",\n \"errorPath\" : \
... \"errorCode\" : \"ERR-001\"\n } ]\n}.The 500 Internal Server Error is a
...
{
"detailErrorMessage": "<fault xmlns=\"http://xmlns.oracle.com/cloud/oic/gen3fault\"><traceId>05c9604058916bdfd251f9e87336055a</traceId>
...
"errorCode": "500",
"errorLocation": "Re-throw Fault",
"errorMessage":
...
cause: {Invalid Product: iCar}\",\n \"errorCode\" : \"500\",\n \"errorDetails\" : [ {\n \"type\" : \"UnMappedFault:\",\n \"instance\" : \"NA\",\n \"title\" : \"faultName: {{http://schemas.oracle.com/bpel/extension}remoteFault} cause: {Invalid Product: iCar}\",\n \"errorPath\" : \"<![CDATA[<location xmlns=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\">mcube</location>\\n]]>\",\n \"errorCode\" : \"ERR-001\"\n } ]\n}
...
"errorLocation": "Re-throw Fault",
"errorMessage": "<![CDATA[{\n \"type\" : \"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1\",\n \"title\" : \"ERR-001\",\n \"detail\" : \"faultName: {{http://schemas.oracle.com/bpel/extension}remoteFault} cause: {Invalid Product: iCar}\",\n \"errorCode\" : \"500\",\n \"errorDetails\" : [ {\n \"type\" : \"UnMappedFault:\",\n \"instance\" : \"NA\",\n \"title\" : \"faultName: {{http://schemas.oracle.com/bpel/extension}remoteFault} cause: {Invalid Product: iCar}\",\n \"errorPath\" : \"<![CDATA[<location
...
"instanceId": "O6f-Sj8eEfGQlVci_IGJCQ",
"instanceReportingLevel": "Debug",
"integrationDeleted": false,
"invokedBy": "niall.commiskey@oracle.com",
"isDataAccurate": true,
...
"primaryName": "orderNr",
"primaryValue": "2113",
"projectCode": "AA_RESUBMIT_AGENT",
"projectName": "AA-Resubmit-Agent",
"recoverable": true,
"replayable": false,
"replayed": false,
"retryCount": 0
},
{
"creationDate": "2026-04-23T14:08:04.154+0000",
"currentTraceLevel": "Debug",
"errorCode": "500",
...
"errorItems": [
{
"detailErrorMessage": "
... \"ERR-001\",\n \"detail\" : \"faultName: {{http://schemas.oracle.com/bpel/extension}remoteFault} cause: {Invalid Product: iCar}\",\n \"errorCode\" : \"500\",\n \"errorDetails\" : [ {\n \"type\" : \"UnMappedFault:\",\n \"instance\" : \"NA\",\n \"title\" : \"faultName:
...
{ "recoverable": true,
"retryCount": 0,
"state": "MCUBE_ACTIVITY_RECOVERY_REQUIRED",
"status": "FAILED"
}
],
...
faultName: {{http://schemas.oracle.com/bpel/extension}remoteFault} cause: {Invalid Product: iCar}\",\n \"errorPath\" : \"<![CDATA[<location xmlns=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\">mcube</location>\\n]]>\",\n \"errorCode\" : \"ERR-001\"\n } ]\n}.
...
"faultId": "6tIF0D8dEfGez3_SZkbBOA",
"id": "2HVm-j8dEfG8Ab8Y-P4nAQ",
"instanceId": "2HVm-j8dEfG8Ab8Y-P4nAQ",
...
"primaryName": "orderNr",
"primaryValue": "2112",
"projectCode": "AA_RESUBMIT_AGENT",
"projectName": "AA-Resubmit-Agent",
...
}
],
...
"timeWindow": "1",
"totalRecordsCount": 2,
"totalResults": 2
}
Interesting fields in red.
Our integration, get Error Details, will use this api.
Using the OIC Factory API to resubmit errors
Here is the api call I use -
Now to my integrations, which will leverage the factory api -
The
Resubmit Failed Flows integration is as follows; I also include the details of
get Error Details -
I expose these 2 integrations as tools to my agent -
Let's try out the agent -
In the last hour, there were 2 errors for the integration ASYNC_MAIN in the project AA_RESUBMIT_AGENT.
What caused these errors?
The errors were caused by an internal server error with HTTP status code 500. Specifically, the faultName is "ns0:APIInvocationError," and the reason provided is related to an internal server problem with the message: "faultName: {{http://schemas.oracle.com/bpel/extension}remoteFault} cause: {Invalid Product: iCar}."
This indicates that the underlying issue causing the errors was invoking an external service that encountered an internal error related to an invalid product identified as "iCar."
Was order number 2112 affected?
Yes, the order number 2112 was affected. It is associated with one of the errored instances in the last hour for the integration ASYNC_MAIN in the project AA_RESUBMIT_AGENT.
"The best revenge is to be unlike him who performed the injury." - Marcus Aurelius
Let's resubmit, but, before we do so, let's set the lookup value to iBike.
I resubmit via the agent -
The database table no longer has any rows; the delete being done in the RESUBMIT integration -
I validate in
OIC Observability -
Naturally, we could have a scheduled integration that uses the new OIC AI Agent native action to ensure these resubmits are done on a regular basis, based on business needs. That I leave up to you!
Summa Summarum
This is a simple use case for an agent, but it does address the business use case and does save lots of time and manual effort. Over time, you may see such functionality OOTB in OIC Observability, but, up until then, this is a viable alternative. You can get project export
here.