Step 6: Designing and governing a large workflow library
Now that your accounts, tiers, regional teams, schedules, and SLA policies are in place, you can use them to automatically trigger actions across your queues via workflows. Managing 25+ workflows across multiple products, regional shifts, custom SLA contracts, and AI handoffs is a different discipline than building one routing rule — at scale, the failure mode is typically the auditability of multiple, complex workflows interacting with each other rather than the design of any individual workflow.
Because Plain workflows execute in a strict, deterministic order from top to bottom on your Workflows page — and because every workflow is backed directly by our GraphQL API and can be duplicated or exported as a template — you can govern your automation layer like production code rather than a pile of ad-hoc triggers.
A workflow can also start other workflows, up to two levels deep. We'll walk through the five-layer execution stack, three production patterns, and how to verify run order in the run log.
What good looks like
Ideally, you’ll want to see a layered, auditable workflow library where any admin can identify the who, what, where, when, and why of a workflow and its individual workflow steps.
Five-layer execution stack: Your Workflows page is ordered top-to-bottom by function:
1. Spam/noise filtering → 2. Enrichment & tiering → 3. Topic & regional team routing → 4. Baseline tier SLAs followed by per-contract SLA overrides → 5. AI assignment, handoffs, and breach escalations
Standardized naming & ownership: Every workflow is named
<Layer> · <Trigger> · <Outcome>(e.g.4b SLA · Thread created · Contract overrides) with an owning team or admin in its descriptionTimeline audit trail: Non-obvious branches (follow-the-sun handovers, contract SLA overrides, AI handoffs) drop a standardized internal note on the thread timeline naming the workflow that acted
Version-controlled changes: Production routing and SLA workflows are exported to JSON (
exportWorkflowTemplate) before major edits — especially before prompting Build with AI (Sidekick) on an existing canvas
Four rules of engagement for a 20+ workflow library
We won't walk through what a trigger or condition node is (see our small-team workflow guide or workflow docs if you want the basics). When you're governing a library at scale, enforce these four architectural rules across your admins:
1. Stack your library into five explicit layers (top to bottom)
When an event (such as Thread created) matches multiple published workflows, Plain runs them sequentially from top to bottom in the exact order they sit on your Workflows page. Workflows can also be sequenced, so fight the urge to have sprawling, branched mega-canvases that are tough to iterate on — break them into single-purpose workflows and stack them in this five-layer order:
Layer (top → bottom) | Job | Why it sits here |
|---|---|---|
1. Noise & spam filtering | Auto-close marketing/link-exchange spam, automated bounce loops, or known no-op alerts | Runs first so downstream workflows never assign spam to a team or burn AI credits evaluating it |
2. Enrichment & tiering | Set thread tier ( | Must finish writing context before Layer 3 and Layer 4 read that context |
3. Categorization & regional routing | Apply product topic labels ( | Routes the thread once enrichment is complete |
4. SLA policies ( | Attach regional SLA policies ( | The last |
5. AI assignment, handoffs & breach escalations | Assign the Customer Agent ( | Runs after all metadata, routing context, and SLA clocks are in place |
2. Never use a Wait step to sequence two workflows
Admins migrating from legacy help desks often drop a 1-minute Wait step into a routing workflow thinking it will "wait for enrichment to finish." In Plain, that does the exact opposite:
List order is already synchronous: Workflows on the same trigger event run strictly top-to-bottom without any
Waitstep.Waitsteps andSidekickactions yield immediately to the next workflow: The moment Workflow 1 hits a Wait step or a Sidekick action, Plain pauses Workflow 1 and immediately starts Workflow 2 below it. If Workflow 1 hasn't finished setting a tier or label before that pause, Workflow 2 will evaluate against stale data.
3. Workflows can trigger other workflows (Thread labels changed)
When a workflow adds a label, any published workflow that listens to Thread labels changed runs next. The workflow that added the label never re-runs because of it, and chains stop two levels deep.
If a Layer 3 workflow adds the Product > Compute label on Thread created, a downstream workflow listening to Thread labels changed will fire as a result. Add a condition so it only acts on the threads you mean, or, if it's really just the next step of the first workflow, put the downstream steps inside the same workflow right after the Apply labels action.
4. Gate credit-spending steps and put mission-critical actions before webhooks
Two execution details that matter at high volume:
Gate
AI promptconditions andSidekickactions behind deterministic filters: Evaluating an AI prompt condition or running a Sidekick action consumes credits. Always place zero-cost deterministic conditions (Support channel,Tier equals,Label IS) above an AI prompt condition so you only evaluate AI on the subset of traffic that needs it.A failed step halts that branch: If an action fails (for example, a Send HTTP request webhook to an internal service times out or returns
500), execution stops at that step and marks the run as failed in the run log. Always place your core internal actions (Apply labels, Set SLA policy, Set escalation path) before external HTTP webhook calls.
Three core production patterns to wire
Pattern 1: Regional routing with follow-the-sun handover
When EMEA is online, route Compute threads from EMEA accounts to Compute — EMEA; when EMEA is offline and the thread is still unassigned, hand it over to Compute — AMER with an audit note:
Name:
3 Routing · Thread created · Compute EMEA + Follow-the-sunTrigger: Automatic → Thread created and Thread account updated (including Thread account updated ensures threads whose account is attached after creation still route properly)
Condition:
Support email equals compute@yourcompany.com(orLabel IS Product > Compute)ANDAccount field "region" equals "EMEA"Branch 1 (
Outside business hours: EMEA Support Hoursis false):
Apply labels →
Product > ComputeandCompute — EMEASet escalation path →
Compute — EMEA Escalation
Branch 2 (
Outside business hours: EMEA Support Hoursis trueANDNOT Thread has primary assignee):Apply labels →
Product > ComputeandCompute — AMERAdd note →
Routed by: 3 Routing · Thread created · Compute EMEA + Follow-the-sun Reason: Outside EMEA Support Hours — handed to Compute — AMER Account: {{ account.name }} ({{ thread.ref }})
Pattern 2: Tier-wide SLA + per-contract SLA override (Layer 4a & 4b)
Create two tiny, dedicated workflows stacked back-to-back in Layer 4:
4a SLA · Thread created · Enterprise EMEA(sits above):Trigger: Thread created, Thread account updated, Thread tier updated
Condition:
Tier equals EnterpriseANDAccount field "region" equals "EMEA"Action: Set SLA policy →
Enterprise — EMEA
4b SLA · Thread created · Custom contract overrides(sits immediately below4a):Trigger: Thread created, Thread account updated, Thread tier updated
Condition:
Account field "sla_contract" equals "acme-15m"Action: Set SLA policy →
Contract — 15m First Response(overwritesEnterprise — EMEAcleanly)
Pattern 3: Imminent SLA breach escalation
Because your SLA policies include a Notification before target window, you can catch threads before they breach:
Name:
5 Escalation · First response time SLA status changed · Imminent breach alertTrigger: Automatic → First response time SLA status changed (each SLA type has its own trigger, so add the ones you want to cover)
Condition:
SLA status is Imminent breachANDStatus is not DoneActions: Set priority →
Urgent, Add note (tagging the regional lead), and Send HTTP request (or post to your internal#ops-sla-alertsSlack Discussion channel).
Managing workflows as code (Sidekick, template exports, and the GraphQL API)
Every workflow, trigger, condition, and action step is backed by Plain's GraphQL API (createWorkflow, updateWorkflow, bulkUpsertWorkflowSteps). You can also export a workflow as a template:
Cloning regional variants with an LLM / Plain MCP: Instead of clicking through the canvas three times to build identical
AMER,EMEA, andAPACrouting workflows, buildEMEAonce, export it as a template (or read it via the Plain MCP), and ask Cursor or Claude Code to generate theAMERandAPACvariants pointed at your other schedule and team IDs.Safe editing with Sidekick (
Build with AI): When you open a workflow and use Build with AI, Sidekick edits the active graph in place and doesn't keep an undo stack once saved. Always duplicate the workflow or export it as a template before prompting Sidekick to refactor a production workflow, and remember that Saving != Publishing (a live workflow has a Save changes button, and it stays published while you save; Publish workflow is only for a draft).
Verification checklist
Multi-workflow sequence check: Send a test thread for an
EMEAEnterpriseaccount that also hassla_contract = acme-15m. Open Workflows, then Runs, and filter by the thread (Filters, then Thread). Verify Layer 3 routing ran first, Layer 4a (Enterprise — EMEA) ran second, and Layer 4b (Contract — 15m First Response) ran last and won.Audit note + template backup: Confirm the timeline note names the exact workflow that routed the thread, and export your Layer 3 and Layer 4 workflows as templates into your team's Git repo or ops runbook.
Troubleshooting/FAQ
A routing or SLA workflow evaluated to false because the thread's Tier or Account wasn't set yet.
Workflows on the same trigger event run top to bottom on the Workflows page, while workflows on different trigger events (or paused on a Wait step) don't wait for each other. Check these two causes:
The enrichment workflow sits below the routing/SLA workflow (or contains a Wait step)
If the workflow that sets the tier sits below the workflow that reads
Tier equals Enterprise— or if the enrichment workflow hits aWaitorSidekickstep before setting the tier — the downstream workflow runs before the tier is written.Try this: Drag all Layer 2 enrichment workflows above your Layer 3 routing and Layer 4 SLA workflows, and remove any
Waitsteps that sit ahead of data-writing actions.
The Account was attached after thread creation, and the workflow only triggers on Thread created
When an account or tier is populated after creation (via
updateThreadAccountor tier mapping), a workflow listening only to Thread created won't re-run.Try this: Add Thread account updated and Thread tier updated to the automatic trigger on your routing and SLA workflows.
A workflow on Thread labels changed ran when we didn't expect it.
Workflows can start other workflows. When one workflow applies a label, any published workflow on Thread labels changed runs next.
Try this: Add a condition to the downstream workflow so it only acts on the threads you mean, or combine its steps into the first workflow right after its Apply labels step.
We checked for a specific label using "Thread has labels", and the condition matched every labeled thread.
In the workflow builder, Thread has labels is a boolean check for whether the thread has at least one label of any kind (it takes no label argument). Checking for a specific label uses the Label condition (Contains label).
Try this: Replace Thread has labels with Label (Label IS <your-label>) and click Save changes. If the workflow is still a draft, click Publish workflow.
A workflow branch stopped mid-run (or did nothing) after we recreated a team, tier, or SLA policy.
Workflow steps reference objects by internal ID, and any step that points at a deleted object (or a failing external webhook) halts that branch and marks the run as failed in the run log.
Try this: Open the workflow's run log to see which step failed, re-select the recreated team, tier, or SLA policy in that step's dropdown, and click Save changes. If the workflow is still a draft, click Publish workflow.