Understanding Sub-Workflows in FlowMattic
Are you tired of rebuilding the same workflow steps over and over? Meet Sub-Workflows—your secret weapon for creating smarter, more maintainable automations in FlowMattic.
What Are Sub-Workflows?
Think of Sub-Workflows as reusable building blocks for your automations. They’re mini-workflows that run inside other workflows, letting you build common tasks once and use them everywhere.
Instead of copying and pasting the same 5 steps across 10 different workflows, you create one Sub-Workflow and call it whenever you need it. Change it once, update it everywhere. Simple as that.
Real-World Analogy
Imagine you’re cooking. Instead of writing out “dice onions, mince garlic, sauté in olive oil” in every single recipe, you could just write “prepare sofrito” and reference the detailed steps elsewhere. That’s exactly what Sub-Workflows do for your automations.
Why Should You Care?
1. Save Massive Amounts of Time
Build your workflow logic once. Use it in 5, 10, or 50 different workflows. Need to add a new step? Update it in one place instead of hunting through dozens of workflows.
Real example: You send order confirmations from your website, mobile app, and in-person sales system. Instead of building the same email formatting and sending logic three times, build it once as a Sub-Workflow. Now all three systems use the same logic.
2. Never Duplicate Work Again
We’ve all been there—you build a complex workflow, then realize you need the exact same logic somewhere else. With Sub-Workflows, you just call the existing one. No copying, no pasting, no maintaining multiple versions.
3. Update Once, Fix Everywhere
Your boss wants to change the email template? Your payment processor updated their API? Fix it in the Sub-Workflow once, and every workflow using it gets the update automatically. No more tracking down every place you used that logic.
4. Keep Your Workflows Clean and Organized
Sub-Workflows help you break complex processes into logical chunks. Instead of a 30-step monster workflow, you have a clean 8-step workflow that calls well-named Sub-Workflows. Your future self will thank you.
When to Use Sub-Workflows
Sub-Workflows shine when you have repeatable tasks. Here are the most common scenarios:
Data Transformation and Formatting
- Standardizing phone numbers from different sources (“+1-555-0123” vs “5550123” vs “(555) 0123”)
- Converting dates to consistent formats
- Cleaning up customer names and addresses
- Parsing email addresses from text that might contain extra characters
Shared Notifications
- Sending branded email templates with your company styling
- Posting formatted Slack messages with consistent structure
- Creating support tickets with standardized fields
Customer Interactions
- Sending welcome email sequences
- Creating follow-up tasks after specific events
- Updating CRM records with consistent data
Data Lookups and Enrichment
- Searching multiple databases for customer information
- Validating emails or phone numbers
- Enriching contact data from various sources
- Looking up product information across systems
Security and Access Control
- Retrieving data from secure systems without giving everyone direct access
- Creating data gateways between departments
- Returning only non-sensitive information from databases
How Sub-Workflows Actually Work
Sub-Workflows use a simple input-process-output model:
The Three Components
1. Start Sub-Workflow (Trigger)
This is where your Sub-Workflow begins. It defines what data (parameters) the Sub-Workflow will receive from parent workflows.
2. Action Steps
Just like regular workflows, add as many action steps as you need. These process the incoming data.
3. Return Response (Action)
The final step that sends processed data back to the parent workflow. Every Sub-Workflow must have this.
The Process Flow
Parent Workflow starts
↓
Parent Workflow runs some steps
↓
Calls Sub-Workflow (sends data like email, name, etc.)
↓
Sub-Workflow receives data
↓
Sub-Workflow processes it (formats, validates, enriches)
↓
Sub-Workflow returns results
↓
Parent Workflow continues with the results
↓
Parent Workflow completes
A Quick Example
Sub-Workflow: “Format Customer Data”
- Receives: raw email, raw phone, raw name
- Processes: Converts email to lowercase, removes phone number formatting, fixes name capitalization
- Returns: formatted email, formatted phone, formatted name
Parent Workflow 1: “Fluent Forms → CRM”
- Trigger: New form submission
- Calls “Format Customer Data” with form data
- Creates CRM contact with formatted data
Parent Workflow 2: “FluentCart → CRM”
- Trigger: New order
- Calls “Format Customer Data” with customer data
- Updates CRM contact with formatted data
Both workflows get consistently formatted data without duplicating the formatting logic.
The Key Benefits You’ll Experience
Consistency Across Your Business
When you use Sub-Workflows, you ensure the same business logic applies everywhere. No more “this workflow formats phone numbers differently than that one” problems.
Easier Troubleshooting
Bug in your email formatting? Fix it in the Sub-Workflow and test it once. No need to hunt through 15 workflows to find all the places that logic exists.
Team Collaboration Made Simple
Sub-Workflows make it easy to divide work. One team member builds the customer data formatter, another builds workflows that use it. Everyone stays in sync because they’re using the same component.
Future-Proof Your Automations
Business requirements change. When they do, Sub-Workflows let you adapt quickly. Update the logic in one place, and all your workflows instantly use the new version.
What You Need to Know Before Starting
Sub-Workflows vs Regular Workflows
Regular Workflows start with a trigger that responds to external events (new email, form submission, schedule, etc.)
Sub-Workflows start with the “Start Sub-Workflow” trigger, which only fires when called by another workflow. They can’t run on their own.
Performance Considerations
Sub-Workflows add a small amount of processing time since data needs to be passed back and forth. For most use cases, this is negligible. Keep Sub-Workflows efficient by:
- Only including necessary steps
- Avoiding unnecessary delays
- Not nesting Sub-Workflows too deeply
Common Patterns You’ll Use
Pattern 1: The Data Formatter
Receive messy data, clean it up, return it formatted. Use this for emails, phone numbers, addresses, dates.
Pattern 2: The Multi-Source Lookup
Search several systems for information, compile what you find, return the results. Perfect for finding customer data spread across multiple tools.
Pattern 3: The Notification Hub
Receive a notification request, determine how to send it (email, Slack, SMS), format it appropriately, send it, return confirmation.
Pattern 4: The Validator
Receive data, check if it’s valid (format, requirements, business rules), return validation status and any errors.
Planning Your First Sub-Workflow
Before you build, ask yourself:
-
What do I need this Sub-Workflow to do? Be specific about the task.
-
What data do I need to send it? List all the parameters required.
-
What should it return? Think about what data the parent workflow needs back.
-
Where will I use it? Knowing all the use cases helps you design it right.
-
How might this change? Design for flexibility if requirements might evolve.
Common Questions
Q: How many Sub-Workflows can I create?
A: There’s no specific limit on Sub-Workflows themselves
Q: Can Sub-Workflows call other Sub-Workflows?
A: Yes! But avoid circular references (A calls B, B calls A) which create infinite loops.
Q: What happens if I change a Sub-Workflow?
A: All parent workflows using it will immediately use the updated version. Test changes carefully!
Q: Can I see which workflows use a specific Sub-Workflow?
A: Currently, you’ll need to search through your workflows or check execution logs. Consider documenting this in the Sub-Workflow description.
Next Steps
Ready to build your first Sub-Workflow? Check out our step-by-step guide: Create Reusable Workflow Steps with Sub-Workflows
Want to see real examples in action? Read: FlowMattic Sub-Workflows and How to Use Them
Need help? Visit FlowMattic Support or contact our support team.
Related Articles:
- Create Reusable Workflow Steps with Sub-Workflows
- FlowMattic Sub-Workflows and How to Use Them