Building Workflows
Four ways to build an automation in Muin: describe it in a sentence, start from a template, build a when/if/then rule, or open the Advanced editor. Test it with no side effects, review what it will do, then publish.
Workflows automate your business processes without code. There are four ways in, and they all end at the same place:
- Describe it. One sentence in your own words becomes a draft you can edit. (Growth and above.)
- Pick a template. A ready-made workflow you preview, adapt and publish. (Every plan.)
- Build a rule. When this happens, if these are true, do these.
- Open the Advanced editor. The full canvas, when the rule rows cannot say it.
Whichever door you use, you can test it before it runs and you review what it will do before it goes live. 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
- Go to Sidebar → Automation → Workflow Catalog
- Open the + Create menu and choose + Workflow
- Name it and click Create Workflow. Until you name and save it, the page tells you so: “Name and save this workflow to make it editable and runnable.”
- The visual builder opens
Workflow Builder Interface
The builder has two modes, picked from the View / Edit tabs in the header. View is read-only and always available; Edit appears when you have permission to author workflows.
Left sidebar: the step palette, grouped into things the workflow does and decisions it makes Center canvas: the workflow as a graph, with branches, loops and parallel paths Right panel: the properties of whatever you have selected, with the fields that step can use
Header controls: Add step, Undo and Redo, Ask to change (describe the change in a sentence and the assistant edits the graph), and Workflow settings. An Unsaved changes chip tells you there is work not yet saved, and an error count chip tells you how many problems the graph has.
Step types
| Group | Step | What it does |
|---|---|---|
| Does | Action | Performs one action |
| Does | Set a value | Computes or copies a field |
| Does | Run a workflow | Reuses another workflow |
| Does | Send an event | Emits an event other workflows can listen for |
| Decides | Branch | If / otherwise |
| Decides | Split in parallel | Waits for all, any, or N of several paths |
| Decides | Wait for a person | An approval or a task |
| Decides | Wait | A delay, aware of business hours |
| Decides | Repeat for each | Line items, people, rows |
| Decides | Try, and if it fails | Retry, then recover |
| Decides | Stop with an error | Ends the run as failed |
A Wait for a person step must name who acts. The builder asks for it, and saving is refused if a person step has nobody assigned and no assignment step before it - an approval nobody owns is a workflow that stalls forever.
Working on a phone
The canvas needs a wide screen. On a phone the builder says so and offers the two things that do work there: Review & publish and See run history.
The definition record
Every saved workflow also has a plain record page, reached by clicking its row in the Workflow Catalog. It has two tabs:
- Overview - Workflow Steps, Trigger Configuration, Recent Runs, and an AI Cost Estimate showing roughly what a run costs and what that comes to for your monthly volume.
- Versions - every version with its state: Draft, Published, Deprecated or Archived, and who created and published it. You can publish, deprecate or archive from here. Restore this version (shown to anyone who can edit workflows) copies an earlier version into a NEW draft named “Restored from vX” and makes it the working copy. Nothing goes live until that draft is reviewed and published, and the newer versions stay in the history.
The header names who created the workflow and who last changed it, and its Owner. The owner is the person accountable for the workflow and is told when a run fails. A new workflow is owned by whoever created it (or duplicated it). Anyone who can edit workflows can click Change owner, pick another member of the workspace and add an optional reason; the change is kept in the audit trail as “owner changed”. Only an active member of the workspace can be made owner.
Requiring a second person to publish
Under Settings > Workflow Settings > Alerts & publishing, Publishing, turn on Require a second person to publish and save. From then on, anyone who has edited the workflow’s content (not only the last editor) cannot publish it: publishing shows “This workspace requires a second person to publish: you have edited this workflow, so someone else has to review and publish it.” Another person with edit access opens the draft’s review and publishes it. The setting is off by default, and drafts that are already published keep running.
Header actions: Activate / Deactivate, Configure Triggers, Duplicate, Edit and Delete. Deactivating confirms first and explains itself: future triggers stop, and active runs continue to completion. You can add an optional reason; it is kept with the change. Deleting is permanent and archives the inactive runs.
Every change of this kind is recorded with who made it and the reason given: created, edited (only when a value actually changed), published, activated, deactivated, restored, a step reassigned to someone else, and a step an admin moved on for its assignee. See them under Administration > Audit & Security > Unified Audit, source Workflows.
A run waiting on somebody shows as “Waiting on <name>” in Recent Runs, or “Waiting - unassigned” when the step has no owner.
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. A condition is one expression, and you can write it two ways: as simple rows in plain words, or in the expression editor. The rows are a view over the same expression, so switching tabs never changes what the condition means. The builder surfaces the fields each step can reference, so you pick a field rather than typing a path.
Simple rows
Each row is field · operator · value, and the rows are joined with all of these or any of these.
| Operator | Reads as |
|---|---|
= |
is |
!= |
is not |
> |
is more than |
>= |
is at least |
< |
is less than |
<= |
is at most |
contains |
contains |
startswith / endswith |
starts with / ends with |
before / after |
is before / is after (a date) |
within_days |
is within N days |
in |
is one of (type the values separated by commas) |
between |
is between (a lowest and a highest value, both included) |
is_null / is_not_null |
is empty / is not empty |
is_blank |
is blank (no value, or empty text) |
All of these (AND):
Document type is Invoice
Amount is more than 1000
Vendor category is Preferred
All must be true.
Any of these (OR):
Amount is more than 10000
Category is Emergency
At least one must be true.
Groups. Click + Add a group to put a few rows in a box with their own join word. A new group starts with the opposite word to the rows around it, so “all of these, and any of these” reads naturally:
All of these:
Document type is Invoice
Any of these:
Amount is more than 10000
Vendor category is one of New, Unverified
Use Match any instead / Match all instead on the group to flip its join word, and Remove to drop the whole group. Groups go one level deep; anything deeper is written in the expression editor.
To check records against the same rules in many workflows, save them once as a rule set: see Business rules.
When the rows cannot say it
Anything the rows cannot express is written in the expression editor instead: date maths, nested groups, and computations over a step’s output all live there. The editor shows the expression’s live value against your last test run or a sample, and an expression that does not parse reports the error at the caret rather than going blank. When an expression falls outside what the rows can represent, the Simple tab is disabled and the editor opens: “Need something the rows cannot say? Write it as an expression.”
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), asked in order or all at once
- Approval required from: one person, any one, every approver, or a set number (see Approval steps)
- Per-step timeout and escalation (see When a person does not answer in time)
- 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 |
| Send for e-signature | Route a document to BoldSign for signing |
| Create accounting entry | Sync to QuickBooks |
| Run agent | Trigger Muin Agent |
Human Steps
Some steps wait for a person: an approval, a review, a hand-off. Open the step on the canvas to set who acts, how they decide and what happens if nobody answers.
Approval steps
Add an Approval step from the step palette. Under Who has to approve, pick a mode:
| Mode | What finishes the step |
|---|---|
| One person | The one assignee approves or rejects |
| Any one of the approvers | The first approval |
| Every approver | All approvers approve; one rejection takes the rejection path |
| A set number of approvers | Approvals needed of the listed approvers approve, for example 2 of 3 |
| Each approver, in order | Approver 1 decides first; approving moves to approver 2, and so on. Any rejection takes the rejection path |
In Each approver, in order, a person who approved an earlier level of the step cannot approve a later level of it; only the owner can, by adding a note that stays on the record. Separate Approval steps are not linked.
In Any one of the approvers, Every approver and A set number of approvers, one person counts once: someone who already decided one approver’s task cannot decide another approver’s task in the same step.
The person who started the run cannot approve its Approval step. Only the owner can, and only by saying why, unless an approval rule blocks self-approval outright; the note stays on the record.
For every mode except One person, add at least two approvers with Add approver. Each approver is a role, a specific person, a reporting manager or a person named in a form field. In the parallel modes (any, every, a set number) each approver gets their own task in the Inbox at the same time. As soon as the required approvals can no longer be reached, the run takes the rejection path.
The builder refuses a step it cannot run, by name: fewer than two approvers, or more approvals needed than there are approvers. Such a workflow cannot be saved or published until it is fixed.
Who gets the task
Assign to offers:
| Option | Who receives the task |
|---|---|
| A role | A person holding that role in your organization |
| A specific person | That person |
| Manager of the submitter | The reporting manager (from HR) of the person who submitted the form or record |
| Manager of the person who started it | The reporting manager of the person who started the run |
| Person in a form field | The person whose user id or email is in the field you name, for example form.approver_email |
If nobody matches, assign to is the fallback. It is used when the first choice names nobody: the submitter has no manager on file, the field is empty, or it names someone who is not in your organization. With no fallback set, the task goes to the organization owner.
When a person does not answer in time
Set Give up after on the step, then When time runs out:
| Choice | What happens |
|---|---|
| Use the workflow’s rule | The workflow-wide timeout rule applies |
| Escalate to the next person | The task moves up the chain under Escalate to, in order, one level each time it times out |
| Hand it to someone else | The task moves once to the person or role under Hand it to |
| Decline it automatically | The step is treated as rejected and the run takes the rejection path |
| Move on without a decision | The run continues to the next step |
A step’s own choice wins over the workflow’s rule. With no escalation chain on the step, the workflow’s chain is used.
AI decisions a person reviews
To let the AI choose between paths, add an AI decision step from the Decide & wait group.
It starts with two paths, approve and reject, and you can open the step to change them:
- Name each path and, under When this path is right, tell the AI when to take it. Use Add a path for more. A step always keeps at least two paths.
- Connect each path with Then go to: pick the step it leads to, the next step, or the end of the workflow. Each path shows on the canvas as its own labelled branch.
- Set the confidence threshold (0 to 100%). The step starts at 80%. Clear it and the run always follows the AI, with nobody reviewing.
- Choose who reviews under Who reviews. With nobody set, the organization owner reviews.
When the AI’s confidence meets the threshold, the run takes the path the AI chose and asks nobody. When it is below the threshold, the run does not take the AI’s path: it waits on a Review an AI decision task in the reviewer’s Inbox. The run stays there until the reviewer answers. The task says what the AI suggested, its confidence and its reasoning, and offers the step’s own paths as buttons.
On the run page, open the AI step to see the decision, the confidence and whether it was sent to a person. When a reviewer picks a different path than the AI suggested, the run’s timeline marks the step Overrode the AI and the audit log records it.
Notification templates
A notification step can send a ready-made Message instead of text you write. Pick one from the list (for example “Approval needed”, “Step completed”, “Escalated to you” or “Review requested”) and use Preview to read it with this workflow’s names filled in. Choose the channels it goes out on: in the app, email, SMS, push or WhatsApp. To send it to a person named on the record, set the recipient to a form field. A message key that is not a template is refused when you save, unless you also write your own message.
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 it before it runs
Open a workflow and choose Test workflow. Pick a sample document; each step shows what it would do on that sample. Nothing is sent, assigned or posted.
The run ends with a one-line summary:
5 of 6 steps ran · 1 waiting on a person · no side effects
“No side effects” is counted, not assumed. The server tallies every step result that comes back without the test-run marker, and the summary reads 1 SIDE EFFECT: this test changed real data if one ever does. On the shipped product that count is zero: a test run rolls its database work back, runs each action’s describe path instead of its execute path, and gates the handful of writes a rollback cannot reach.
A step that failed says why, and you can ask the assistant to change that step with the failure already filled in.
What a test run does and does not compute
Steps that only compute, setting a field, validating, routing by amount, gathering data, produce their real output on your real data. Every other step, including AI steps, describes what it would do rather than doing it. You can also pin a step’s output and re-run from there, so you can rehearse a later branch without replaying the whole workflow.
Test with real data
The test drawer asks where the test data comes from:
- Enter it by hand: type or paste the data.
- A past submission of this form: for a workflow started by a form, pick a recent submission and the test runs on its real answers.
- A past run of this workflow: replay the inputs of an earlier run. Steps that already produced output in that run are pinned to it, so the test follows the same path. A workflow that has never run says so.
Checks while you build
The builder checks the workflow as you edit and lists what it finds in the validation panel.
| Kind | What it means | Examples |
|---|---|---|
| Error | The workflow cannot run as built. Publish stays disabled until every error is fixed. | A loop with no way out (once a run enters it, no path reaches the end); an expression that does not parse |
| Warning | The workflow runs, but you almost always want to know. Warnings never block publish. | A step that waits for a person with no deadline; a notification with no message or no recipients; an AI or agent step with no fallback or confidence threshold; failure alerts turned off; a form trigger with no condition |
Some checks need the server: whether the tools, connectors and people a step names exist in your organization. The builder sends the unsaved workflow to the server a moment after you stop typing and merges its findings into the same panel. If that check cannot be reached, the panel says so and offers Retry; the server checks the workflow again when you publish either way.
Review and Publish
Review before publish
Before a version goes live you see what starts it, what it will do and who it affects, in plain words:
| Section | What it answers |
|---|---|
| Starts when | The trigger that sets this workflow running |
| It will | Every effect the workflow can have, with new in v2 on anything this version adds |
| Who feels it | The roles and recipients named in the configuration |
| Tested | Whether it has been tested, and what that test found |
Publish is disabled until that summary has rendered: a button that publishes a summary nobody has seen is exactly what this page removes. Publishing is refused if the workflow changed after you reviewed it: you are told “This workflow changed since you reviewed it. Reload the review.” and nothing goes live.
The same gate applies to switching an automation rule on. There is no other path to live.
Active vs. Inactive
| State | Behavior |
|---|---|
| Inactive | Workflow saved but won’t run |
| Active | The published version runs when triggered |
| Paused | Temporarily stopped, can resume |
A workflow that is switched on but has never been published through the review gate does not run.
Workflow Versioning
When you modify a live workflow:
- Changes are saved as a draft; the live version keeps running
- Review & publish shows what the new version will do
- Publishing makes it live, and the previous version stays in history
- Runs already in flight finish on the version they started on: a publish never changes a run mid-flight
- To go back, open Versions and use Restore this version: it makes a new draft from that version, which you then review and publish
Describing a workflow in your own words and editing steps with the assistant are available on Growth and above; every plan can preview, adapt and publish a template.
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
Failure Alerts
When a run goes wrong, the right people hear about it without anyone watching the dashboard.
What triggers an alert
- The run failed: a step failed and the run stopped.
- The run timed out or got stuck: it passed its deadline, or stopped moving. A stuck run is restarted from its current step first; if it is still stuck, it is stopped and alerted.
- A trigger was suspended: a trigger that fails to start its workflow five times in a row is paused, and an alert says why. Turning it back on clears the failure count.
- A deadline (SLA): optionally, a step that is about to miss, or misses, its deadline.
One failure sends one alert. Each alert links to the run, which shows the step that stopped it.
Who is alerted and how
Choose any of:
- The person who started the run
- The workflow owner
- Everyone with a given role
- Specific people
And any of these channels:
- In the app (the notification bell)
- A Slack or Microsoft Teams channel: paste the channel’s incoming-webhook address. It must start with
https://. Once saved, the address is hidden; leave it as is to keep it, or paste a new one to replace it.
A setting that would reach nobody, for example a role no one in your organization holds, is refused when you save it.
Organization default and per-workflow settings
- Organization default: Settings > Workflow Settings > Alerts & publishing > Failure alerts. Until you set it, the person who started the run and the workflow owner are alerted in the app and by email.
- Per workflow: in the builder, open Workflow settings and set When this workflow fails, alert to Use the organization default, Choose people and channels for this workflow, or Do not send alerts.
Changing these settings needs permission to manage workflow definitions (for example the Workflow Administrator role). Other team members do not see Workflow Settings.
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
Messages You May See
| What you see | Why | What to do |
|---|---|---|
| “That arrow can’t go there” | The connection is not valid between those two steps | Connect from a step that can hand off to that one |
| “This transition always runs; only a case or guard can carry a condition.” | You put a condition on an unconditional arrow | Use a Branch step, or set the condition on the arrow’s case or guard |
| “Fix the workflow errors before publishing.” | The graph still has errors | Open the error chip in the header to see them |
| “This workflow changed since you reviewed it. Reload the review.” | Somebody edited it after you opened the review | Reload the review and read it again before publishing |
| “You do not have permission to publish this workflow. Ask an administrator.” | Publishing needs workflow definition management | Ask an admin to publish it |
| “This version was not published. The workflow document was refused…” | The definition itself was rejected | Read the named refusals on the review page and fix each one |
| “Saved, but the canvas could not re-read it. Reload to see it.” | The save landed but the canvas is stale | Reload the page. Your work is saved |
| A step warning that it sends through a connector your organization has not set up | The action needs an integration you have not connected | It can be saved, but it will not run until that connector is connected |
| “Editing steps is included from Growth.” | Step editing needs the Custom Workflows feature | You can still review and publish the template as it is |
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
- Reading a Workflow Run - What happened, and editing the rule that started it
- Build With AI From a Document - Turn a written procedure into a draft
- AI Agents - More complex automation