Step 6: Your first workflow
Where you start unlocking the true potential of Plain is when you can start building out workflows. If you're coming from Zendesk, Plain workflows are a more flexible version of triggers, automations, and macros combined — think Zapier or n8n, with an intuitive visual workflow editor built directly into your workspace. We'll build one routing workflow that runs on every new thread and walk through how to verify it’s working as expected in the run log.
What good looks like
What we define as "good" for this step is one custom, published workflow that has run end-to-end on a real test thread:
You send a test message from a customer whose account is in your
EnterprisetierThe workflow triggers, adds the
Supportteam label (which hands the thread to auto-assignment from Step 5), sets priority to High, applies yourEnterprise first responseSLA policy, and drops an internal note on the timelineOpening the workflow's run log should identify the trigger that launched the workflow, the conditions it matched, and every action that completed successfully.
Ideally, you’ll want to see that every new thread is landing in your team's queue, and that threads from your highest-tier customers are getting the proper priority and SLA timers set via your workflow.
What to consider
Keep your first workflow boring. The temptation with a canvas builder is to map out every edge case on day one; in practice, the workflow that delivers 80% of the value for a small team is the boring one that routes every thread to the correct team, applies the correct SLA policy, and gives agents the context they need to answer the question. Get this one published and running first, then continue to extend it to suit your team's specific way of working.
Workflows can also be sequenced, so fight the urge to have sprawling, branched mega-canvases that are tough to iterate on.
The mental model: how workflows are structured, ordered, and built
Before you open the builder, it helps to understand how Plain workflows work under the hood — you'll learn how a workflow is constructed, how it interacts with other workflows in your workspace, and why their API-first design means you don't have to wire every box by hand.
How a workflow is constructed
Every workflow on the canvas is built from the same four building blocks, evaluated from top to bottom:
Trigger (what starts the run): triggers can either be Manual (triggered manually) by a teammate from a thread or via
⌘K) or Automatic, which, as you may have guessed, fire automatically based on system event(s) — common triggers include Thread created, Message added, Thread status changed, Thread labels changed, Thread tier updated, or Customer Agent unassigned, though this is just a small subset of the automatic triggers available to you.Condition steps (gates which determine what path the thread takes through the workflow):
If / Else-if / Elsebranches that check properties on the thread, the customer, or the account before deciding which actions to run. A few common examples:Tier:
Tier equals Enterprise— give higher-tier customers a faster SLA policy and elevated priorityAccount field:
MRR >= 2000— branch on a custom CRM or backend attribute synced onto the accountSupport channel:
Support channel equals Slack— handle Slack threads differently from email or portal requestsLabel:
Label IS bug— route bug reports to an engineering queue or require abug_severitythread fieldBusiness hours:
Outside business hours (Support hours)— send an after-hours expectation reply when the team is offlineAI prompt: "The customer is asking to cancel their subscription" — let Plain AI evaluate the message in plain English when keyword matching is too rigid
Action steps (what actions Plain takes): The actual work Plain performs on the thread. A few common examples:
Apply labels: Add your
Supportteam label (or let Plain AI pick from your topic labels automatically)Assign to / Assign to team: Route the thread to a team rotation, a specific teammate, or the Customer Agent
Set priority: Bump the thread to
HighorUrgentso it floats to the top of your viewsSet SLA policy: Attach your
Enterprise first responsepolicy to start the countdown clockAdd note: Drop an internal note on the timeline with context variables like
{{ account.name }}and which workflow ranSend message: Reply to the customer automatically (for example, an after-hours expectation message)
Send HTTP request: Fire a webhook payload to an external system or internal Slack channel
Wait steps (add an intentional pause between workflow steps): Delays the next step in the workflow for a set duration (with Only during business hours toggled on if you want the timer to pause overnight and on weekends), and optionally cancels the wait if a condition is met in the meantime. A few common examples:
Auto-follow-up / auto-close: Wait
7 daysafter a thread is set toWaiting for customer(canceling if the customer replies), then send a closing note and set status toDoneUnassigned escalation: Wait
30 minutesduringSupport hours(canceling once Thread has primary assignee is true), then post a heads-up to your team's Slack channelBreach warning: Wait
45 minuteson anUrgentthread (canceling ifStatus equals Done), then escalate to an engineering team label
A few gotchas to consider:
Saving != publishing: Publishing is evaluated independently from saving a workflow — make sure to set to published prior to saving if your workflow is meant to be live. Once a workflow is published, editing it requires clicking Unpublish, making your changes, and clicking Publish again.
Steps run in sequence, and a failed step stops that branch: If an action fails (for example, pointing at an SLA policy or webhook that errors out), the workflow stops at that step and marks the run as failed in the run log. Put your most important actions (like adding your team label) first.
Variables that don't resolve render as empty: Referencing
{{ account.name }}or{{ customer.fullName }}in a note or message won't fail the step if the value is blank on that thread — it simply renders as empty.
How workflow sequencing works
When a single event (like Thread created) matches multiple published workflows, Plain doesn't fire them all at random — it runs them sequentially from top to bottom in the exact order they're stacked on your Workflows page.
Enrichment goes at the top, routing goes below it
Any workflow that writes context onto a thread (setting a tier, updating a field, or filtering out obvious spam) should sit above the workflows that read that context to route the thread or apply an SLA policy.
Gotchas with run order and cross-workflow triggers
Labels added by a workflow don't trigger other
Thread labels changedworkflows: Plain blocks this intentionally so two workflows can't trap each other in an infinite loop. Even if Workflow A is above Workflow B, Workflow A adding a label on Thread created will not fire Workflow B if Workflow B only listens to the Thread labels changed event. Either set both workflows to trigger on Thread created (in top-to-bottom order), or put the routing steps directly inside the first workflow right after its Add labels step.Wait steps and Sidekick steps don't block the rest of the queue: If Workflow 1 hits a Wait step (or a Sidekick action), Plain pauses Workflow 1 and moves on to start Workflow 2 below it rather than holding up the line.
Building workflows with AI (Sidekick or your own LLM)
Because workflows in Plain are rooted in the API, you don't have to drag and connect every node from scratch. Every workflow, trigger, condition, and step is backed directly by our GraphQL API (createWorkflow, updateWorkflow, bulkUpsertWorkflowSteps) and a structured, intuitive JSON schema that any agent can understand and build off.
In the UI with Sidekick
When you click Add workflow on the Workflows page and the Sidekick Agent is enabled for your workspace, you'll see a menu with three options:
Build with AI
Start from scratch
Start from a template
Choosing Build with AI opens the canvas alongside Sidekick, our internal agent. You can describe what you want in plain English ("When a thread is created or its tier updates, add the Support label. If it's Enterprise, set High priority and the Enterprise first response SLA."), and Sidekick will assemble the trigger, branches, and actions live on the canvas.
With your own LLM or agentic tool
Because the workflow mutations are public in the API and exposed in the Plain MCP, you can also use Claude, Cursor, or any other LLM with a machine user API key (or exportWorkflowTemplate JSON) to draft, clone, or bulk-update workflows via prompting.
Our recommended workflow
Have AI draft the initial structure and conditions via prompting first, then use the visual canvas to inspect the branches, tweak copy, and make minor adjustments by hand before clicking Publish.
How to implement
Step 1: Build and publish the routing workflow
Click on Workflows in the sidebar and click Add workflow (choose Build with AI to have Sidekick draft the steps below from a prompt, or Start from scratch to wire them on the canvas yourself)
Give it a descriptive name so you can tell what it does from the list — we recommend
<area> · <trigger> · <action>, e.g.Routing · Thread created · Support + Enterprise SLAIn the Configure trigger panel that opens on the right, leave the Trigger on Automatic (the default for a new workflow), then open Select events and pick Thread created and Thread tier updated (triggering on Thread tier updated means that if an account moves into into the
Enterprisetier after the thread has already been created, the thread still picks up the SLA policy)
On the canvas, drag the Apply labels block from the Add block panel (its settings panel is titled Add labels), then click Add label and pick your
Supportteam label
After that step, add an If/else condition step set to Tier Is
Enterpriseto split the workflow into two branches:
On the If branch (the thread belongs to an
Enterpriseaccount), add three action steps in sequence:Set priority →
HighSet SLA policy →
Enterprise first response(available on Horizon and Frontier; skip this step if you're on Foundation)Add note → paste the internal note template below so your team can see at a glance which workflow routed the thread
On the Else branch (the thread belongs to any other tier), leave it empty — the thread already received the
Supportteam label in step 4 above, so it will still auto-assign to a teammate, just without the elevated priority or SLA timer.
Click Publish workflow in the top right. Publishing also saves the workflow (there is no separate save step), the badge next to the workflow name changes from Draft to Published, and a toast confirms Workflow published and active. Then return to the Workflows list and confirm the workflow shows as published
For the Add note step on the If branch, include the workflow's name in the note — once you have several workflows running, the first question when a thread routes somewhere unexpected is "which workflow did this?":
Routed by: Routing · Thread created · Support + Enterprise SLA Account: {{ account.name }} Customer: {{ customer.fullName }} ({{ customer.email }}) Ref: {{ thread.ref }}
Step 2: Check the run order
Back on the Workflows page, check where your new workflow sits in the list. If you have any workflow that sets a tier, an account field, or a label that this workflow depends on, drag that workflow above this one so it runs first.
How to verify if this step is working/complete
Send a test email or Slack message from a personal address belonging to a customer whose account is in your
Enterprisetier.Open the thread in Plain and confirm it has the
Supportlabel, an assigned teammate, priority High, theEnterprise first responseSLA timer in the header (Horizon+), and the internal note on the timeline.Open Workflows → Runs and click today's run for your workflow — confirm its Status is Success, the If/else step is Matched, and every action is Completed. If a run fails, Steps shows where it stopped and Executed on opens the thread it ran on.
Send a second test from a customer not in
Enterpriseand confirm it gets theSupportlabel and an assignee, without the High priority or SLA policy.
Troubleshooting/FAQ
The workflow's "last triggered" is empty.
A workflow only runs against events that happen after it's published, so an empty run log usually means the workflow wasn't live when your test came in. Here are the two reasons that happens:
The workflow is still a draft
Saving a workflow and publishing it are separate steps — saving doesn't mean that your workflow is live.
Try this: Open the workflow and confirm the status reads Published, then send a fresh test.
The test thread was created before you clicked Publish
Plain doesn't re-run workflows over threads that have already been created if the trigger is set to Thread created.
Try this: Send a brand-new test message after publishing and check the run log for a run from the last few minutes.
The workflow triggered, but the Tier equals Enterprise condition evaluated to false
The condition reads the tier on the thread, which comes from the account the thread was attached to when it was created. Usually the account isn't in Enterprise yet because tier mapping from Step 3 is pointed at a different field, or the field value doesn't match the option name exactly.
Try this: Open the test customer's account page and check the Tier field. If it's empty, confirm the tier mapping from Step 3 is pointed at your plan field and that the option names line up (or, if you don't have a CRM integration enabled, you can simply add the appropriate tier manually from the account page), then send a new test.
The condition matched, but Set SLA policy did nothing
An action that points at an object that doesn't exist (in this case, the SLA policy) stops the workflow at that step, and the run is marked failed in the run log. Either the SLA policy from Step 5 hasn't been created yet, or you're on Foundation, where SLA policies aren't included.
Try this: On Horizon or Frontier, create the policy under Settings → SLA policies and re-select it in the workflow's Set SLA policy step. On Foundation, remove the step and lean on the unassigned view from Step 5.
The Support label was added, but nobody was assigned
Auto-assignment is a setting on the team label, not on the workflow. It only acts on unassigned Todo threads, and skips anyone who is Away, Offline, on Break, or at max capacity — so either the thread already had an assignee, or nobody on the team was eligible.
Try this: Work through the auto-assignment item in Step 5's Troubleshooting/FAQ. If this workflow also has an Assign to user step, make sure it runs after Add labels, or remove it, since the team label is handling routing already.
My second workflow ran before my first one finished setting the tier.
Workflows on the same event run top to bottom on the Workflows page, so a workflow that reads a value another workflow writes has to sit below it. A workflow on a different trigger event has no fixed position relative to this one.
Try this: Put both workflows on the same trigger event and drag the one that sets the data above the one that reads it. If they can't share an event, move the read step into the same workflow, after the write step.