Examples
Annotated, runnable Flux examples — from "hello world" through scheduled workflows to full multi-step pipelines. Every example is from the Flux repository, regenerated against the current source.
Every example here lives in the Flux source tree under examples/. Each page renders the current source verbatim, plus a one-line context note and the command to run it. If the source changes upstream, the page changes with the next regen.
Top-level examples
Twenty-one single-file examples cover the core surface — one feature each, kept small enough to read in a sitting. Start with these if you are new to Flux:
- Hello World — the smallest workflow you can write
- Simple pipeline — tasks chained in sequence
- Parallel tasks — fan out with
parallel(...) - Subflows — workflows calling other workflows
- Pause — pause and resume with operator input
- GitHub stars — a real HTTP call, retried and cached
- Scheduled workflow — cron-driven runs
- Using secrets — pull credentials at task time
- Output storage — offload large outputs to disk or S3
- Determinism — what the replay engine guarantees
The full set also covers cancellation, sleep, graph composition, task progress, resource requests, dataframe-with-pause, multiple pause points, and a couple of AI samples. Browse the sidebar for the complete list.
Full pipelines
Longer tutorials that build production-shaped systems end-to-end. Each one walks through five to eight stages with prose explaining why the boundaries fall where they do.
- End-to-end RAG application — extract, embed, store, retrieve, generate
- Document processing pipeline — OCR, structured extraction, classification, indexing
- Customer support automation — email ingest, triage, draft, human approval, send
AI agent examples
Flux ships dozens of AI agent examples under examples/ai/ in the source repository — conversational agents, tool use, planning, RAG, streaming, sub-agents, and more. Each script is its own page in the AI / Agents sub-group; browse the sidebar for the full set. For the canonical recipes, read Agents → Patterns.