How to Think FlowMason
A comprehensive visual guide to transforming any problem into a working pipeline. Master the mental models, patterns, and decision processes used by pipeline architects.
The Core Mental Model
Every complex task is just a series of simple steps connected by data flow.
Your job: identify the steps, pick the right component for each, and wire them together.
Mental Models for Pipeline Thinking
Use these analogies to reason about your pipelines
The Assembly Line
Think of your pipeline as a factory assembly line. Raw materials (input) enter, pass through stations (stages), and finished products (output) emerge.
The River Delta
Data flows like water. It can split into parallel streams, be filtered, and merge back together.
The Kitchen
Like cooking a complex meal. Some things prep in parallel, some must be sequential, some need quality checks before proceeding.
The 6-Step Design Process
Follow this systematic approach for any pipeline you need to build
Define Your Goal
What outcome do you want?
Start with the end in mind. Clearly articulate what the pipeline should produce. This becomes your north star for every decision.
π§ Ask Yourself
π Examples
β οΈ Common Mistakes to Avoid
- β Vague goals like 'process the data'
- β Multiple unrelated outputs from one pipeline
- β Not considering the consumer of the output
Identify Your Inputs
What data are you starting with?
Document everything you're feeding into the pipeline. Be specific about structure, types, and what's required vs optional. This becomes your input_schema.
π§ Ask Yourself
π₯ Common Input Types
β οΈ Common Mistakes to Avoid
- β Accepting 'any' without validation
- β Not documenting required fields
- β Ignoring edge cases (empty, null, very long)
Decompose Into Steps
What transformations are needed?
Break the journey from input to output into discrete, atomic operations. Each step should do ONE thing well. Think of it as assembly line stations.
π§ Ask Yourself
π¬ Example Decomposition
One big AI prompt that does everything
- β 1. Fetch user purchase history
- β 2. Analyze preferences (AI)
- β 3. Get matching products from catalog
- β 4. Rank products for user (AI)
- β 5. Generate personalized email copy (AI)
- β 6. Format as HTML template
β οΈ Common Mistakes to Avoid
- β Mega-prompts that try to do everything
- β Steps with unclear boundaries
- β Mixing AI and data tasks unnecessarily
Choose Components
Which FlowMason component fits each step?
Map each step from your decomposition to the right component type. This is where understanding the three categories is crucial.
π§© Component Categories
AI Nodes
When you need understanding, creativity, or generation
generator Generate text, analyze, summarize, extract critic Evaluate and score content improver Refine based on feedback selector Choose best from options synthesizer Combine multiple inputs Operators
When you need deterministic, repeatable logic
http_request Call external APIs json_transform Reshape data with JMESPath filter Filter arrays by condition schema_validate Validate against JSON Schema variable_set Store values for reuse logger Debug output at any point Control Flow
When you need branching, looping, or error handling
conditional If/else branching router Switch/case multi-path foreach Loop over array items trycatch Error handling with fallback subpipeline Call another pipeline Map Dependencies
What depends on what?
Draw the connections between stages. This creates your DAG (Directed Acyclic Graph). Stages without dependencies run in parallel automatically.
π Dependency Rules
Build & Iterate
Does it work?
Start minimal, test incrementally, and expand. Don't try to build the complete pipeline at once.
ποΈ Build in Phases
1-2 stages, happy path only
Does basic flow work?
Add remaining stages
Does each component work?
Add trycatch, validation
What can go wrong?
Add parallelism, caching
Can it be faster?
Component Decision Flowchart
Not sure which component to use? Follow this visual decision tree:
generatorcriticimprover json_transformfilterschema_validate conditionalrouter foreach http_request trycatch DAG Patterns Visualized
Master these fundamental patterns to wire any pipeline
Sequential Chain
Each stage depends on the previous. Use when order matters and each step needs the previous result.
View code
"stage_b": { "depends_on": ["stage_a"] }
"stage_c": { "depends_on": ["stage_b"] } Parallel Execution
Independent stages run simultaneously. Use when stages don't need each other's data.
View code
"stage_b": { "depends_on": ["stage_a"] }
"stage_c": { "depends_on": ["stage_a"] }
"stage_d": { "depends_on": ["stage_b", "stage_c"] } Fan-Out
One input feeds multiple parallel processes. Use when one result needs different processing paths.
View code
"stage_b": { "depends_on": ["stage_a"] }
"stage_c": { "depends_on": ["stage_a"] }
"stage_d": { "depends_on": ["stage_a"] } Fan-In (Aggregation)
Multiple stages feed into one. Use when you need to combine results from parallel work.
View code
"stage_d": { "depends_on": ["stage_a", "stage_b", "stage_c"] } Diamond Pattern
Fork and join. Use when you need parallel processing with a merge at the end.
View code
"stage_b": { "depends_on": ["stage_a"] }
"stage_c": { "depends_on": ["stage_a"] }
"stage_d": { "depends_on": ["stage_b", "stage_c"] } Conditional Branch
Route to different paths based on conditions. Use the conditional or router component.
View code
"router": {
"component_type": "conditional",
"config": {
"condition": "{{stages.a.output.score}} > 0.8",
"true_branch": ["stage_b"],
"false_branch": ["stage_c"]
}
} Complete Example: Thinking Through a Real Pipeline
Watch the mental process of designing a pipeline from scratch
The Problem
Build an AI-powered customer support ticket classifier and responder
Goal Statement
Given a support ticket, classify its type and urgency, then generate an appropriate response draft
π₯ Sample Input
{
"subject": "Can't login to my account",
"body": "I've been trying to login for 2 hours. Keep getting 'invalid password' but I know my password is correct. This is urgent - I have a deadline!",
"customer_email": "[email protected]",
"timestamp": "2024-01-15T10:30:00Z"
} π§ The Thinking Process
π Resulting Pipeline DAG
π Stage Configurations
generator classify_type β Determine ticket category
{
"prompt": "Classify this support ticket into ONE category: billing, technical, account, general.\n\nSubject: {{input.subject}}\nBody: {{input.body}}\n\nRespond with JSON: { \"type\": \"...\" }",
"temperature": 0.1
} generator assess_urgency β Determine urgency level
{
"prompt": "Assess the urgency of this support ticket: low, medium, high, critical.\nConsider: customer frustration, time sensitivity, business impact.\n\nSubject: {{input.subject}}\nBody: {{input.body}}\n\nRespond with JSON: { \"urgency\": \"...\", \"reasoning\": \"...\" }",
"temperature": 0.1
} generator generate_response β Generate appropriate response depends_on: [classify_type, assess_urgency]
{
"prompt": "Generate a helpful customer support response.\n\nTicket Type: {{stages.classify_type.output.type}}\nUrgency: {{stages.assess_urgency.output.urgency}}\nOriginal Subject: {{input.subject}}\nOriginal Body: {{input.body}}\n\nBe empathetic, acknowledge the issue, and provide next steps.",
"temperature": 0.7
} π€ Expected Output
{
"classification": {
"type": "account",
"urgency": "high"
},
"response": "I completely understand your frustration, and I'm sorry you're experiencing login issues right before an important deadline..."
} Quick Reference: Component Cheat Sheet
Keep this visual guide handy when designing pipelines
AI Nodes
When you need intelligence
generator Create text, analyze, summarize, extract info
critic Score and evaluate content quality
improver Refine content based on feedback
selector Choose best from multiple options
Operators
Deterministic data processing
http_request Call external APIs and services
json_transform Reshape data with JMESPath
filter Filter arrays by condition
schema_validate Validate JSON structure
Control Flow
Branching and looping
conditional If/else branching
router Switch/case multi-routing
foreach Iterate over collections
trycatch Error handling with fallback
Ready to build your pipeline?
Use the Pipeline Wizard to apply these concepts with guided help.