Building Workflows
Create powerful automations with Muin's visual workflow builder. Triggers, conditions, and actions for any business process.
Workflows automate your business processes without code. Use the visual drag-and-drop builder to define triggers that start the workflow, conditions with field/value/date operators that control the path, parallel execution paths, and actions that get work done. This guide covers everything you need to build effective automations.
Workflow Concepts
Every workflow has three parts:
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Trigger │ ──→ │ Conditions │ ──→ │ Actions │
│ (What starts │ │ (What filters│ │ (What gets │
│ the flow) │ │ the flow) │ │ done) │
└──────────────┘ └──────────────┘ └──────────────┘
Trigger: The event that starts the workflow Conditions: Rules that decide if actions should run Actions: What happens when conditions are met
Creating a New Workflow
Getting Started
- Navigate to Workflows in the main navigation
- Click Create Workflow
- Enter a name and description
- The visual builder opens
Workflow Builder Interface
The drag-and-drop builder has three panels:
Left sidebar: Available triggers, conditions, and actions Center canvas: Visual workflow diagram with drag-and-drop node placement, conditions, and parallel paths Right panel: Properties for selected element with dynamic field selection (the Available Fields API surfaces relevant fields per step)
Naming Best Practices
Good workflow names are:
- Descriptive: “Invoice Approval Routing”
- Action-oriented: “Route High-Value Invoices for CFO Approval”
- Searchable: Include key terms
Choosing a Trigger
Triggers define when your workflow runs.
Document Triggers
| Trigger | When It Fires |
|---|---|
| Document uploaded | New document arrives |
| Document type detected | AI identifies document type |
| Document processed | AI extraction complete |
| Document status changed | Status transitions (e.g., to Approved) |
Field Triggers
| Trigger | When It Fires |
|---|---|
| Field value changed | Any extracted field changes |
| Amount threshold | Amount exceeds/falls below value |
| Date reached | Due date, expiration, or custom date |
Time-Based Triggers
| Trigger | When It Fires |
|---|---|
| Scheduled | Specific time (daily, weekly, monthly) |
| Recurring | Every X hours/days |
| Date reached | When a tracked date arrives |
Manual Triggers
| Trigger | When It Fires |
|---|---|
| Manual | User clicks “Run Workflow” button |
| Button click | Custom button on document |
| API call | External system triggers via API |
Trigger Configuration
- Drag a trigger from the sidebar to the canvas
- Click to select it
- Configure in the right panel:
- Trigger type specifics
- Filters (which documents apply)
- Frequency limits
Adding Conditions
Conditions control whether actions execute. The condition system supports field, value, and date operators with dynamic field selection — the builder surfaces available fields for each step automatically.
Basic Conditions
| Condition | Checks |
|---|---|
| Document type is | Specific document type |
| Field equals | Field matches value |
| Field contains | Field includes text |
| Amount is | Greater than, less than, between |
| Date is | Before, after, between, relative (e.g., within 30 days) |
| Status is | Document status matches |
| Field is null/not null | Presence check |
Combining Conditions
Use AND/OR logic:
All conditions (AND):
Document type is Invoice
AND Amount is greater than $1,000
AND Vendor category is "Preferred"
All must be true.
Any condition (OR):
Amount is greater than $10,000
OR Category is "Emergency"
At least one must be true.
Nested logic:
(Document type is Invoice AND Amount > $5,000)
OR
(Document type is Contract AND Value > $25,000)
Condition Groups
Create condition groups for complex logic:
- Click Add Condition Group
- Choose AND or OR for the group
- Add conditions within the group
- Nest groups as needed
Configuring Actions
Actions are what your workflow does.
Notification Actions
| Action | What It Does |
|---|---|
| Send email | Email to specified recipients |
| In-app notification | Alert in Muin |
| Slack message | Post to Slack channel |
| SMS alert | Text message (premium) |
Email configuration:
- Recipients (fixed emails, dynamic from fields, role-based)
- Subject line (can include document fields)
- Body template (rich text, merge fields)
- Attachments (include document)
Task Actions
| Action | What It Does |
|---|---|
| Create task | Add to task queue |
| Assign task | Assign to specific user/role |
| Update task | Modify existing task |
| Complete task | Mark as done |
Task configuration:
- Title and description
- Due date (fixed or relative)
- Priority
- Assignee (user, role, or dynamic)
Routing Actions
| Action | What It Does |
|---|---|
| Route for approval | Send for approval |
| Escalate | Send to higher authority |
| Reassign | Change current assignee |
| Return | Send back to previous step |
Approval routing:
- Approver(s) - sequential or parallel
- Approval required from: Any, All, Majority
- Timeout and escalation rules
- Approval/rejection actions
Document Actions
| Action | What It Does |
|---|---|
| Update status | Change document status |
| Add tag | Apply tag to document |
| Move to folder | Organize document |
| Update field | Change field value |
| Generate document | Create from template |
Integration Actions
| Action | What It Does |
|---|---|
| Call webhook | POST to external URL |
| Update CRM | Sync to Salesforce, HubSpot |
| Create accounting entry | Sync to QuickBooks |
| Run agent | Trigger Muin Agent |
Building Your First Workflow
Example: Invoice Approval Routing
Let’s build a workflow that routes invoices for approval based on amount.
Step 1: Add Trigger
- Drag “Document processed” trigger to canvas
- Configure: Document type = Invoice
Step 2: Add Conditions
- Drag “Amount condition” below trigger
- Connect them (drag from trigger output to condition input)
- Configure: Amount > $500
Step 3: Add Branch For different approval paths:
- Drag “Condition Branch” element
- Create two paths:
- Path A: Amount $500-$5,000 → Manager approval
- Path B: Amount > $5,000 → CFO approval
Step 4: Add Actions
- For Path A: Drag “Route for approval” action
- Approver: Document’s department manager
- Due: 3 business days
- For Path B: Drag “Route for approval” action
- Approver: CFO
- Due: 2 business days
Step 5: Add Completion Actions After approval:
- Drag “Update status” action
- Configure: Status = “Approved for Payment”
- Drag “Create task” action
- Configure: “Process payment for [vendor]“
Testing Workflows
Test Mode
Test before activating:
- Click Test in the workflow builder
- Select a sample document
- Click Run Test
- Watch execution step by step
- Review what would happen at each step
Test with Dry Run
Actions don’t actually execute in dry run:
- Emails show as “Would send to…”
- Tasks show as “Would create…”
- Status changes show as “Would update to…”
Review Test Results
After test:
- See which conditions passed/failed
- View action outputs
- Identify issues to fix
Activating Workflows
Activation Steps
- Ensure all required fields are configured
- Click Save
- Click Activate
- Confirm activation
Active vs. Inactive
| State | Behavior |
|---|---|
| Inactive | Workflow saved but won’t run |
| Active | Workflow runs when triggered |
| Paused | Temporarily stopped, can resume |
Workflow Versioning
When you modify an active workflow:
- Changes are saved as a draft
- Active version continues running
- Click Publish to make changes live
- Previous version saved in history
Workflow Templates
Start faster with 25 pre-built templates.
Available Templates (examples)
| Template | Purpose |
|---|---|
| Invoice Approval | Route invoices by amount with auto-approval thresholds |
| Certification Renewal | Alert on expiring certs |
| Vendor Compliance | Request missing documents |
| Vendor Onboarding | Document collection, risk assessment, and approval |
| Contract Renewal | Notify before expiration |
| New Employee Onboarding | Document collection checklist |
| Expense Approval | Route by amount and category |
| Grant Application Review | Committee review and board vote |
Browse all 25 templates in Workflows > Templates.
Using Templates
- Click Templates in Workflows
- Browse or search templates
- Click Use Template
- Customize for your needs
- Save and activate
Creating Templates
Save your workflows as templates:
- Open a working workflow
- Click Save as Template
- Add template name and description
- Share with team (optional)
Monitoring Workflows
Workflow Dashboard
See all workflow activity:
- Active workflows count
- Runs today/this week
- Success/failure rates
- Recent executions
Execution Logs
Every workflow run is logged:
- Navigate to Workflows → History
- Filter by workflow, date, status
- Click any run to see details
Run Details
Each run shows:
- Trigger event that started it
- Document(s) involved
- Conditions evaluated (pass/fail)
- Actions executed
- Errors if any
Debugging Failures
When a workflow fails:
- Open the failed run
- See where it failed
- View error message
- Fix the issue
- Optionally re-run
Advanced Features
Parallel Paths
Run multiple branches simultaneously for independent tasks:
- Add a “Parallel” block to the canvas
- Add actions within each parallel branch
- All branches execute at once
- Workflow continues after all parallel branches complete
Loops
Process multiple items:
- Add a “For Each” block
- Configure the collection (e.g., line items)
- Add actions that run for each item
Wait Steps
Pause workflow until condition met:
- Add “Wait” block
- Configure wait condition:
- Wait for approval
- Wait for time period
- Wait for field value
Error Handling
Handle failures gracefully:
- Add “Error Handler” block
- Configure fallback actions:
- Send notification
- Create task for manual handling
- Retry with different approach
Troubleshooting
Workflow Not Triggering
- Check activation - Is workflow active?
- Verify trigger - Does document match trigger criteria?
- Check conditions - Are conditions too restrictive?
- Review logs - Any errors recorded?
Actions Not Executing
- Check conditions - Did conditions pass?
- Verify configuration - All required fields set?
- Check permissions - Does workflow have needed access?
- Review action logs - Specific error messages?
Performance Issues
- Simplify conditions - Complex logic can slow execution
- Limit notifications - Avoid notification storms
- Optimize loops - Don’t process large sets item by item
Best Practices
Design
- Start simple - Get basic workflow working first
- Name clearly - Future you will thank present you
- Document logic - Add descriptions to complex conditions
- Test thoroughly - Test all paths before activating
Maintenance
- Review regularly - Audit active workflows quarterly
- Clean up unused - Deactivate or delete obsolete workflows
- Monitor failures - Address issues promptly
- Version control - Keep history of changes
Notifications
- Don’t over-notify - Too many alerts get ignored
- Be specific - Include actionable information
- Route appropriately - Right person for right action
- Use escalation - Auto-escalate if no response
Next Steps
Now that you understand workflows:
- Workflow Templates - Pre-built automations
- Trigger Types - Deep dive on triggers
- AI Agents - More complex automation