AnythingLLM Agent Flows: Building No-Code Automation Workflows
Build no-code agent flows in AnythingLLM by chaining blocks and variables. Automate multi-step tasks without coding. Includes step-by-step tutorial.
- Agent flows chain together predefined blocks (Web Scraper, API Call, LLM Instruction) without code.
- Variables pass data between blocks using ${variableName} syntax.
- A typical flow fetches a webpage, extracts content with an LLM, and outputs the result in seconds.
- Flows run in AnythingLLM's visual builder; no Python, YAML, or deployment knowledge required.
Agent flows in AnythingLLM are no-code visual builders that chain together steps to automate multi-action tasks. Instead of writing Python code or YAML, you build flows by connecting blocks--Web Scraper, API Call, LLM Instruction--and passing data between them using variables. This guide walks you through creating your first flow.
What Are Agent Flows in AnythingLLM?
Agent flows are no-code workflows that chain together predefined blocks to perform multi-step tasks. Unlike traditional agent skills (which represent individual capabilities), flows let you orchestrate several steps in sequence, passing data between blocks using variables. Think of flows as visual programming: you arrange blocks on a canvas instead of writing code.
AnythingLLM itself is an open-source platform (66.8K GitHub stars) for building AI applications without coding. Agent flows are one of its core features. If you have experience with tools like Make.com or n8n, flows will feel familiar: they are a no-code alternative to writing Python scripts or YAML pipelines. For a broader overview of agents in AnythingLLM, see the agents guide.
The key difference between flows and agent skills: a skill is a single, reusable capability (like 'fetch a URL' or 'call an API'). A flow orchestrates multiple skills in sequence. You might fetch a URL with one block, extract content with another, summarize it with an LLM block, and write the output to a file. Each block is a skill; the combination is a flow.
Flows solve the problem of multi-step automation. If you need your agent to do one thing (fetch a page), use a skill. If it needs to do three things in order (fetch, extract, summarize), use a flow. This is why flows are sometimes called 'agent orchestration' or 'agentic workflows'.
Getting Started: Accessing the Flow Builder
To create your first flow, log into AnythingLLM, navigate to your workspace, click 'Agents', then select 'Create New Flow'. The flow builder opens with a blank canvas. You'll see a default 'Flow Info' block at the top where you set the flow name, description, and initial variables. Every flow ends with a 'Complete' block that outputs the result.
The AnythingLLM interface assumes you have already set up a workspace with at least one LLM provider configured (OpenAI, local Ollama, etc.). If you haven't, go to Settings > Models and add your LLM endpoint. Flows also need access to web browsing and API calling, so make sure your workspace permissions are set correctly. To understand the full cost of running flows with different LLM providers, check the AnythingLLM pricing guide.
When you open the flow builder for the first time, you'll see a blank canvas in the center, a 'Flow Info' block at the top (set your flow name here), a sidebar on the right with available blocks to add, and a 'Start' button to test your flow. Click any block in the sidebar to add it to the canvas. Blocks snap together; connect the output of one block to the input of the next. If you add a Web Scraper block followed by an LLM Instruction block, the LLM automatically receives the scraped content as input.
You can only have one 'Complete' block per flow--this is where your flow ends and returns its result. Every path through your flow must lead to Complete; otherwise, the flow hangs.
Understanding Blocks and Variables
Blocks are the building blocks of a flow. Each block performs one action: fetch a webpage, call an API, run an LLM instruction, read a file, or write output. Variables are placeholders that hold data: a URL string, API response JSON, or user input. Blocks pass data between each other by assigning values to variables, then referencing those variables in downstream blocks using the syntax ${variableName}.
AnythingLLM provides five main block types:
- Web Scraper: Fetches a URL and extracts the HTML or text content.
- API Call: Sends HTTP requests (GET, POST, etc.) to any endpoint. Passes the response as JSON.
- LLM Instruction: Sends a prompt to your configured LLM. Receives input data and returns the LLM's response.
- Read/Write File: Reads from or writes to the filesystem on your AnythingLLM host.
- Model Router: Conditionally routes data to different blocks based on LLM reasoning (e.g., 'if sentiment is negative, route to one block; if positive, to another').
Variables are scoped to the flow. You create a variable in one block's 'Output' section (e.g., 'scraped_content'), and reference it in a downstream block using ${scraped_content}. If a Web Scraper block outputs HTML to a variable called 'page_html', and the next block is an LLM Instruction, you can pass the prompt: 'Summarize this: ${page_html}'. The LLM will see the actual HTML, not the literal string '${page_html}'.
Type matters. If a Web Scraper outputs text, and you try to pass it to an API Call expecting JSON, your flow will error. Test your variable types early by using the 'Debug' panel (covered below).
Tutorial: Build a Real Agent Flow
This example flow fetches the latest HackerNews frontpage, extracts article links, summarizes the top three articles, and outputs a JSON file with summaries. It demonstrates Web Scraper, LLM Instruction, and file-handling blocks in a real workflow. Total flow time is typically 30-60 seconds depending on LLM latency.
Step 1: Create the flow Log into AnythingLLM, navigate to Agents > Create New Flow. Name it 'HackerNews Summarizer'. In the Flow Info block, click 'Add Variable' and create a variable called 'max_articles' with default value 3. This will let you control how many articles to summarize.
Step 2: Add a Web Scraper block Click the '+' button on the canvas and select 'Web Scraper'. Set the URL to 'https://news.ycombinator.com'. The scraper fetches the page HTML. In the Output section, assign the result to a variable called 'hn_page'. This variable now holds the raw HTML.
Step 3: Add an LLM Instruction block Add another block and select 'LLM Instruction'. Set the prompt to: 'From this HackerNews HTML, extract the titles and URLs of the top ${max_articles} articles. Return as JSON: [{"title": "...", "url": "..."}]'. In the Input field, pass ${hn_page}. The LLM reads the HTML, extracts articles, and returns JSON. Assign the output to a variable called 'articles_json'.
Step 4: Add a second LLM block for summaries Add another 'LLM Instruction' block. Set the prompt to: 'For each article URL in this JSON, fetch and summarize the content in 2-3 sentences. Return the same JSON with a new "summary" field.' Pass ${articles_json} as input. Assign output to 'summaries'.
Step 5: Write to a file (optional) Add a 'Read/Write File' block. Select 'Write'. Set the filename to 'hn_summaries_${timestamp}.json'. Pass ${summaries} as the content. This saves the output to your AnythingLLM host's filesystem.
Step 6: Complete the flow Add the 'Complete' block. Pass ${summaries} to it. This is the final output visible to the user. Click 'Start' to test the flow. The flow executes top-to-bottom. If any block fails (e.g., the URL is unreachable), the flow stops and shows an error in the Debug panel.
Common Blocks Reference
Each block type has specific inputs and outputs. Understanding their signatures--what they accept and return--is essential for wiring flows correctly. Here's a quick reference for the five main block types and when to use each.
Web Scraper Block Input: A URL (string). Output: Page content (HTML or extracted text, depending on settings). Use when: You need to fetch and parse a webpage. Example: Fetch HackerNews, extract article titles, or scrape product prices.
API Call Block Input: URL, HTTP method (GET/POST/etc), optional headers, optional request body (JSON). Output: Response body (typically JSON). Use when: You need to call an external service or your own backend. Example: Call OpenWeather API to get temperature, or POST data to your CRM.
LLM Instruction Block Input: A prompt (string) and optional context data (passed via ${variables}). Output: LLM response (text or structured format if prompted). Use when: You need AI reasoning, summarization, extraction, or classification. Example: Summarize a scraped article, classify sentiment, or generate a report.
Read/Write File Block Input: For 'Read': a file path. For 'Write': file path and content. Output: For 'Read': file contents (text). For 'Write': confirmation message. Use when: You need to persist output or load previous results. Example: Save flow results to a CSV, or read a config file.
Model Router Block Input: Data to evaluate and routing rules (written in natural language). Output: Routes to different downstream blocks based on LLM reasoning. Use when: You need conditional branching based on content. Example: If sentiment is negative, route to an escalation block; if positive, to a logging block.
Debugging and Best Practices
Use AnythingLLM's Debug panel to inspect variable values at each step. Test each block individually before connecting the full flow. Log variable outputs to a file so you can review what each block returned. Name your variables clearly (avoid 'data1', 'output2').
When you run a flow, the Debug panel shows a timeline of every block execution. Click any block in the timeline to see its exact input and output. This is invaluable for finding where a flow breaks. If an LLM block returns unexpected output, check the Debug panel to see the exact prompt sent and the exact response received.
Common errors and fixes:
-
Variable not found: You referenced ${undefined_var} but it was never created. Check the Output field of the block that should have created it. Variable names are case-sensitive.
-
Type mismatch: A block expects JSON but received text. Convert the variable using an LLM Instruction block ('Parse this text as JSON') before passing to the next block.
-
Timeout: The flow took too long. Web Scraper blocks and API calls can hang if the remote server is slow. Add a timeout setting in the block's configuration (usually 10-30 seconds).
-
LLM hallucination: The LLM made up data instead of extracting real information. Be very specific in your LLM prompts. Instead of 'Extract the price', write 'Extract the price in USD as a number (e.g., 19.99) or return null if no price is visible'.
To test incrementally: disable blocks (right-click > disable) to isolate problems. Run the flow with just two blocks first, then add more. This way, you know which block introduced a bug.
Scaling Agent Flows to Production
A single flow runs once per trigger (e.g., when a user sends a message or an API endpoint is called). To run flows repeatedly or at scale, connect them to AnythingLLM agents or external schedulers. You can also integrate flows via API calls from other tools like Make.com or Zapier.
Once you have a working flow, you'll want to run it automatically. AnythingLLM supports several trigger methods: manual (click 'Start' in the flow builder for dev/testing), agent trigger (attach the flow to an agent so the agent calls it when needed), API endpoint (expose the flow as a REST API so external services can call it), or scheduled (run a flow on a cron schedule, e.g., every day at 9 AM).
For the HackerNews example: you could create an agent that checks your messages for 'Summarize HN today' and automatically runs the HackerNews Summarizer flow, then returns the output to your chat. You can also chain flows. Create a 'Master Flow' that calls other flows as sub-steps. This keeps logic modular--one flow fetches data, another processes it, a third archives it.
Running AnythingLLM reliably at scale requires dedicated infrastructure. If you're running it on your laptop, flows will stop when you shut down. For production use, deploy AnythingLLM on a server or use a managed hosting option like Opsily. Managed hosting ensures your flows run 24/7, with automatic backups and scaling. See the AnythingLLM hosting guide to compare self-hosted vs managed options.
Frequently Asked Questions
What are the building blocks of an AI agent? In agent flow terminology, 'blocks' are the building blocks. AnythingLLM provides Web Scraper, API Call, LLM Instruction, Read/Write File, and Model Router blocks. Each performs a single action. You combine blocks in sequence to build a complete agent flow.
How do I run a flow automatically? Flows can be triggered manually, by an agent, via API, or on a schedule. To run a flow every day, connect it to an AnythingLLM agent with a cron trigger, or use an external scheduler like Zapier or Make.com to call the flow's API endpoint.
Can I use flows with open-source models like Ollama? Yes. As long as Ollama is configured in your AnythingLLM workspace (Settings > Models), LLM Instruction blocks can use it. Flows work with any LLM provider--OpenAI, Anthropic, local Ollama, or others.
What happens if a block times out? If a Web Scraper or API Call exceeds its timeout (usually 10-30 seconds), the block fails and the entire flow stops. You'll see a 'Timeout' error in the Debug panel. Increase the timeout in the block's settings or optimize the remote service.
Can I export or backup my flows? Yes. AnythingLLM's workspace includes a 'Backup' feature that exports all flows as JSON. From the workspace settings, select 'Export' to download a backup file. Import it later to restore your flows.
How do I debug a flow that isn't working? Click the 'Debug' panel after running the flow. You'll see the execution timeline and each block's input/output. Click any block to inspect the exact data it received and returned. Look for type mismatches, missing variables, or unexpected LLM outputs.
Is there a limit to how many steps a flow can have? AnythingLLM doesn't enforce a hard limit, but practical limits exist. Very deep flows (20+ blocks) become slow and prone to errors. Use Model Router blocks to branch logic instead of chaining everything linearly. For truly complex workflows, split into multiple smaller flows.
The Bottom Line
Agent flows in AnythingLLM let you build sophisticated multi-step automations without code. You combine blocks--Web Scraper, API Call, LLM Instruction, file handling--and pass data between them using variables. The builder is visual; the execution is automatic.
The main limitation: flows run in a single process on a single AnythingLLM instance. If you need to scale flows to many concurrent users or run them 24/7 reliably, you need dedicated infrastructure. That's where managed hosting helps.
Start with a simple flow (fetch a URL, summarize with an LLM, save the output). Once you understand blocks and variables, you can build more complex orchestrations. To run flows reliably in production, explore AnythingLLM hosting options.