Expense Policy Decision Engine (Policy API Integration)
This Expense Policy Decision Engine (Policy API Integration) template is a workshop that builds on the Threshold Memory version of the Expense Policy Decision Engine series of templates and introduces a simulated API integration. Instead of using a real external API, this class uses GLIK Knowledge to simulate an API response containing policy rules (such as spending thresholds and vendor blacklists).
Participants will:
Learn how to use the Knowledge Retrieval Block to simulate calling an external policy API.
Dynamically assign and evaluate retrieved rules in an expense approval workflow.
Understand how internal knowledge objects can act as structured data endpoints.
This simulation sets the stage for connecting to real enterprise APIs in later stages.
🛠️ What You’ll Build
A workflow that:
Accepts an uploaded invoice file
Extracts invoice metadata
Retrieves policy rules (thresholds, blacklists) from GLIK Knowledge
Applies conditional logic to approve, reject, or escalate
Falls back to LLM reasoning if no rule applies
🧩 Workflow Structure
📂 Step-by-Step Instructions
1. Create or Upload a Sample Policy in GLIK Knowledge
Create a new memory object with the following JSON content:
{
"policy_id": "demo_policy_001",
"threshold": 3000,
"blacklist": ["ACME Consulting", "Shady Corp"],
"categories": {
"travel": 1000,
"equipment": 5000
}
}
Apply these tags:
type:policy
demo:true
2. Build the Workflow in GLIK Studio
Required Blocks:
📥 Start
📄 Doc Extractor
🧠 Knowledge Retrieval Block (query:
type:policy AND demo:true
)🧮 Conditional Block (compare values from
invoice_data
topolicy_memory
)🤖 LLM Block (fallback)
✅ Answer or End Block
Variables Used:
invoice_data
policy_memory
approval_result
conversation_notes
🧪 Practice Exercises
Modify the policy memory with a tighter threshold
Add a new blacklisted vendor
Re-upload the workflow and re-run with different invoice PDFs to test the logic path
🧠 Key Concepts
Structured data in memory vs. static config
Simulated API integration
Conditional logic based on dynamic variables
Querying GLIK Knowledge by tag
Using fallback reasoning for exception cases
📌 Next Steps
After this class, learners are ready to:
Integrate real external APIs (e.g., using
API Call
blocks)Use branching logic to support multi-policy contexts
Expand the workflow into a full Expense Audit Engine
Last updated
Was this helpful?