Skip to main content
Workflows are deterministic action flows that execute business logic predictably within your scripts. While AI handles natural conversation, workflows ensure that critical operations—like calculations, conditional routing, data validation, and API calls—happen exactly as programmed, every single time.

Why workflows matter

AI is probabilistic. It generates different responses, interprets inputs creatively, and sometimes makes mistakes. This is great for natural conversation but terrible for business-critical operations. Workflows solve this by providing a deterministic execution layer that runs alongside AI conversations:
  • Predictable: Same input always produces same output
  • Auditable: Every step is logged and traceable
  • Reliable: No hallucinations, no guessing, no errors
  • Testable: Can be validated with unit tests
Think of workflows as the “business rules engine” embedded directly in your conversational AI. The AI talks, the workflow executes.

Workflow vs AI logic

Understanding when to use each is critical: The rule of thumb: If it’s a business rule that must be correct 100% of the time, use a workflow.

Workflow components

Workflows in Iqra AI are built using System Tool Nodes and FlowApp Nodes connected with conditional edges:

Conditional routing

Routes conversation based on variable values:
This is deterministic—if account_type = "Premium", it always goes to the VIP flow.

Mathematical operations

Perform calculations before calling tools or making decisions:
In Iqra AI, you implement this using:
  • Variables to store values
  • FlowApp nodes for complex math
  • Conditional edges to route based on calculations

Data validation

Ensure data meets requirements before processing:
Implementation using DTMF example:

Retry logic

Handle failures gracefully with controlled retries:
Implementation pattern:
Always set maximum retry limits. Infinite loops will cause conversation hangs and poor user experience.

System tools for workflows

Iqra AI provides built-in system tools designed for deterministic operations:

Go To Node

Jumps to a specific node in the script:
Use cases:
  • Loop back to retry failed operations
  • Jump to different sections based on user type
  • Restart flows after corrections
Example: Retry loop

End Call

Terminates conversation with optional message:
Use cases:
  • End conversation after successful completion
  • Terminate after max retry failures
  • Exit if user says “cancel” or “stop”
Example: Conditional termination

Transfer to Agent

Hands conversation to another agent:
Use cases:
  • Escalate complex issues to specialized agents
  • Route to language-specific agents
  • Transfer to human agents for sensitive matters
Example: Language routing

Add Script to Context

Loads additional capabilities:
Use cases:
  • Add payment flow to booking flow
  • Load verification script when needed
  • Enable additional capabilities mid-conversation
Example: Dynamic capability loading

Send SMS

Sends text messages deterministically:
Use cases:
  • Send confirmation after booking
  • Deliver verification codes
  • Provide appointment reminders
Example: Booking confirmation

Retrieve Knowledge Base

Searches vector database deterministically:
Use cases:
  • Find specific policy information
  • Retrieve product details
  • Look up FAQs
Example: Policy lookup

FlowApps as workflow components

FlowApps execute external integrations deterministically:

Example: Multi-step booking workflow

Every step executes in order, with deterministic error handling.

Advanced workflow patterns

State machine workflows

Implement complex state machines:
Implement using:
  • Variable current_state
  • Conditional edges based on state
  • Go To Node for transitions

Multi-API orchestration

Coordinate multiple services:

Compliance workflows

Ensure regulatory compliance:
Iqra AI’s Secure Sessions feature creates a “clean room” for sensitive data. The workflow processes it deterministically while keeping it hidden from the AI layer.

Timeout and fallback workflows

Handle unresponsive users:

Best practices

Always handle failure paths

Every FlowApp or system tool can fail:
Never assume success.

Use variables to track state

Keep workflows simple

If your workflow looks like spaghetti, break it into multiple scripts:
Use “Add Script” nodes to compose them.

Document complex logic

Use node descriptions to explain why:

Test edge cases

Don’t just test the happy path:
  • What if the API times out?
  • What if the user provides invalid data 5 times?
  • What if two FlowApps conflict?
  • What if the user hangs up mid-workflow?

Use meaningful variable names

Your future self will thank you.

Workflows vs traditional automation

How is this different from tools like Zapier or n8n? Iqra AI workflows are conversational automation—they run while the user is on the phone or in the chat, with full access to conversation history and the ability to ask clarifying questions.

Next steps

Build action flows

Hands-on guide to building deterministic workflows

FlowApps

Build custom integrations as reusable workflow components

Secure sessions

Handle sensitive data in compliant workflows

System tools

Complete reference for built-in workflow tools