User guide
Creating Workflows
Open the visual editor and sketch the business process one step at a time. Declare the inputs and check the transition paths before starting a test run.
The example builds an approval workflow in the Studio.
Getting Started
- Navigate to the Workflows section in the backend interface
- Click Create Workflow β the template gallery opens
- Pick a starting point:
- A template: Ready-made flows (order approval, lead-to-install, task escalation, webhook integration) you can preview and then adapt
- Blank canvas: the gallery's Blank card starts you on an empty canvas
Either way you land in the Studio. It is the only workflow editor β the old
form editor has been retired (see The Studio is the only editor).
For this guide, we'll start from a blank canvas.

Workflow visual editor with a seeded sales order approval definition loaded from the Open Mercato demo instance
Using the Visual Editor
1. Add a START Step
Every workflow begins with a START step:
- Click START in the step palette on the left
- A green node appears on the canvas
- This is your workflow's entry point β it automatically advances when the workflow starts
2. Add a USER_TASK Step
Next, add a step that requires human input:
- Click USER TASK in the step palette
- An amber node appears on the canvas
- Click the node to select it, then click Edit or double-click the node
- Configure the task:
- Step Name: "Approve Purchase Request"
- Description: "Review and approve or reject the purchase request"
- Assigned to Role: "Approvers" (or choose a specific user)
- Form Key: Optional identifier for a custom form
- Allowed Actions: "complete" and "cancel"
π‘ Tip: When assigning to a role, any user with that role can claim and complete the task.
3. Connect the Steps
Create a transition from START to your user task:
- Hover over the START node β small handles appear on its edges
- Click and drag from the handle to the USER_TASK node
- Release to create a connection (transition)
- The workflow will automatically move from START to the user task
4. Add Decision Paths
Let's add two END steps for "Approved" and "Rejected" outcomes:
- Click END in the step palette twice to add two END nodes
- Click the first END node and rename it to "Approved"
- Click the second END node and rename it to "Rejected"
- Connect the USER_TASK to both END nodes:
- Drag from the user task to "Approved"
- Drag from the user task to "Rejected"
Click each transition to configure when it should be taken:
Transition to "Approved":
- Click the edge connecting USER_TASK to "Approved"
- In the properties panel, set:
- Transition Name: "Request Approved"
- Trigger: "manual" (requires user action)
- Pre-Conditions: Optional β add a rule like
context.decision === 'approve'
Transition to "Rejected":
- Click the edge connecting USER_TASK to "Rejected"
- Set:
- Transition Name: "Request Rejected"
- Trigger: "manual"
- Pre-Conditions: Optional β add a rule like
context.decision === 'reject'
6. Add Activities
Let's send an email notification when the request is approved:
- Click the transition to "Approved"
- In the properties panel, find the Activities section
- Click Add Activity
- Configure the activity:
- Activity Type: "SEND_EMAIL"
- Activity Name: "Notify Requester"
- Fill in the type-specific form fields:
- To:
{{context.requesterEmail}}
- Subject:
Your request has been approved
- Body:
Your purchase request for {{context.itemName}} has been approved.
Each activity type shows its own form fields. If you need to paste or fine-tune raw configuration, expand the Advanced (JSON) section on the activity.
π‘ Tip: Use {{context.fieldName}} to insert workflow data into activity configurations. Invalid configuration is flagged as a non-blocking warning when you save.
Learn more about activities β
7. Save and Enable the Workflow
- Click Save in the top toolbar
- Enter a Workflow ID: "purchase-approval-v1" (lowercase, hyphens allowed)
- Enter a Workflow Name: "Purchase Approval"
- Optionally add a Description: "Routes purchase requests through approvers"
- Set Version: 1
- Toggle Is Active to enable the workflow
- Click Save Definition
Your workflow is now live and ready to accept new instances.
Draft Autosave
While you edit, the editor autosaves your work as a personal draft every few seconds. Drafts never change the published definition β only clicking Save does. If you leave and come back with unsaved changes, a banner offers to Restore draft or Discard it; if someone else saved the definition in the meantime, the banner says so before you restore. A successful save removes the draft.
Declaring Workflow Inputs (Context Panel)
The definition panel has a collapsible Context section where you declare the inputs your workflow expects β each with a name, a type (text, number, boolean, select, date), an optional label, a required flag, and options for selects.
Declared inputs power the rest of the editor: they appear in the variable picker at every step with their types, required inputs are shown as always available, and optional ones carry a maybe marker. Declaring inputs is optional, but workflows with a declared context are far easier to configure and test.
Starting a Workflow from an Event
The definition panel's Triggers section starts a workflow automatically when something happens elsewhere in the system.
- Event pattern β pick the event from the list of events the application declares, or type a pattern with
* as a wildcard (sales.order.*).
- Filter conditions β narrow which occurrences count. When the chosen event declares a payload shape, the condition builder offers its payload paths and types instead of asking you to type them; wildcards and events without a declared payload fall back to free text with a note saying so.
- Context mapping β copy values out of the event payload into the new instance's starting context. Source paths come from the same typed list, and the mapped keys then appear in the variable picker at every step, so a triggered workflow is not a black box.
- Debounce β the first event for a given record starts a workflow instance immediately; further events for the same record within this many milliseconds are skipped, so a burst of similar events starts one instance instead of many, and that instance sees the first event's payload. The window is tracked per application process. Empty means no debouncing β every matching event starts an instance.
- Max concurrent instances β cap how many instances this trigger may have running at once; events past the cap are skipped. Empty means no limit.
When a workflow has several versions, its event triggers fire only from the newest enabled, published version β the same version a start without a pinned version runs. Older versions stay available to the instances and sub-workflow callers already pinned to them, but their triggers no longer start anything, so change triggers on the newest version. Disabling or deleting the newest version hands the triggers back to the next enabled, published one.
The Variable Picker
Every configuration field that accepts {{ }} templates β activity config inputs, mapping value cells, and trigger expressions β has a variable picker button. It opens a popover listing exactly what is available in context at that point in the workflow:
- Entries are grouped by source (workflow inputs, trigger data, activity outputs, user-task form fields, signals, and so on)
- Each entry shows a type badge (
text, number, boolean, select, date, object, or unknown when the engine cannot know the shape)
- Entries that are only present on some paths through the workflow carry a maybe marker β guard against their absence before relying on them
- When a sample is available for the step, the entry shows its sample value
Clicking an entry inserts {{path}} at the cursor.
Unresolved Reference Warnings
The Problems panel warns when an expression references context that nothing in the workflow produces β a typo in a path, or a reference to an output of a step that never runs before this one. These are warnings, never blockers: the definition still saves, because the editor cannot always prove a value will be absent at runtime.
Testing a Step
You can dry-run a single activity without executing the workflow. Open an activity's configuration and use the Test step panel:
- The editor builds a sample context for the step β from your pinned sample if you have one, otherwise from the last test output, otherwise from typed placeholders
- Running the test interpolates the config against that context and shows the resolved values plus the activity's output preview
- Side-effecting activities never actually execute β they return a simulated "would do" result (for example,
wouldSendTo for an email) or a structured refusal when the activity cannot be safely simulated
- Pin as sample stores the test output as the step's sample so the picker and future tests reuse it
Testing steps requires the Test workflow definition steps permission.
Warning Β· Samples are stored as-is
Pinned samples are saved inside the workflow definition without redaction or encryption and are visible to anyone who can view the definition. Do not pin real customer data or secrets β use representative fake values instead.
Alongside every step and route inspector sits an Input data panel: the same grouped listing the variable picker shows, docked next to the fields you are filling in. It lists what is in context at that point, with type badges, maybe markers, and sample values where one is available.
Every row is draggable and clickable:
- Drag a row onto any template-capable field and the path is inserted at the caret, in that field's own notation (mapping cells get the bare path, template fields get
{{path}})
- Click a row and it is inserted the same way β drag is an enhancement, never the only way in, so the keyboard path is unaffected
Editing on the Canvas
The Studio is a real editor, not a read-only diagram:
- Undo / redo β
Cmd/Ctrl+Z and Cmd/Ctrl+Shift+Z cover every canvas edit: adding, deleting, connecting, re-targeting, converting, pasting, moving and tidying, plus inspector saves. The stack holds 100 entries and survives opening and closing panels and dialogs. Text fields in the workflow-details panel are deliberately not on this stack β they have normal input undo. Restoring a draft, loading a template or clearing the canvas resets it.
- Copy, paste and duplicate β select one or more steps and use
Cmd/Ctrl+C / Cmd/Ctrl+V / Cmd/Ctrl+D. The clipboard carries a portable JSON subgraph, so a fragment can travel between workflows and in and out of the Code view. Pasting always creates new step and route ids, so it can never merge into or collide with the original. Only routes whose both ends are inside the selection travel with it. If the browser blocks clipboard access, the editor falls back to an in-page buffer and tells you.
- Drag from the palette β drag a step onto empty canvas to place it under the cursor, or drop it onto a route to splice it in between that route's endpoints. Dropping an action onto a route appends it to that route's activities. Clicking a palette entry still appends a step, which is what keeps the palette usable from the keyboard.
- Re-target a route β drag a route's endpoint onto another step. The route keeps its name, condition, priority and activities; only the endpoint changes. Invalid targets (a self-loop, a duplicate route, an error route moved onto a step that cannot fail, anything that would break parallel branches) snap back with the reason stated.
- Change a step's type β the step inspector has a Change typeβ¦ control. The step keeps its id, name, position and wiring; configuration the new type genuinely shares is carried over; anything the new type cannot execute is parked in a read-only Unmapped configuration drawer on the step and flagged in Problems. Nothing is deleted, so converting back recovers it. START and END cannot be converted.
- Notes and groups β add markdown sticky notes and named, collapsible group frames to explain a flow. They are documentation only: they are stored in the definition's editor metadata, never executed, and never affect validation or routing.
- Icons β the workflow's icon is picked from a searchable icon grid instead of typed as a name. An icon name that is not in the grid is still stored as you typed it.
Manual Layout Wins
New steps are laid out automatically, but once you move a card, that position is yours: it is saved with the definition and survives reloads, drafts and saves. The Auto-arrange button is the one action that re-lays the whole canvas. A drag is saved once, when you drop it β not on every frame.
Keyboard and the Command Palette
Every canvas operation is reachable without a mouse.
Cmd/Ctrl+K opens the command palette: undo/redo, delete, copy/paste/duplicate, add any step type, add a note or group, jump to any step, Auto-arrange, every panel toggle, Validate, Start instance and Save. Commands that cannot run right now are shown disabled with their shortcut, never hidden.
Enter opens the inspector for the selected step or route, Delete/Backspace deletes it, and the arrow keys nudge it (hold Shift for a coarser step).
F toggles focus mode. Inside any dialog, Cmd/Ctrl+Enter submits and Escape cancels.
- All of these are suppressed while you are typing in a field or a dialog is open β except
Cmd/Ctrl+K, which is deliberately always available, because it is the way out of any focus.
Steps announce themselves as type, name and status, and status is never signalled by colour alone: every state pairs its colour with its own icon and a text label.
The Code View
The Code button opens the definition JSON alongside the canvas.
- What you read is exactly what a Save would store β it is assembled from the same payload builder the Save button uses, not a separate rendering.
- Copy JSON copies the whole definition; Paste steps pastes a subgraph copied from the canvas, using the same clipboard format.
- The panel repeats the Problems list, so the schema view and the canvas can never disagree about what is wrong.
The Code view is read-only in this release: you cannot type into it, and the canvas remains the source of truth. Two-way editing with live error highlighting is planned for a later phase.
Validation and Saving
Validation runs as you edit, and every issue appears in two places: as a badge on the step or route it belongs to, and as a row in the Problems panel that you can click to jump straight to it. Errors block a save; warnings never do.
If a save cannot go through, it says so:
- Validation errors open the Problems panel with the full list and state how many errors there are. Nothing is sent, and your edits stay exactly where they are.
- A rejection from the server shows the server's own message. Again, your edits stay on the canvas β you never lose work to a failed save.
- A conflicting edit by someone else surfaces the standard conflict bar with a refresh action.
Editing a Workflow That Is Running
Instances keep executing the exact definition version they started on, and the engine re-reads that record as they advance. So if you change the structure of a definition β add or remove steps, change a step's type, re-wire or re-target routes, change fork/join wiring β while instances are still running, the save is refused with a banner explaining how many instances are affected.
The banner's Create version button mints the next version and applies your edit there, so running instances finish on the old version and new runs start on the new one. Labels, positions, activity configuration, conditions, priorities, triggers and metadata are not structural and always save in place. Draft autosave is never blocked β work in progress is always saveable.
The Studio Is the Only Editor
The old form editor has been retired. Everything it did now lives in two places:
- The inspectors took over structured editing β every step, route and trigger is edited in a validated form, with an Advanced (JSON) escape hatch on activity configuration.
- The Code view took over reading and bulk copy/paste of the raw definition.
Existing links keep working: /backend/definitions/create and /backend/definitions/<id> now forward to the Studio with the same permissions as before. They will be kept for at least one minor release, so bookmarks and any deep links you have saved do not break.
Best Practices
Naming Conventions
- Step IDs: Use lowercase with hyphens (e.g.,
start, approve-request, send-notification)
- Step Names: Use clear, action-oriented labels (e.g., "Approve Purchase Request", not "Approval")
- Transition Names: Describe the outcome (e.g., "Request Approved", "Payment Received")
Organizing Steps
- Keep workflows linear when possible β avoid complex branching unless necessary
- Group related steps visually by positioning them near each other
- Use descriptive names so the workflow is self-documenting
Error Handling
- Add timeout configurations to steps that might hang
- Configure retry policies for activities that call external APIs
- Use compensation activities to roll back changes on failure
Learn more about compensation β
Testing Workflows
Before going live:
- Dry-run individual activities with the Test step panel
- Create a test instance with sample data
- Complete each step manually to verify behavior
- Check the execution timeline for errors
- Review email notifications and API calls in the monitoring view
Learn more about monitoring β
Example: Simple Approval Workflow
Here's the complete workflow we just built:
Steps:
- START β Auto-advance to next step
- Approve Purchase Request (USER_TASK) β Wait for approver decision
- Approved (END) β Workflow complete, request approved
- Rejected (END) β Workflow complete, request rejected
Transitions:
- START β Approve Purchase Request (auto trigger)
- Approve Purchase Request β Approved (manual, sends approval email)
- Approve Purchase Request β Rejected (manual)
Context Data:
{
"itemName": "Laptop",
"amount": 1500,
"requesterEmail": "[email protected]",
"decision": "approve"
}
When started, this workflow:
- Creates a task for any user with the "Approvers" role
- Waits for the approver to complete the task
- Sends an email if approved
- Ends the workflow
Next Steps
Now that you've created your first workflow:
See Also: