For the complete documentation index, see llms.txt. This page is also available as Markdown.

Expense Policy Decision Engine (Policy API Integration)

In Progress

This page is currently under active development. Content may be incomplete, evolving, or placeholder-only. Please check back later for finalized documentation and fully structured examples.

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

Simulates an API integration using GLIK Knowledge. The uploaded invoice is extracted and evaluated against policy rules retrieved via a tag-based knowledge query. If the logic is ambiguous or unmatched, an LLM block provides fallback reasoning before issuing a final approval, rejection, or escalation decision.

📂 Step-by-Step Instructions

1. Create or Upload a Sample Policy in GLIK Knowledge

Create a new memory object with the following JSON content:

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 to policy_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?