SampleSampletypeA worked example you read or clone. Evidence: it demonstrates, it never provides.See every one →What this type is →by SAPby SAPoriginPublished by SAP itself. A visible facet, never an input to a reading — a dormant official plugin reads exactly like a dormant independent one.See every one →Reference

SAP-samples/btp-joule-a2a-pro-code-agent

A reference Agent-to-Agent implementation on SAP BTP that lets Joule delegate sales-quotation optimisation to a CAP pro-code agent using SAP-RPT-1 for forecasting.

A CAP agent built with LangGraph and the SAP Cloud SDK for AI implements the Agent-to-Agent protocol so that Joule can delegate a task to it as a third-party agent rather than call a fixed skill. The worked example is a Sales Optimization Agent: given a sales inquiry, it fetches payment terms and discounts, generates several fictional quotations, and scores them with the SAP-RPT-1 forecasting model on conversion probability, payment delay and a win-versus-customer-win rating before returning the top three to the user in Joule. A webhook server handles asynchronous push notifications for tasks that run long, and Terraform scripts provision the full BTP landscape: subaccount, Cloud Foundry, IAS trust, Joule, AI Core and HANA.

Facts

Last pushLicenceApache-2.0

Where it sits

Lives in
Demonstrates
Agent toolingCAPAgent toolingcapabilityBuilding an agent into your own application — the tools it may call, the state it keeps between turns, and the framework it runs in. Distinct from MCP servers, which expose an application to somebody else's agent, and from agent guidance, which is knowledge handed to a coding agent.

Who is behind it

SAP SamplesSAP SamplesOrganisationMaintains this
In the atlas: maintains 222
@SAP-samples
maintainerjulian-schambeckPersonContributes to this
In the atlas: contributes to 6
@julian-schambeck
Kay SchmitteckertPersonContributes to this
In the atlas: contributes to 6
@kay-schmitteckert
mar-holPersonContributes to this
In the atlas: contributes to 2
@mar-hol
RobinPersonContributes to this
In the atlas: contributes to 3
@RobinPurschwitz
4 contributors

What it declares

Every artifact

Type
Sample
Origin
By SAP
Use as
A reference

As a sample

Form
A reference application

Connections1

SAP-samples/btp-joule-a2a-pro-code-agent connectionsSAP-samples/btp-joule-a2a-pro-code-agentPROVIDES→ demonstrates1demonstrates authoredAgent tooling

ArchitectureBetaRead from the sample's deployment descriptor. Some of the connections it states are not drawn yet.

as 2 deployment descriptors state it at 28a2883, read
SAP BTP, Cloud Foundry Runtimecode-based-agentcode-based-agent-srv, nodejscode-based-agent-srvSAP AI Core, aicore, extendedSAP AI CoreSAP Destination service, destination, liteSAP DestinationserviceSAP Application Logging service for SAP BTP, application-logs, liteSAP ApplicationLogging servicefor SAP BTP
SAPnot SAP's, or the project's own

Bound, and not drawn

Documented, with no instance in the document

SAP BTP, Cloud Foundry Runtimewebhook-capmta.yaml, module webhook-cap-router, requires webhook-cap-uaabindingOAuth 2.0, outboundmta.yaml, module webhook-cap-router, requires webhook-cap-srv-apiwebhook-cap-srv-apimta.yaml, module webhook-cap-srv, requires webhook-cap-uaabinding, HTTP, outboundSAP Authorization and Trust Management service, xsuaa, applicationSAP Authorizationand TrustManagement servicewebhook-cap-router, approuter.nodejswebhook-cap-routerwebhook-cap-srv, nodejswebhook-cap-srv
SAPnot SAP's, or the project's ownauthenticationstated in the document

Documented, with no instance in the document

README

quoted from SAP-samples/btp-joule-a2a-pro-code-agent under Apache-2.0, read
SAP-samples/btp-joule-a2a-pro-code-agent/README.mdOn GitHub

Reference Implementation for A2A-Compliant Pro-Code Agents on SAP BTP with Joule Integration and RPT-1

REUSE status

Modular reference implementation covering a full-fledged agentic scenario end to end including Joule Integration via the A2A Protocol.

📖 Introduction & Purpose

This repository serves as a reference implementation for building enterprise-grade, "Pro-Code" Agents on the SAP Business Technology Platform (BTP). It demonstrates a modular, full-fledged agentic scenario from end-to-end, adhering to best practices for BTP development.

The primary goals of this project are:

  • A2A Compliance: Implementing Agent-to-Agent (A2A) Protocol compliant agents ("3rd Party Agents") to set scope, identify specification gaps, and contribute upstream fixes.
  • Joule Integration: Facilitating outbound A2A integration where Joule acts as the client for BTP-hosted or remotely hosted 3rd party agents.
  • Leveraging SAP-RPT-1 to run use cases like forecasting (e.g., Payment Delay, New Product Introduction) or simulation.

🏗️ Architecture

Architecture

This simplified architecture is enhanced with access to RPT-1 as a tool and is based on reference architectures from the SAP Architecture Center: Integrating AI Agents with Joule and Pro-Code AI Agents on SAP BTP.

✨ Features

The project features are organized by status, ranging from core A2A compliance to advanced integrations.

Feature / ModuleStatusDescription
A2A-Compliant Agent✅ DoneFull implementation of the A2A protocol specifications, capable of handling complex agentic workflows.
Pro-Code AI Agent Implementation✅ DoneBuilt using LangGraph (TypeScript) on CAP, integrated with the SAP Cloud SDK for AI to access models via the Generative AI Hub. Includes Human-in-the-Loop patterns.
Joule Integration (A2A)✅ DoneIntegration into Joule via the A2A protocol
Asynchronous Communication✅ DoneImplementation of Webhooks for A2A PushNotifications. Includes a WebSocket-based server and React UI to visualize status updates as they arrive.
Extension Sample✅ DoneExamples of custom logic extensions (e.g., mocking responses) to bypass LLM generation for testing or specific logic handling.
Advanced Forecasting✅ DoneLeveraging SAP-RPT-1 to run use cases like forecasting (e.g., Payment Delay, New Product Introduction) or simulation.
Infrastructure as Code✅ DoneFull E2E setup via Terraform.

🛠️ Tech Stack & References

📂 Project Structure

The repository is organized into modular components to simulate a distributed agent environment:

DirectoryDescription
a2a-agentThe core Pro-Code Agent.
• Written in TypeScript on CAP.
• Uses LangGraph for agent logic.
• A2A Compliant.
• Connects to Generative AI Hub via SAP Cloud SDK for AI.
joule-integrationConnecting Joule via the A2A protocol to the a2a-agent using action type agent-request.
webhook-serverA WebSocket-based CAP server for handling A2A PushNotifications.
• Backend (CAP): Receives StatusUpdates from the agent.
• Frontend (React.js): Displays incoming status updates live.
terraformInfrastructure as Code for full E2E BTP setup.
• Provisions subaccount, Cloud Foundry, IAS trust, Joule, AI Core, HANA, and all service bindings.
• Uses SAP BTP, Cloud Foundry, and SCI Terraform providers.

🚦 Getting Started

💡 Use Case: AI-Assisted Sales Inquiry Optimization

Infographic

User Story

As a Sales User at BestRun, I want to use the Joule AI Copilot to automatically analyze, generate, and score optimized sales quotation options for incoming customer inquiries, So that I can maximize the sales conversion probability, balance profitability, and respond to customers (like Altinova) faster with the best possible terms.

Acceptance Criteria
  • The Sales User can trigger the optimization directly from the Task Center via Joule.
  • Joule must automatically identify and delegate the request to the specific Sales Optimization Agent (SOA) via A2A protocol.
  • The SOA must auto-retrieve necessary data (Payment Terms, Discounts) and generate multiple fictional sales quotations.
  • The system must use the RPT-1 forecasting model to score these quotations based on Conversion Probability, Payment Delay, and a "Win/Win" rating.
  • The user is presented with the Top 3 distinct quotation options with reasoning for manual finalization.

Use Case Specification

Use Case Name: Optimize Sales Inquiry via Agent-to-Agent (A2A) Delegation

Actors
  • Sales User (SU)
  • Joule: The AI Assistant.
  • Sales Optimization Agent (SOA): The backend autonomous agent.
  • Customer (Altinova): Trigger entity (sender of inquiry).
Preconditions
  1. A new Sales Inquiry from Customer "Altinova" exists in the system.
  2. The Sales Inquiry appears as an open item in the SU’s Task Center.
  3. The SU has permissions to access Joule and Sales tools.
Main Success Scenario (Happy Path)
alt [Missing Data?] opt [Long Processing Time] Sends Sales Inquiry Displays new task in Task Center Please optimize latest Sales Inquiry from Altinova Delegates Optimization Task Ask for missing Details (e.g. Inquiry ID) Provides Details Fetch Payment Terms, Discounts, Master Data Return Data Assets Execute Tool: createFictionalSalesQuotations Evaluate Variants (Conversion, Delay, Rating) Return Predictions & Scoring Notify: Task will take longer Push Notification: Result is ready later Return Top 3 Quotations + Reasoning Display Options for manual optimization Finalize & Create Quotation A2A (Agent-to-Agent) Protocol Customer (Altinova) System (Task Center) Sales User Joule (AI Copilot) Sales Optimization Agent ERP/Tools RPT-1 (Forecasting Model)
StepActorAction
1SystemDisplays a notification/dot in the Task Center indicating a new Sales Inquiry from Altinova.
2SUOpens Joule (AI Copilot) and inputs the command: "Please optimize the latest Sales Inquiry from Customer Altinova."
3JouleAnalyzes the intent and available assets. Identifies the Sales Optimization Agent (SOA) as the suitable tool.
4JouleInitiates Agent-to-Agent (A2A) handover and transmits the task to the SOA.
5SOAAccepts the task and verifies context. Validates that the Inquiry ID and Customer Name are available.
6SOATool Execution: Retrieves available data assets (Payment Terms, applicable Discounts, Master Data).
7SOATool Execution: Uses createFictionalSalesQuotations to generate multiple combinatorial variants of the quotation.
8SOAReasoning: Applies the Forecasting Model RPT-1 (in-context learning) to evaluate the variants based on: Sales Conversion Probability, Expected Payment Delay, Rating (Win vs. Customer Win).
9SOASelects the Top 3 best-performing fictional quotations.
10JouleDisplays the Top 3 options to the SU, including the reasoning/score for each.
11SUReviews the options and selects/refines the preferred quotation for creation.
Alternative Flows

A1. Missing Data (Step 5)

  • If the SOA detects missing details (e.g., Sales Inquiry ID is ambiguous), it halts the automatic flow.
  • SOA/Joule asks the SU a clarifying question to retrieve the missing information.
  • Once answered, the flow resumes at Step 6.

A2. Long Processing Time (Step 7-9)

  • If the combinatorics or RPT-1 model processing takes longer than the standard interaction threshold:
  • Joule informs the SU that the calculation is running in the background.
  • System sends a Push Notification to the SU once the Top 3 options are ready for review.

👥 Contributors & Contacts


Apache-2.0, read

Details

Sources3
Added by handdiscovered herechecked
github.com/SAP-samples/btp-joule-a2a-pro-code-agenttree, pushes, contributors, CIchecked
README.mdquoted, and what the entry declareschecked

Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.

Compatibility and provenance
discovered viaAdded by hand
first seen in the atlas
ecosystem and domaincap, ai-and-agents
Contributors4

From the repository’s contributor list, .

History in the atlas1
  1. First seen.
For your agent
Ref
artifact:sap-samples-btp-joule-a2a-pro-code-agent
JSON
/artifacts/sap-samples-btp-joule-a2a-pro-code-agent.json
MCP
Connecting an agent