Custom Sales Order Creation Agent Using Joule Studio
Hi Everyone!
In this blog, we will see how we can create a simple custom Joule Agent to create a sales order using Joule Studio. We will also trigger an email notification once the sales order creation is completed successfully.
Pre-requisites
Before starting, we need to ensure that following destinations are configured in SAP BTP subaccount.
Destination to API_SALES_ORDER_SRV API
Destination to Gmail for Email Notifications
This will be used to trigger email notifications once the sales order is created successfully.
Below is a basic custom agent in Joule Studio consisting of One Joule Agent and One Joule Skill
If we talk about the Joule Agent, I have instructed it to:
- Collect mandatory parameters required to create a Sales Order
- Trigger the sales order creation skill once all required inputs are collected
The overall flow as we can see below :
- Receive the inputs from the user
- Ask the user for confirmation of provided parameters before creating the sales order
- Call the API to create the sales order
- Display the created sales order number to the user
- Trigger an email notification after successful creation
Testing the Agent
Now let’s test the solution.
I will start by asking: “Please help me create a sales order.” As per the instructions, skill sales order create trigged, and requested user to input mandatory parameters.
Let's intentionally skip one mandatory parameter.
As expected, our agent prompted to provide missing parameter i.e. Material. On the right hand side, we can see below that the agent has successfully extracted the provided parameters.
Now, let’s confirm the details.
Great! The backend API is called successfully, and the sales order 10 is created.
Email Notification Trigger
Once the Sales Order is created successfully, the workflow also triggers an email notification.
Let’s validate the Sales Order in the system too.
We can see that Sales Order number 10 has been created successfully.
This is just a simple example, but the same approach can be used to build more advanced business scenarios.
Stay Tuned
I will be posting more advanced and complex custom Joule agent scenarios soon.
If you have any ideas or use cases that you would like me to build & explore, feel free to share them in the comments section.
Thank you! 😊