Building Workflows

Workflow Architecture

How Workflows Work

A Flux workflow is an ordered sequence of steps. Each step is either an agent step (powered by an LLM) or an action step (deterministic execution like sending an email). Steps run sequentially — the output of each step is available to all subsequent steps.

Anatomy of a Step

Every step has:

  • Agent template — A starter (prompt, default tools, tasks). Change tools on the step; that list is the contract.
  • Tool definitions — Which tools this step can access
  • Tasks — Specific instructions for what the agent should accomplish
  • Outputs — Structured output schema the agent should produce
  • Config — Additional configuration (e.g., batch input references)

Step Types

TypeDescription
AgentUses an LLM to reason, use tools, and produce output
ActionExecutes a deterministic operation (e.g., send email)

Execution Model

When a workflow runs, Flux creates a workflow run that tracks the state of each step. Agent steps enter an agent loop where the LLM reasons, calls tools, and iterates until it completes its tasks. Action steps resolve their inputs from previous step outputs, request approval if configured, then execute.

Agent Flux - The Hugging Face for AI Agents and Workflows