Building an Invoice Status Agent with Oracle Fusion AI Agent Studio

Introduction

Finance teams and business users ask a version of the same question every day: "what's the status of this invoice, and has the supplier been paid?" That question usually means opening Fusion, navigating to the invoice work area, and running a search. An AI agent that can answer it conversationally, and return the results in a table, cuts that down to a single question.

This post walks through building an Invoice Status Agent in AI Agent Studio, end to end: the Business Object that talks to the Invoices REST resource, the workflow that wraps it with two LLM nodes, and the publish and test cycle.

What the Agent Does

Create a workflow agent to retrieve invoice information, payment status, supplier details, and related attributes from enterprise data. It enables users to search and review invoice records through conversational AI, with the output displayed in a table rather than a wall of text.

 

Getting Started

Everything is built from one place:

        Tools → AI Agent Studio

Task 1: Create the Business Object

The Business Object is what gives the agent its connection to Fusion data. For this agent, it wraps the Invoices REST resource. Before building this, it's worth reviewing the underlying REST resource in Oracle's documentation (linked in the References section below) so the field names and query syntax used in the function match what the API actually exposes.

Step 1: Add the Business Object

        Resources → Business Objects → Add

        Name: Get Invoice BO

        Family: FIN

        Product: Other

        Code: ORA_FIN_OTHER_GETINVOICEBO

        Description: Get All Invoices

        Resource Type: Monolith Resource

        Resource Path: /fscmRestApi/resources/11.13.18.05

 

Step 2: Add the Function

Business Objects don't do anything on their own — you need at least one function that maps to a REST operation. Here, getall calls the Invoices resource, filtered by supplier.

        Click on Add Function

        Name: getall

        Operation Type: GET

        Use Native Authentication: Yes

        Description: Get all invoices

Resource Path:

/invoices?q=Supplier='{psupplier}'&limit=999&fields=InvoiceId,InvoiceNumber,InvoiceCurrency,InvoiceAmount,InvoiceDate,InvoiceType,BusinessUnit,Supplier,SupplierNumber,PaymentMethod,PaidStatus&onlyData=true

A couple of things worth calling out here. The query is scoped by Supplier rather than invoice number, so this agent is built around "show me invoices for this supplier" as the primary use case. The field list is deliberately narrow — InvoiceId, InvoiceNumber, InvoiceCurrency, InvoiceAmount, InvoiceDate, InvoiceType, BusinessUnit, Supplier, SupplierNumber, PaymentMethod, and PaidStatus — because pulling every attribute on the resource slows the response down and adds noise the LLM node then has to filter out anyway. onlyData=true strips the REST envelope so the function returns clean JSON.

Parameters:

        Name: psupplier

        Data Type: String

        Description: Supplier Name

Step 3: Add a Response Example

This is the step that's easy to skip and shouldn't be. The example teaches the LLM node what shape of data to expect back from the function, which matters when you get to the Output Specification later in the workflow.

        Click on Examples

        Example Type: Response Sample

        Copy from: 1. BO Sample

        Description: Get all data

Sample Response:

{     "items": [         {             "InvoiceId": 361908,             "InvoiceNumber": "300100171617230-4",             "InvoiceCurrency": "THB",             "InvoiceAmount": 15000.00,             "InvoiceDate": "2026-06-15",             "InvoiceType": "Standard",             "BusinessUnit": "UAE BU",             "Supplier": "Sample Supplier LLC",             "SupplierNumber": "10234",             "PaymentMethod": "Check",             "PaidStatus": "Paid"         }     ] }

 

 

 

        Choose Create and Close.

Task 2: Create the Workflow Agent

With the Business Object in place, the workflow is where the actual agent behavior gets built — reading the user's question, calling the function, and formatting the result.

        AI Agent Studio → Workflows → Add

Step 1: Agent Details

        Agent Name: Invoice Details Agent

        Family: FIN

        Product: Financial Common

        Description: Invoice Details Agent

Step 2: Add the Read Input LLM Node

The first LLM node in the chain has one job: pull the supplier name out of whatever the user typed and hand it to the Business Object Function node downstream.

        Right Click Add → Node → LLM

        Name: Read Input

        Code: READ_INPUT

User Prompt:

Input: {{$context.$system.$inputMessage}}  Task: Extract the supplier name mentioned in the input message.

Output Specification:

{   "$schema": "http://json-schema.org/draft-04/schema#",   "type": "object",   "properties": {     "SupplierName": {       "type": "string"     }   },   "required": [     "SupplierName"   ] }

The Output Specification is what forces the LLM node to return a clean, predictable JSON object — SupplierName as a required string — rather than a free-text sentence that the next node would have to parse.

 

Step 3: Add the Business Object Function Node

This node calls the getall function on the Invoice BO created in Task 1, passing the supplier name extracted by the Read Input node.

        Right Click Add → Node → Business Object Function

        Name: InvoiceBO

        Family: FIN

        Product: Other

        Business Object: Get Invoice BO

        Function: getall

Psupplier: (Variable)

{{$context.$nodes.READ_INPUT.$output.SupplierName}}

 

This is the binding that ties the two nodes together — the psupplier parameter pulls directly from the Read Input node's output, rather than being hardcoded, so the same workflow works for any supplier the user asks about.

Step 4: Add the Format Output LLM Node

The second LLM node takes the raw JSON returned by the Business Object Function and shapes it into the tabular output the agent is meant to return. The input for this node is bound the same way as the psupplier parameter in Step 3 — through the node picker next to the input field, which lets you search for a previous node (in this case, the InvoiceBO Business Object Function) and select its output variable, rather than typing the binding by hand.

        Right Click Add → Node → LLM

        Name: Format Output

        Code: FORMAT_OUTPUT

 

Add the input marked in red below. You can find this option from the menu button just beside the Options button. This opens the Nodes panel — search for the relevant previous node (in this case, the Business Object Function node used to fetch the invoice data) and select its output variable

 

Step 5: Test the Agent

Before publishing, the workflow can be validated node by node using Debug — useful for catching a mis-mapped context variable before it becomes a support ticket.

        Test the agent by clicking on Debug.

 

Step 6: Publish the Agent

Once testing confirms the workflow behaves as expected across scenarios, publish it to make it available to users.

        Publish the agent.

 

Our Invo

 

Wrapping Up

The pattern here is straightforward and repeatable: a Business Object wrapping a scoped REST call, an LLM node to interpret the question, a Business Object Function node to fetch the data, and a second LLM node to shape the answer. Once you've built one of these, the next one — whether it's invoices, receipts, or something else in Fusion — is mostly a matter of swapping the resource path and the parameter mapping.

References

        AI Agent Studio overview and setup — "How do I use AI Agent Studio?" — https://docs.oracle.com/en/cloud/saas/fusion-ai/aiaas/how-do-i-use-ai-agent-studio.pdf

        AI Agent Studio key capabilities — https://docs.oracle.com/en/cloud/saas/fusion-ai/aiaas/key-capabilities.html

        REST API for Oracle Fusion Cloud Financials — Get all invoices — https://docs.oracle.com/en/cloud/saas/financials/26c/farfa/op-invoices-get.html

        REST API for Oracle Fusion Cloud Financials — Invoices REST Endpoints — https://docs.oracle.com/en/cloud/saas/financials/26a/farfa/api-invoices.html


Post a Comment

Previous Post Next Post