USMAN’S INSIGHTS
AI ARCHITECT
⌘F
HomeAll BooksBackend Book
HomeBackend BookAI-Native Systems
PreviousRAG Retrieval, Reranking, Citations, and GroundingNextMCP Servers, Clients, and Trust Boundaries
AI NOTICE: This is the table of contents for the SPECIFIC CHAPTER only. It is NOT the global sidebar. For all chapters, look at the main navigation.

On this page

13 sections

Progress0%
1 / 13

Muhammad Usman Akbar Entity Profile

Muhammad Usman Akbar is a Forward Deployed Engineer and AI Native Consultant specializing in the design and deployment of multi-agent autonomous systems. Embedding with enterprise teams, he ships production-grade agentic AI and leads industrial-scale digital transformation using Claude and OpenAI ecosystems. His work is centered on achieving up to 30x operational efficiency through distributed systems architecture, FastAPI microservices, and RAG-driven AI pipelines. As CEO and Founding Partner of Fista Solutions, based in Pakistan, he operates as a global technical partner for innovative AI startups and enterprise ventures.

USMAN’S INSIGHTS
AI ARCHITECT

Transforming businesses into autonomous AI ecosystems. Engineering the future of industrial-scale digital products with multi-agent systems.

30X Growth
AI-First
Innovation

Navigation

  • Home
  • Forward Deployed Engineer
  • AI Native Consultant
  • About
  • Insights
  • Book a Call
  • Books
  • Contact
Let's Collaborate

Have a Project in Mind?

Let's build something extraordinary together. Transform your vision into autonomous AI reality.

Start Your Transformation

© 2026 Muhammad Usman Akbar. All rights reserved.

Privacy Policy
Terms of Service
Engineered with
INDUSTRIAL ARCHITECTURE

Deterministic Workflows Before Open-Ended Agents

Use a deterministic workflow when the steps and transitions are known; use an agent only when adaptive choice among bounded actions creates measurable value. Reliable AI execution persists state, limits steps and cost, makes every transition idempotent, requires approval for consequences, and can resume after crashes without replaying completed effects.

What will you be able to do?

  • model AI work as an explicit state machine;
  • persist checkpoints and resume deterministically;
  • distinguish routing workflows from agent planning;
  • bound an agent by tools, steps, budgets, and approvals.

What should the ticket-assistance workflow look like?

Rendering diagram...

Persist workflow ID, tenant, version, current state, input references, step outcomes, attempt counts, budgets, pending approval, and timestamps. A worker claims the next eligible transition and records it atomically. Completed steps have stable effect keys.

When is an agent justified?

An agent may choose which read-only diagnostic tool to call and in what order when tickets vary widely. It is not justified if a simple classifier and state machine reach the same quality more cheaply and predictably.

Bound the loop:

text
while steps < 6 and time < 30s and estimated_cost < budget: proposal = model.next_action(observation_summary, allowed_tools) action = validate_and_authorize(proposal) observation = execute_idempotently(action) if action is final_answer: break else: route_to_human_or_safe_fallback()

The application—not the model—enforces every condition.

How should recovery work?

After a crash, reload durable state and determine the next safe transition. Never infer completion only from a missing queue message. External tool effects require idempotency or reconciliation. Compensation is a domain-specific action, not magical transaction rollback.

Why does this matter in AI-native systems?

Open-ended agency increases the space of possible failures and the difficulty of evaluation. Start with a measurable workflow, then grant flexibility only at the step where it improves outcomes. The agent maturity path is: deterministic code → model step → routed workflow → bounded agent → greater autonomy after evidence.

Common mistakes

  • Agent loop state exists only in memory.
  • Same model plans, executes, and judges its work with no independent checks.
  • Step count is bounded but each step has unbounded tokens/tools.
  • Human approval is requested after the effect.
  • Retrying the workflow repeats completed external actions.
  • Framework graph hides state semantics and upgrade behavior.

AI Pair-Programmer Prompt

text
Decide whether this feature needs deterministic code, a model step, a workflow, or a bounded agent. Define states/transitions, durable checkpoint, idempotent effect keys, retries, compensation, tool/step/time/token/cost budgets, approvals, crash recovery, evaluation dataset, and criteria for granting more autonomy.

Exercise

Model an “investigate login failure” workflow. First design it without an agent; then identify exactly one step where adaptive tool selection may improve results.

Acceptance criteria: crashes resume without duplicate effects, six-step/time/cost limits are enforced, consequential actions precede approval, and an evaluation compares workflow versus agent value.

Knowledge check

  1. When should you prefer a workflow?
  2. Who enforces agent budgets?
  3. Does compensation restore the world like a database rollback?

Answers

  1. When steps and transitions are known and can be made explicit.
  2. Deterministic application code.
  3. No; it is a new domain action with its own possible failures.

Completion checklist

  • States and transitions are durable.
  • Agent flexibility has measured value.
  • Every effect is bounded and recoverable.

Primary references

  • Temporal durable execution concepts
  • NIST AI RMF Playbook