architecture

An architecture reference for the Llama Agent Creator application. It explains how a drag-and-drop workflow graph becomes JSON and is then run by one of two execution engines.

In plain words
What is it for?
Use it when developing or debugging Llama Agent Creator. It covers the React Flow editor, saved graph state, the workflow compiler, the intermediate JSON format, and the execution paths.
Why use it?
It gives developers a map of how the application's visual editor connects to its compilers and runtime views. This makes changes to workflow storage, compilation, or execution easier to reason about.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/run-llama/flow-maker/architecture
Clone the repo
git clone --depth 1 https://github.com/run-llama/flow-maker

Made for: Cursor.

Per session 704 This file is loaded in full into every session.
When invoked 704 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00704 $0.00704
Opus 5 $0.00352 $0.00352
Sonnet 5 $0.00141 $0.00141
Haiku 4.5 $0.00070 $0.00070

Measured yesterday against content hash b65e3022522e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

architecture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/architecture.mdc · 44 lines

How it starts

The opening of the file, as written. The whole thing — 44 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Llama Agent Creator Architecture

This document outlines the core architecture of the Llama Agent Creator application, focusing on how the visual workflow graph is translated into executable logic.

Core Components and Data Flow

The application has a clear separation between the visual graph representation, an intermediate JSON format, and two distinct execution engines.

Visual Graph (React Flow) --> workflow-compiler.ts --> WorkflowJson (Intermediate State) --> [RunView.tsx OR typescript-compiler.ts]

  1. Visual Graph Editor (src/components/AgentFlow.tsx):

    • This is where the user builds the agent workflow using a drag-and-drop interface powered by @xyflow/react.
    • The state of the graph (nodes and edges) is saved to localStorage.
  2. Workflow Compiler (src/lib/workflow-compiler.ts):

    • This is a critical module that acts as a bridge between the UI and the execution logic.
    • It takes the raw nodes and edges from the React Flow state.
    • It processes this graph structure and compiles it into a standardized intermediate representation, WorkflowJson. This JSON object describes the nodes, their connections (via an event-based system), and their configurations.
  3. Execution Engines: The WorkflowJson can be consumed by two different parts of the application to execute the workflow:

    • Interactive Runner (src/components/RunView.tsx):
      • Provides an in-browser, step-by-step execution of the workflow.
      • It loads the graph from localStorage, uses workflow-compiler.ts to get the WorkflowJson, and then walks through the nodes.
      • It implements the logic for each node type (e.g., 'promptLLM', 'userInput', 'decision') directly, making API calls to the backend (/api/...) as needed.
      • It visually highlights the currently active node on the graph and provides a chat interface for user interaction.
      • This provides a way to debug and test the workflow interactively.

Read the full file on GitHub · 44 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 44 lines · 704 tokens per session scan A b65e3022522e

Subscribe to this mod's changes

architecture is a cursor rule published in the GitHub repository run-llama/flow-maker (211 stars, last pushed 8mo ago), licensed MIT. It adds 704 tokens to every session, about $0.0035 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.