sapui5tutors SAPUI5 • Fiori • SAP BTP Step-by-step tutorials Real project examples Interview Q&A
Practical SAPUI5 • Fiori • SAP BTP tutorials and interview prep

Joule Studio: Build Your First Custom AI Agent in SAP BTP (Step-by-Step)

Why out-of-the-box Joule isn't enough

Picture this. You ask Joule, inside your S/4HANA system, a perfectly reasonable question:

"Show me all blocked sales orders for customer 17100001, and remove the delivery block on order 487."

Joule's answer is polite, well-formatted — and useless for what you actually want. It explains how to find blocked orders manually, step by step. Like a confident colleague who won't touch the keyboard themselves.

That's the gap. Out-of-the-box Joule answers questions. It doesn't execute business actions.

Custom agents close the gap: they read your sales orders through an OData API, decide which skill to call, and update the delivery block — with a human confirming first.

This post builds exactly that in Joule Studio, using the blocked-orders scenario above.


Skills vs agents: the only two concepts that matter

Everything in Joule Studio boils down to two building blocks.

A skill is one single action — a tool on a workbench. Read blocked sales orders. Update a delivery block. Send an email. One skill, one job, done well.

An agent is the brain holding skills together. It figures out what the user wants, picks the right skills, calls them in order, and stitches results into an answer. Agents can even call other agents as tools.

Our scenario: two skills (read blocked orders, remove delivery block), one agent orchestrating them.


What an agent is made of

Open an agent in Joule Studio and you'll configure four areas:

  • Expertise & instructions — the agent's role, boundaries, and behavior. Basically a system prompt, and where most of the quality comes from.
  • Tools — what the agent may touch: OData/REST APIs via BTP destinations, MCP servers, other Joule skills, sub-agents, document grounding.
  • Document grounding — business documents (say, your credit policy PDF) in an AI Core resource group, so answers follow your rules.
  • Human-in-the-loop — the agent pauses for a human on critical decisions. Leave this on for anything that writes data.

What you need before you start

  • SAP BTP subaccount with the AI Core extended plan entitled
  • SAP AI Launchpad subscribed, service key created
  • Generative AI Hub orchestration deployment enabled
  • Access to SAP Build (where Joule Studio lives)
  • OData access to S/4HANA — we'll use API_SALES_ORDER_SRV. No system handy? SAP's Agent Lab trial environment provides simulated data.

One honest note: the Agent Lab experience is still evolving. The UI moves between versions — save often, and don't plan your production rollout on a preview.


Building the agent, step by step

Goal: an agent a sales rep can ask in plain English to list blocked orders and unblock one — with human confirmation before anything updates.

Step 1: Create the Joule Studio project

From the SAP Build lobby, hit Create and choose the "Joule Agent and Skill" tile. Name it something like Blocked Order Agent with a one-line description.

A project is just a container — skills and agents ship together in it.

Step 2: Create skill #1 — read blocked sales orders

Add a skill artifact named Get Blocked Sales Orders. The description matters more than you'd think — Joule uses it for intent matching. Write it like a briefing:

Retrieves sales orders with a delivery block for a given
customer number from SAP S/4HANA via OData
(API_SALES_ORDER_SRV).

Bind it to the OData read operation, filtered on the delivery block field.

Keep this skill read-only. Always start read-only.

Step 3: Create skill #2 — remove the delivery block

Second skill: Remove Delivery Block, bound to the OData update operation for the delivery block field.

Keep human-in-the-loop switched on here. An agent silently unblocking sales orders on day one is the kind of story that ends careers.

Step 4: Create the agent and give it a brain

Add an agent artifact. Set its expertise — e.g. "Sales order exception handling in SAP S/4HANA SD." Then write the instructions. This is the highest-leverage text in the build:

You are a sales order assistant for the SD team.
When the user asks about blocked orders:
1. If the customer number is missing, ask for it. Never guess.
2. Call Get Blocked Sales Orders and present order numbers,
   values, and block reasons in a short list.
3. Only call Remove Delivery Block after the user explicitly
   names an order. Confirm the order number back to them first.
4. Never unblock an order without explicit user confirmation.

Attach both skills as the agent's tools. Brain + two hands — that's the whole wiring.

Step 5: Test it in the simulator before you trust it

Run the happy path first: "Show blocked orders for customer 17100001." Watch each reasoning step and tool call. Then deliberately break it:

  • Ask without a customer number — does it ask instead of guessing?
  • Ask it to "unblock everything" — does it refuse or ask for specifics?
  • Name an order that isn't blocked — what happens?

Test the refusals, not just the happy path. "Unblock all orders" is the test that matters most.

Plan for three or four rounds of tightening the instructions before it's solid.

Step 6: Release it and use it in Joule

Release the project. The agent appears in Joule for your users; monitor executions from the AI Agent Hub. Start with a pilot group, keep human-in-the-loop on, review the first week's runs.

Shortcut: in Joule Work, go to Develop → Agent tile → Create, type a name and intent statement, tick Quick Create. You get a working starting point to refine with the steps above. Great for prototypes — don't ship it untouched.


Rules that save you pain

  • Read-only first, always. Prove the read path before giving any agent a write tool.
  • Write skill descriptions for intent matching. Short, specific, mention the system and the action.
  • Ground with documents, not longer instructions. Your credit policy PDF in a resource group beats five paragraphs of prompt rules.
  • Don't paste real customer data into trial environments. Simulated data exists for a reason.

Where to go from here

Natural extensions: grounding the agent in your actual credit policy documents. Routing the unblock through a Build Process Automation approval form. Packaging this agent as a sub-agent inside a bigger order-management agent.

Small, trustworthy agents composed into bigger ones — that's the real power of the model.

Questions? Stuck on the OData binding or the AI Core setup? Drop a comment — I read every one.