How gzmilgar/sap_n8n works
This repository is a local SAP CAP + n8n order-approval demo. Its main loop creates an order through CAP, sends a post-commit webhook to n8n, applies an automatic or human approval decision, and writes the result back through CAP; the Fiori list displays the updated status. A second workflow uses an AI agent to look up products and customers and create orders, which re-enters the same approval loop. The workflow files and UI are documented, but their source was not sampled, so those relationships rely on the README.
Main entry points: order-service.js Order Handlers · 01-order-approval.json Approval Workflow · order-service.cds Order OData API · 02-order-agent.json Lookup and Create Tools
Components 15
CAP Order Service
- Order OData API
order-demo/srv/order-service.cds - Order Handlers
order-demo/srv/order-service.js - Decision Actions
order-demo/srv/order-service.js
Order Interfaces
- Order Form
order-demo/app/index.html - Agent Chat
order-demo/app/chat.html - Fiori Order List
order-demo/app/fiori-annotations.cds
n8n Workflows
- Approval Workflow
n8n-workflows/01-order-approval.json - Order Agent
n8n-workflows/02-order-agent.json - Lookup and Create Tools
n8n-workflows/02-order-agent.json - Error Notifications
n8n-workflows/03-error-handler.json - Offline Approval Form
n8n-workflows/04-order-approval-OFFLINE.json
Order Data
- SQLite Order Data
order-demo/db/schema.cds - Product and Customer Data
order-demo/db/data
Other components
- Order User
- Telegram
Connections 17
- Order User → Order Form: enters order
README.md - Order Form → Order OData API: submits order
README.md - Order User → Agent Chat: chats with
README.md - Agent Chat → Order Agent: starts chat
README.md - Order Agent → Lookup and Create Tools: invokes tools
README.md - Lookup and Create Tools → Order OData API: queries and creates
README.md - Order OData API → Order Handlers: dispatches handlers
README.md - Order Handlers → Product and Customer Data: reads product price
order-demo/srv/order-service.js - Order Handlers → SQLite Order Data: creates order
README.md - Order Handlers → Approval Workflow: posts after commit
order-demo/srv/order-service.js - Approval Workflow → Telegram: requests approval
README.md - Approval Workflow → Decision Actions: posts decision
README.md - Offline Approval Form → Decision Actions: posts decision
README.md - Decision Actions → SQLite Order Data: reads and updates
order-demo/srv/order-service.js - Fiori Order List → Order OData API: shows order status
README.md - Error Notifications → Telegram: sends error notice
README.md - Lookup and Create Tools → Approval Workflow: created order triggers
README.md