April 16, 2026guidepatterns
AND vs OR Patterns: How Symfony Workflows Really Work
The Two Workflow Types
Symfony offers two types: workflow (Petri net) and state_machine.
- state_machine: Exactly one place is active at a time. Simple linear flows.
- workflow: Multiple places can be active simultaneously. Supports parallel execution.
AND Patterns (Workflow Type Only)
AND-Split (Fork)
A single transition with multiple target places:
transitions:
start_review:
from: draft
to: [checking_content, checking_spelling]Both checking_content and checking_spelling become active simultaneously. The entity is in two places at once.
AND-Join (Synchronization)
A single transition with multiple source places:
transitions:
publish:
from: [content_approved, spelling_approved]
to: publishedBoth content_approved AND spelling_approved must be marked for the transition to fire.
OR Patterns
Separate transitions from the same place create an OR choice:
transitions:
approve:
from: review
to: approved
reject:
from: review
to: rejectedFrom review, you can go to approved OR rejected — firing one consumes the token, so the other becomes unavailable.
How SymFlowBuilder Shows the Difference
- AND patterns: Edges sharing the same transition name display an AND or FORK badge
- OR patterns: Separate transition nodes from the same place — no badge needed
- In the simulator: AND-joins require all source places to be marked before the transition enables