
Part 16 of 26 in SAP Business AI, Explained.
Most people meet AI agents in a chat window. Some of the most useful ones never wait to be asked. They wake up when something happens, like a delivery being received or a sensor raising an alert. Here’s when that design makes sense, and the one property every such agent needs: because events can repeat, it has to be safe to run twice on the same one.
Requests, events and the duplicate problem
- A request waits for an answer. An event says “this happened”, and any interested application can react.
- I’d only wake an agent when the reaction needs judgement. If it’s a fixed rule, a workflow is cheaper and easier to audit.
- Expect duplicates. Events can arrive twice, so the agent must ask “have I already done this?” before acting. That’s what idempotency means.
The everyday picture
A request is a phone call: you ring the central stores and wait while they check. An event is a notice pinned to a board: “Delivery 7781 received at central stores.” Anyone who cares reads it and acts in their own time. The existing post on SAP Integration Suite and Advanced Event Mesh explains this difference for systems.
Remember the stock-room sensor from this series that reorders when shelves run low? It doesn’t wait for a manager to ask. But if the sensor fires twice for the same empty shelf, a good stock-room clerk checks the order book first and doesn’t order twice.
From business event to agent proposal
SAP Event Mesh lets applications communicate through asynchronous events, publishing and consuming business events from SAP and non-SAP sources (SAP Help, SAP Event Mesh). SAP describes Joule Studio as able to build fully autonomous agents that run in the background, triggered by business events or schedules (SAP Community, Joule Studio).
- Something happens. A goods receipt is posted in SAP Cloud ERP, or a sensor raises an alert, and the source publishes an event.
- An event broker delivers it to every subscriber, including the agent’s trigger.
- The agent checks for duplicates. Using the business key in the event, such as the goods receipt number, it asks whether this is already handled or in progress.
- Then it does the judgement work. It reads documents, compares values and prepares a proposal.
- A person or a rule closes the loop. Low-risk results are applied and reported, and anything touching money goes for approval.
Goods receipts and a noisy pump at NextSAP
NextSAP Utilities, the fictional Dubai utility used across this site’s SAP content, posts about 1,800 goods receipts a month at its central stores for meters, cables and spares, and each receipt publishes an event. An invoice matching agent wakes (an agent outside the ten, still going through intake; see post 26), finds the supplier invoice and the purchase order, and compares quantities and prices. On a typical day 85% match within tolerance and are queued as a batch for a clerk to confirm, because the agent is still in intake. The rest, around 9 a day, get a short explanation: “Invoice AED 46,200 (UAE dirhams); receipt covers 380 of 400 meters; price difference AED 0.” Omar’s shared-services accounts payable team in India decides. SAP describes a similar idea: when an accounts payable agent’s matching fails, a hook would route the exception for review, notify the team and log the outcome. That post describes this extension capability as coming, not yet available (SAP Community, Joule Studio).
On 4 November a network blip makes the receipt event for document 5000081234 arrive twice, 40 seconds apart. The second run finds a match proposal already in progress and stops.
Then there’s the pump. A pump at a water pumping station raises a vibration alarm through SCADA (supervisory control and data acquisition, the system that monitors the network) at 02:10, and again at 02:13. NextSAP’s design lets the first alarm start a maintenance request agent, which identifies the equipment and drafts a notification for the maintenance planner to approve. The second alarm is attached to the same draft. This mirrors SAP’s Maintenance Request Initiation Agent, which checks for duplicate notifications on the same equipment and asks for confirmation before any record is written. SAP describes that agent as conversational and available through its Early Adopter Care programme (SAP Community, Asset Management FPS02). The alarm trigger is NextSAP’s own addition, and the agent’s availability may have moved on since this was written.
Event, request, workflow or schedule?
| Situation | Best start | Why |
|---|---|---|
| A person needs an answer now | Request, conversational agent | The person is waiting and can confirm |
| Something happened and the reaction needs judgement | Event, autonomous agent | No one needs to remember to ask |
| Something happened and the reaction is a fixed rule | Event, workflow | Cheaper and easier to test than an agent |
| Work is due at a time, not on a happening | Schedule | A daily or monthly run is simpler than an event |
| Thousands of similar events per hour | Event, with batching and limits | Protects cost and downstream systems |
| The event moves money directly | Event, agent proposes only | A person approves before posting |
The catch with events
An event-driven agent reacts within minutes, at any hour, and the source doesn’t even need to know the agent exists.
What events don’t give you is a promise that each one arrives exactly once, or in order. A later event can overtake an earlier one. So the design rule I’d hold every team to is simple: every event-triggered run must be safe to repeat. And none of this removes the need for approval when money, pay or legal outcomes are involved.
Explain it to your CFO
- Some helpers start on their own when something happens, like a delivery arriving, instead of waiting to be asked.
- They check first whether the job is already done, so a repeated alert never means a repeated payment. Anything that moves money is still approved by a person.
Questions for your integration lead
- Which events may wake an agent? I’d keep a short list of high-volume business events that need a judgement step, each with a named owner.
- What’s the duplicate key for each event? Usually the business document number plus event type, checked before any action.
- What happens in an event storm? Put in a rate limit and a queue, and alert the owner when the queue passes a threshold.
Go deeper
Technical detail for architects and developers
SAP Event Mesh supports publishing and consuming business events across hybrid landscapes (SAP Help, SAP Event Mesh). Pick the broker your landscape already standardises on. The agent pattern doesn’t change.
On triggers, SAP describes Joule Studio agents triggered by business events or schedules, and an embedded n8n environment for workflows that respond to events or schedules. The same post marks n8n as on the roadmap and subject to phased rollout, and describes MCP (Model Context Protocol) tools and n8n hooks for extending standard agents as coming “soon” (SAP Community, Joule Studio). SAP’s product page describes Joule Studio creating agents and n8n workflows (SAP, Joule Studio). SAP sources differ on n8n’s availability, so check the current status in the Joule capability watch.
For idempotency I recommend four parts. Take a deduplication key from the event’s business identifiers, write a “claim” record before work starts, check the system of record before any write, and make side effects (postings, emails) carry the key themselves so a retry can’t create a second one.
Duplicates are normal. The A2A (Agent2Agent) specification is one standard that says so plainly: push notifications may be delivered more than once, and receivers should process them idempotently and check the task identifier is one they created (A2A specification). Apply the same discipline to any event an agent consumes.
To handle ordering, carry a timestamp or sequence in the event and ignore stale updates. For storms, put a queue between broker and agent, cap concurrent runs, and batch where judgement allows. Watch cost per event as an operational metric.
SAP describes deployed Joule Studio agents being registered in SAP AI Agent Hub. Record each agent’s triggering events alongside its owner so the inventory shows what can wake it. SAP’s Joule Agents page describes agents executing multistep processes across SAP and non-SAP systems (SAP, Joule Agents), which makes a clear trigger list even more important.
Words you’ll hear
- Event: a message saying something has happened, such as “goods receipt posted”.
- Request: a call asking a system to do something and waiting for the reply.
- Event broker: the service that receives events and delivers them to subscribers, such as SAP Event Mesh.
- Subscriber: an application or agent that has asked to receive certain events.
- Idempotent: safe to run twice, because the second run changes nothing.
- Deduplication key: the identifier used to spot a repeated event, such as a document number.
- Event storm: a sudden flood of events, for example after an outage.
Keep going
- Conversational vs autonomous AI agents
- SAP Integration Suite and Advanced Event Mesh
- Joule Studio and n8n workflows
Independent explainer, not affiliated with or endorsed by SAP SE. SAP, Joule and other SAP product names are trademarks of SAP SE.
Frequently asked questions
What is the difference between an event and a request?
A request asks a system to do something and waits for the answer. An event announces that something has already happened, and any interested application can react to it in its own time.
When should an AI agent start by itself on an event?
When the event is frequent, time matters, and the first step needs judgement, such as reading a document or weighing options. If the reaction is a fixed rule, use a workflow instead.
What does idempotent mean?
Doing something twice has the same effect as doing it once. An idempotent agent checks whether it has already handled an event before acting, so a duplicate event changes nothing.
Can the same event really arrive twice?
Yes. Delivery systems retry when they are unsure a message arrived. The A2A specification, for example, warns that duplicate deliveries of notifications may occur and asks receivers to process them idempotently.
Further reading
- What Is SAP Event Mesh? — SAP
- Joule Studio empowers teams to build trusted, custom agentic solutions — SAP Community
- What's New in Asset Management in SAP Cloud ERP Private 2025 FPS02 — SAP Community
- Agent2Agent (A2A) Protocol Specification — A2A Protocol
- Joule Agents and Assistants — SAP
- Joule Studio — SAP
Continue your trail
You now have the Agent Design context.
Save this guide, continue to the next concept or return to the Knowledge Library with your context intact.
Agent Design
3 resources in this area.
Spotted something out of date, or have a question about this topic? Corrections and questions are always welcome.
Send a note →
