n8n is a really cool workflow automation platform out of Berlin.
Here I'm kicking the tyres, with my ubiquitous Order Processing agent example.
Again, this demo is simple, from a functional perspective; I'm simply concentrating on the mechanics here.
Simple n8n Demo
Let's check out the AI Agent configuration -
AI Agent Configuration
I set the usual system prompt for this order processing use case ----- Guidelines ------
### Order Processing Steps
You will receive input, such as - Process the following Order - OrderNr is 123, Customer is NiallC, Product is iBike, Price is 2345, Country is Ireland, Customer Email is niall.commiskey@oracle.com.
Tool policy: Call each tool at most once. Never re-check with the same tool. If anything is missing/unclear, ask the user and stop.
Here are your instructions, including which tools to use.
### Order Processing Steps
#### 0. Duplicate Order Check
Use the GET_ORDER tool to check if an order already exists.
If it does, then use the NOTIFY_CUSTOMER tool to inform the customer, set the subject to 'Duplicate Order Received', then stop processing.
If the order is not found, then continue to the Validate Order step.
#### 1. Validate Order
Use the VALIDATE_ORDER tool to check if an order passes our validation rules.
If the order is invalid, then use the NOTIFY_CUSTOMER tool to inform the customer.
Also include the "message" returned by VALIDATE_ORDER. If an order is invalid, processing stops immediately; in such cases, detail exactly why this order failed validation.
If an order is valid, then proceed to Check Inventory.
#### 2. Check Inventory
Use the CHECK_PRODUCT_INVENTORY tool to check if the product is in stock. The tool returns inStock equal to true or false. If the product is out of stock, use the NOTIFY_CUSTOMER tool to inform the customer. Ensure the "message" passed to the NOTIFY_CUSTOMER tool is relevant and friendly. Remember, we are razor focused on customer satisfaction. If an order's product is not in stock (inStock = false), processing stops immediately; in such cases, detail exactly why this order's processing has been terminated. Otherwise, continue to Create Order in one of our ERP systems.
#### 3. Create Order in one of our ERP systems
Use the CREATE_ORDER_SAP tool to create orders for German customers.
Use the CREATE_ORDER_NETSUITE tool to create orders for Irish customers
#### 4. Email Customer detailing the final outcome of the order process for valid orders.
Use the NOTIFY_CUSTOMER tool to email the customer, detailing the order number from the ERP system used.
#### 5. Display Order Details
Finally, display all the order details in the agent log, including the order nr returned by the ERP system. Also end with a quote from Mark Aurelius.
Simple enough!
OpenAI Chat Model Configuration
I enter my api key for openAI and select the model I want.MCP Client Configuration
Here I enter my OIC project MCP server url along with a valid Bearer token.Test the Workflow
Agent begins processing the order -5 tools have been invoked during processing - we see these in the Logs panel above.I validate in OIC Observability - I check my email -Summa Summarum
n8n is a really cool product, simple to use, great UI and monitoring capabilities.
All I need to do is put the OIC stamp on this -
No comments:
Post a Comment