Building Efficient Workflows
Workflow Execution Logic
PuppyAgent workflows are visual pipelines built from Blocks (data containers) and Edges (processing operations). When you click Run, the backend automatically interprets your canvas layout, determines the flow of information, and executes all connected steps in the correct order.
The system processes workflows from start to end, identifying how data should be passed between each step, including cases with branching and merging paths.
Let's walk through some common examples to help you understand how execution works in different workflow structures.
How Execution Works Behind the Scenes
- Blocks represent data inputs, intermediate states, or final outputs.
- Edges define how to transform or process the data from one block to another.
- Start Blocks are blocks that don't have any incoming edges—they initiate the workflow.
- End Blocks are blocks with no outgoing edges—they receive the final output.
You won't see any labels like "START" or "END" in the user interface, but they are automatically identified by the backend to determine where execution begins and ends.
Example 1: A Simple Single-Step Workflow

This workflow contains:
- One input block
a
- One processing edge (e.g., an LLM)
- One output block
b
🟢 Execution:
- The edge between
a
andb
runs once you hit the Run button. b
is updated based on the processing result from the inputa
.
Example 2: A Linear Multi-Step Workflow

This workflow connects three blocks in a straight line using two edges:
a
→b
→c
, each with its own processing edge
🟢 Execution:
- The edge between
a
andb
runs first. - Once
b
receives its content, the second edge runs to processb
intoc
.
This is the most common setup for step-by-step processing.
Example 3: Parallel Processing with Merging Results

This workflow contains two separate paths that merge into a single edge:
a
→b
, andd
→e
- Then both
b
ande
connect to the final edge →c
🟢 Execution:
- The edges
a
→b
andd
→e
run in parallel. - Once both
b
ande
are ready, the edge toc
is triggered.
This structure is useful when you want to combine results from multiple sources before continuing.
Example 4: Three-Step Workflow with Dependency Merge

This workflow includes:
- Initial steps:
a
→b
, andd
→e
- Then
b
→f
- Finally,
f
ande
are merged intoc
🟢 Execution:
- The first layer runs in parallel:
a
→b
andd
→e
- Once
b
is ready, it continues tof
- Once both
f
ande
are ready, the final edge runs to updatec
This setup is typical when combining results from separate sub-workflows.
Example 5: A RAG Workflow

This workflow includes:
- Retrieve steps:
a
→b
→c
→d
- Then,
d
ande
are merged intof
f
ande
generateg
🟢 Execution:
- The first layer runs:
a
→b
→c
→d
- Once both
d
ande
are ready, the edge runs to updatef
- Generate
g
💡 Tips
- You don’t need to manually define execution order – just connect blocks using edges, and PuppyAgent will handle it automatically.
- To debug, try locking intermediate blocks so you can isolate and test specific steps.
- Use parallel structures when two or more inputs are needed for a single operation, such as combining multiple documents for retrieval.