How to Write Your First Workflow Rule in Ensoras
A step-by-step walkthrough for creating your first workflow in Ensoras: trigger strategy, confidence threshold, AI instructions, available tools and actions, and how to test before going live.
This guide walks through creating your first workflow in Ensoras. We'll use WISMO ("Where is my order?") as the example because it's the canonical first workflow and one of the highest-volume support categories on most ecommerce stores.
Before you start
You'll need:
- An active Ensoras project
- Shopify or another order-data integration connected (so the AI has order data to look up). The Shopify connection guide walks through that.
- A knowledge base with at least your shipping policy uploaded. The knowledge base guide covers that.
- About 30 minutes including testing
Step 1: Open the Workflows page
In your Ensoras admin panel, go to Automation > Workflows. You'll see your existing workflows (the Shopify integration creates several by default if you've connected) and a button to create a new one. Click New workflow.
Step 2: Fill in the basic information
The form opens with a Basic Information section:
- Workflow Name, be specific. "WISMO, Where is my order" is better than "Order status." The name is internal-only; customers never see it.
- Priority, High, Medium, or Low. Priority decides which workflow wins when two workflows could both match a message. WISMO is usually Medium because it's not an urgent escalation but it should match before generic catch-all workflows.
- Description, internal notes for your team. Useful when you have many workflows; not customer-facing.
Step 3: Set the trigger strategy
The Trigger Configuration section is where you tell Ensoras when to fire this workflow. The dropdown gives you four options:
- Ensoras Analysis (recommended), the AI reads each incoming message and decides whether it matches your workflow's intent based on plain-English instructions you write. Most flexible.
- Keywords, fires when specific words appear in the message. Fast but brittle (customers don't always use the words you predict).
- Phrases, fires when specific phrases appear. Slightly more precise than keywords; still brittle.
- Regex Pattern, fires when the message matches a regex pattern. Powerful for structured patterns (order numbers, tracking IDs); overkill for natural language.
Pick Ensoras Analysis for your first workflow. The other strategies are useful for specific cases later.
Step 4: Write the AI instructions for the trigger
When you pick Ensoras Analysis, the form shows two fields:
- Ensoras Instructions, plain-English description of when this workflow should fire. For WISMO: "Trigger when a customer is asking about the status, location, or delivery time of an order they've already placed. This includes questions like 'where is my order', 'has my package shipped', 'when will it arrive', 'tracking link broken', and similar phrasings. Do not trigger for pre-purchase questions about shipping rates or delivery times."
- Confidence Threshold, a slider from 0.0 to 1.0. Start at 0.70 for a first workflow. Lower values fire more aggressively (more matches, more false positives); higher values fire more conservatively (fewer matches, fewer false positives but more escalations).
The threshold is the most important tuning knob you'll touch. After your workflow runs on a few hundred real tickets, look at the matches: if the AI is firing the workflow on tickets it shouldn't have, raise the threshold. If the AI is escalating tickets that obviously should have matched, lower it.
Step 5: Write the AI instructions for what to do
The Ensoras Instructions section (different from the trigger one) is where you describe what the AI should actually do once the workflow fires. For WISMO, something like:
"When this workflow runs, look up the customer's most recent order using the Order Lookup tool. If the order has a tracking number, reply with the carrier name, tracking link, current status, and estimated delivery date in a friendly tone. If the order has no tracking number yet but was placed less than 5 days ago, explain that it's still being processed and give the expected ship date. If it's been more than 5 days with no tracking, escalate to a human and let the customer know someone will follow up shortly."
Notice the structure: it tells the AI what to do, how to handle the main case, and what to do in edge cases. The clearer this instruction, the more predictable the AI's behavior.
Step 6: Pick available tools
The Ensoras Tools Configuration section is a multi-select listing every tool currently set up in your project. Pick only the tools the AI needs for this workflow.
For WISMO, the typical set:
- The Shopify order lookup tool (matches what the workflow's instructions reference)
- The Shopify customer lookup tool (so the AI can identify the customer when needed)
- A knowledge base search tool (for policy questions that come up alongside order status)
Don't pick tools you don't need. If WISMO has access to the refund tool, the AI might use it inappropriately. Tight tool scope keeps each workflow focused.
Step 7: Pick available actions
The Available Actions section is similar but covers the discrete operations the AI can take after responding (tagging the ticket, changing status, sending a Slack notification, etc.). For WISMO, useful actions:
- Tag ticket as "wismo-resolved" so you can track WISMO volume in your reports
- Change ticket status to closed if the AI's reply fully answered the question
You can leave actions empty for a first workflow and add them later.
Step 8: Set the active channels
The Channel Configuration section controls which channels this workflow runs on. For most workflows, leave it blank (which means "all channels"). Use it when:
- You want a workflow to run only on email but not chat (or vice versa)
- You have channel-specific behavior, for example, a workflow that handles legal-language escalations might only need to run on email since live chat already has different escalation rules
For WISMO, leaving it blank is right.
Step 9: Add behavior instructions
The Response Personality & Guidelines section is for tone and style. For most workflows, you can leave this blank if you've set a project-wide AI configuration (in Automation > Configuration). For WISMO specifically, useful additions:
"Keep replies under three short paragraphs. If the customer's order is delayed, lead with sympathy before getting to the data. Never use phrases like 'kindly note' or 'please be advised', they sound robotic."
Step 10: Save and test
Save the workflow. It's now live for the active channels. Send yourself a test message that should match: "Hi, can you check on my recent order?"
In your Ensoras admin panel, find the resulting ticket and check the conversation log. You should see:
- The message arriving as a new ticket
- Ensoras matching this workflow (look for the workflow name in the tool execution log)
- The AI invoking the order lookup tool
- The AI sending a reply with the order data
If the workflow doesn't match, check your trigger instructions and threshold. If it matches but the reply is wrong, check the tool list and the AI instructions for the action.
A more careful rollout
If you'd rather not go straight to live customers with a brand-new workflow, run it in shadow mode first. Pull 20–30 historical tickets in the WISMO category and feed them through the workflow in test mode (your admin panel may have a "test on a sample" feature; if not, you can manually send them through your test channel). For each, check whether the workflow fired correctly and whether the reply would have been good enough to send.
This sample run usually surfaces 2–4 edge cases you didn't think of when writing the trigger instructions. Refine, re-run, and only go live once the sample looks clean.
Common issues
The workflow doesn't fire on messages that obviously match. Either the trigger instructions are too narrow (rewrite them with more variations) or the confidence threshold is too high (lower from 0.70 to 0.60 and try again).
The workflow fires on messages it shouldn't. Either the trigger instructions are too broad (rewrite to exclude the cases that shouldn't match, explicitly call them out, e.g., "do not trigger for pre-purchase shipping questions") or the threshold is too low (raise from 0.70 to 0.80).
The AI replies but doesn't use the right tool. The tool isn't in the Available Tools list for this workflow, or the AI Instructions for the workflow don't reference the tool by name. Both fixes are quick.
The reply tone is off. Add specific guidance to the Response Personality section. The AI inherits your project-wide configuration but workflow-specific tweaks override.
What this unlocks
A working WISMO workflow handles 40–60% of typical ecommerce inbound volume autonomously. The AI runs the lookup, builds the reply, sends it. Your team stops typing the same five-line response 80 times a week and starts spending their day on the actually-hard tickets.
After WISMO is solid, the natural next workflows: returns initiation, address changes, subscription edits. The What to Automate First tier list covers the order to attack categories in.
What to do after this
Once your first workflow is running:
- Monitor it for a week. Look at the matches it took, the matches it missed, and the CSAT on AI-replied tickets in this category.
- Configure refund automation when you're ready to graduate from "AI answers questions" to "AI takes actions."
- Read the When/If/Then framework if you want a deeper take on writing rules that hold up in production.
The first workflow is the hardest because it forces you to think clearly about your trigger language, your tool scope, and your tolerance for false positives. After the first one, the rest go faster.
Sources
- Anthropic, Building effective agents, model-provider research on the structured-trigger / bounded-action pattern that workflow design relies on.
- OpenAI, Function calling documentation, official documentation on the tool-calling behavior that workflows use under the hood.
Frequently asked questions
Do I need to know how to code to write a workflow?
No. Ensoras workflows are described in plain English. You write what should trigger the workflow, what the AI should do, which tools and actions are available, and which channels apply. The AI handles the technical execution.
What's the difference between a workflow and a tool?
A tool is a single capability (look up an order, process a refund, search the knowledge base). A workflow is the higher-level rule that decides when the AI is allowed to use a set of tools. You can think of tools as verbs and workflows as the policies that say which verbs apply when.
Should I create one big workflow or many small ones?
Many small ones. One workflow per ticket category gives you cleaner control, easier debugging, and per-category confidence thresholds. The default Shopify integration creates separate workflows for WISMO, returns, refunds, and so on for exactly this reason.
What does the confidence threshold actually do?
When a customer message comes in, Ensoras assesses how confidently it can match the message to your workflow's intent. If the confidence score is at or above your threshold, the workflow runs. Below the threshold, the workflow doesn't run and the AI either tries another workflow or escalates to a human.
How do I know if the workflow is working after I save it?
Send a test message that should match the workflow's trigger and watch what happens in the conversation log. If the AI invokes the right tools and replies correctly, you're done. If it doesn't, the most common cause is a misspelled tool name in the workflow's Available Tools list or a confidence threshold set too high for the test message.