logo

Are you need IT Support Engineer? Free Consultant

Integrate a Pro-Code CAP A2A Agent with Joule

  • By sujay
  • 24/08/2026
  • 6 Views

Overview

 

In my previous blog Build a Pro-Code A2A Agent for SAP S/4HANA Cloud with the CAP Agent Plugin (Node.js), we deployed a pro-code CAP agent to SAP Cloud Foundry. This article shows how to surface that agent inside Joule — SAP’s AI copilot — which is integrated with SAP Work Zone.

 

Prerequisites

 

Procedure

 

Step 1 — Create a BTP Destination for the CAP A2A Agent

 

In your BTP sub-account, create a destination that points to the deployed pro-code CAP A2A Agent service URL.

 

Step 2 — Build the Joule Pro-Code Capability

 

Create a joule-capability/ folder in your project with the following files.

Jacky_Liu1_1-1787537641748.Png

 

joule-capability/functions/call_agent.yaml
parameters:
– name: contextId
optional: true
– name: taskId
optional: true

action_groups:
– actions:
– type: status-update
message: <? “Processing your delivery request…” ?>

– type: agent-request
agent_type: remote
system_alias: OutboundDeliveryAgent
body: >
<? (contextId == null || contextId.isEmpty()) && (taskId == null || taskId.isEmpty())
? null
: ‘{ “contextId”: “‘ + contextId + ‘”, “taskId”: “‘ + taskId + ‘” }' ?>
result_variable: result

– type: set-variables
variables:
– name: contextId
value: <? result.body.contextId ?>
– name: taskId
value: <? result.body.id ?>

– type: message
message:
type: text
content: “<? result.body.status.message.parts[0].text ?>”
markdown: true

result:
contextId: “<? contextId ?>”
taskId: “<? taskId ?>”

 

joule-capability/scenarios/invoke_agent.yaml
description: >
Invoke this agent for anything related to SAP S/4HANA outbound deliveries.
Call this when the user asks to look up delivery documents, check delivery
items, create a new outbound delivery, or query the status of a shipment.
Examples: “Show me the outbound deliveries for shipping point 1000”,
“What items are in delivery 80000012?”,
“Create a delivery from sales order 5000001”,
“List all deliveries for this week”.

target:
type: function
name: call_agent
parameters:
– name: contextId
value: $capability_context.contextId
– name: taskId
value: $capability_context.taskId

capability_context:
– name: contextId
value: $target_result.contextId
– name: taskId
value: $target_result.taskId

 

joule-capability/capability_context.yaml
variables:
– name: contextId
– name: taskId

 

joule-capability/capability.sapdas.yaml
schema_version: 3.28.0

metadata:
namespace: joule.ext
name: capagents4_a2a
version: 1.0.0
display_name: “Outbound Delivery Agent”
description: An A2A agent for managing SAP S/4HANA outbound deliveries. Handles querying delivery documents, delivery items, and creating new outbound deliveries.

system_aliases:
OutboundDeliveryAgent:
destination: capa2as4

 

joule-capability/da.sapdas.yaml
schema_version: 1.4.0
name: capagents4_a2a
capabilities:
– type: local
folder: ./

 

Step 3 — Deploy the Joule Capability

 

Log in with the Joule CLI and deploy the capability:
joule login –apiurl “<joule url>” -a “<ias url>” -c “<client id>” -s “<client secret>” –username “<user name>” –store-password –no-app-tid

joule deploy -c joule-capability/da.sapdas.yaml

Jacky_Liu1_2-1787537670641.Png

 

 
Jacky_Liu1_3-1787537682434.Png

 

Step 4 — Test the Deployed Capability

 

List deployed capabilities and launch a local test session:
joule list

joule launch

 

Jacky_Liu1_4-1787537706681.Png

 

Jacky_Liu1_5-1787537716013.Png

 

 

Step 5 — Integrate the Capability with Unified Joule in SAP Work Zone

 

Update the SAP Digital Assistant with the new capability:
joule update “sap_digital_assistant” –capability-file joule-capability/capability.sapdas.yaml

Jacky_Liu1_6-1787537736756.Png

 

Step 6 — Test the Agent in SAP Work Zone

 

Open Joule in SAP Work Zone and interact with the outbound delivery agent.

Jacky_Liu1_7-1787537759293.Png

 

Jacky_Liu1_9-1787537795355.PngJacky_Liu1_10-1787537805572.Png

 

 

The End! Thanks for your time! Jacky Liu

Source link

Leave a Reply

Your email address will not be published. Required fields are marked *

Chat with us on WhatsApp!