Skip to Content
Agentlang is open source now!
Agentic Flows

Agentic Flows

In an earlier section, we learned how to design an agent capable of classifying resumes. Now, let’s take that idea further by building a complete business workflow around it — one that can analyze a resume and, if the candidate is selected, automatically schedule an interview.

At a high level, this process looks like a simple flowchart:

resumeReview --> "selected" checkCurrentInterviewSchedule checkCurrentInterviewSchedule --> scheduleInterview

In plain language, this flow reads as:

Start [resumeReview] ├── if result == "selected" ──▶ [checkCurrentInterviewSchedule] │ │ │ ▼ │ [scheduleInterview] │ │ │ ▼ │ (Interview scheduled) └── else ──▶ (End: Candidate rejected)

This concise, human-readable diagram expresses a real business process:

  • First, review the candidate’s resume.
  • If the result is "selected", check the existing interview schedule.
  • Then, schedule the candidate for an available interview slot.

What makes this truly powerful is that this isn’t just a conceptual diagram — it’s valid Agentlang syntax. You can describe workflows like this, and the Agentlang runtime will execute them through collaborating intelligent agents.

Let’s see how this looks in a real module. Below is the updated hr.core module implementing this flow:

src/core.al
module hr.core entity InterviewSchedule { id UUID @id @default(uuid()), assignedTo String, candidate String, interviewDateTime String } agent resumeReview { instruction "Review the resume passed to you, return `selected` if the candidate is a software engineer with more than 10 years of experience, otherwise return `rejected`.", directives [ {"if": "experienced in C++", "then": "selected"}, {"if": "not hands-on in programming", "then": "rejected"} ], scenarios [ {"user": "Software engineering manager with 25 years experience", "ai": "rejected"}, {"user": "C++ programmer with 2 years experience", "ai": "rejected"}, {"user": "C++ programmer with 12 years experience", "ai": "selected"} ], glossary [ {"name": "developer", "meaning": "software engineer", "synonyms": "programmer"} ] } agent scheduleInterview { instruction "Schedule an interview with the candidate. The interviewer must be one of Susan, Joe, or Mat. If the selected interviewer already has an interview scheduled, select another interviewer or assign a date in the future. Interview dates must start from 15-Oct-2025, with times between 9 AM and 3 PM. The current interview schedule (if any) will be available in the context, so there’s no need to query for it.", tools [hr.core/InterviewSchedule] } event checkCurrentInterviewSchedule { } workflow checkCurrentInterviewSchedule { {InterviewSchedule? {}} } flow processResume { resumeReview --> "selected" checkCurrentInterviewSchedule checkCurrentInterviewSchedule --> scheduleInterview } @public agent processResume { role "You are an agent who processes resumes and schedules interviews for selected candidates." }

Understanding What’s Happening

Let’s break this down step by step.

  1. resumeReview agent — This agent analyzes a resume and decides whether the candidate should be "selected" or "rejected". It uses directives and scenarios to guide and fine-tune its behavior, ensuring more reliable and consistent outcomes.

  2. checkCurrentInterviewSchedule workflow — This small workflow acts like a “query node.” It fetches all existing interview schedules and passes that data forward into the flow’s context.

  3. scheduleInterview agent — This agent uses the context (which now includes the current schedule) to decide when and with whom to schedule the next interview. Because the InterviewSchedule entity is listed as a tool, the agent can create or update instances of it directly — meaning it can autonomously manage the scheduling process.

  4. processResume flow — This flow ties everything together. It starts by calling resumeReview. If that returns "selected", it proceeds to checkCurrentInterviewSchedule, and finally to scheduleInterview.

When you invoke the processResume agent, the runtime automatically runs the flow under its name, orchestrating the entire sequence of agents and workflows.


Running the Application

To try it out, start your HR service and run the following commands to simulate a few resumes:

curl -X POST http://localhost:8080/hr.core/processResume \ -H 'Content-Type: application/json' \ -d '{"message": "name: Tom, languages: C++, years of experience: 12"}' curl -X POST http://localhost:8080/hr.core/processResume \ -H 'Content-Type: application/json' \ -d '{"message": "name: Jake, I am a programmer with 23 years experience"}'

Then check the interview schedule to confirm that interviews were created automatically:

curl -X GET http://localhost:8080/hr.core/InterviewSchedule \ -H 'Content-Type: application/json'

If you send a resume that doesn’t meet the selection criteria, the agent will correctly skip the scheduling step — proving that the entire flow behaves as expected, guided by both logic and AI-driven reasoning.


Why Agentic Flows Matter

Agentic Flows are where structure meets intelligence. They give you the power of a traditional workflow engine — sequential logic, branching, and data flow — combined with the reasoning ability of LLM-powered agents.

Each flow acts as a map of intent: it tells the runtime how agents should collaborate to accomplish a goal, while still leaving space for the agents to reason, infer, and adapt based on context.


See First-class Intelligent Agents for a deeper exploration of how Agentlang enables reliable, deterministic agent behavior through its declarative design principles.


Last updated on