Building & Testing Workflows in the UI
Building & Testing Workflows in the UI
The Visual Workflow Editor (/ai-suite#/workflows) lets you create, wire up, test, version, and publish multi-step AI and PHP workflows directly in the browser.
1. Step-by-Step: Creating a New Workflow
- In the top navigation bar, click Workflows.
- Click the blue + New Workflow button in the top-right corner.
- In the Create New Workflow modal, fill in the fields:
- Name (required): The display name of your workflow (e.g.,
Order Return Handler). This also generates a matching PHP class inapp/Ai/Workflows/{StudlyName}Workflow.phpwith a unique 8-charactersync_hash. - Description (optional): A short summary displayed in the Workflows overview table.
- Test Mode (toggle, enabled by default): Marks the workflow with an orange
Testbadge so it does not run in production until disabled.
- Name (required): The display name of your workflow (e.g.,
- Click Create. You are automatically redirected to the Visual Workflow Editor (
/ai-suite#/workflows/{id}/edit) with an initialStart Pointnode placed on the canvas.
2. Step-by-Step: Building the Workflow Graph in the Visual Editor
The Visual Workflow Editor (/ai-suite#/workflows/{id}/edit) is divided into three main areas:
- Left Sidebar (
Modules): Draggable workflow building blocks. - Center Canvas: Interactive node-and-edge graph (supports pan, zoom, and fit-to-view controls in the bottom-left corner).
- Right Sidebar (
Configuration&Test Workflow): Context-sensitive node/edge/workflow settings on top, and an interactive test chat at the bottom.
Adding & Connecting Modules (Nodes & Edges)
- Drag a Module to the Canvas: Drag any module from the left Modules sidebar (
Start Point,Agent,PHP Code,If / Else,Statement,Enum,Enum Value,Pre-defined Response,Human in the Loop,Stop Point) and drop it onto the canvas. - Connect Two Nodes: Drag a connection line (edge) from a node's output handle (bottom or right circle) to the target node's input handle (top or left circle).
- Reconnect or Delete an Edge:
- Drag an existing edge's endpoint to move it to a different handle.
- To remove a connection, click the edge line on the canvas and click Delete Edge in the right Configuration panel.
Configuring Individual Nodes
Click any node on the canvas to open its settings in the right Configuration panel:
- ID (Unique within workflow):
Every node gets an auto-generated ID (such as
agen_000000001orphpc_000000002). You can type a custom ID (e.g.,node_php) and pressEnteror click outside the field—all connected edges update automatically. DownstreamAgentnodes can reference this node's output in their prompt using{{node_id}}. - Agent Node (
agent): Select the Agent Class from the dropdown. If the agent has a database record, click View or edit instructions for this agent → to jump directly to its CRAFT prompt editor (/ai-suite#/agent/{id}/edit). - If / Else (
if_else) & Statement (statement) Nodes:- Connect the output of an
If / Elsenode to one or moreStatementnodes. - Click each
Statementnode to configure its branching rule:- Statement Type: Select
Match (If / Elseif)for a condition, orElse (Fallback)for the default route when no match condition is met. - Match Key (Dot-notation, optional): Enter a JSON/array key (e.g.,
scoreordata.status) if the preceding node returns structured array output, or leave empty to compare against the full text output. - Operator: Choose
===,==,!==,>,>=,<,<=, orcontains. - Match Value: Enter the value to compare against (e.g.,
AGENT,HUMAN, or8).
- Statement Type: Select
- Connect the output of an
- Enum (
enum) & Enum Value (enum_value) Nodes:- Click the
Enumnode and select a structured Agent Class (agents withStructured Outputenabled), an Enum Class (App\Enums\...), and an optional Prompt instruction. - Drag one or more
Enum Valuenodes onto the canvas and connect edges from theEnumnode to eachEnum Valuenode. - Click each connected
Enum Valuenode and choose the corresponding enum case from the Value (Match) dropdown.
- Click the
- PHP Code Node (
php_code): Select the Class to execute (any class implementingWorkflowPhpCodeModuleInterface) from the dropdown. - Pre-defined Response Node (
response): Select the Pre-defined Response Class (any class implementingWorkflowResponseModuleInterface) from the dropdown. - Deleting a Node: With a node selected, click Delete Node at the bottom of the right Configuration panel.
Editing Workflow-Level Settings (Name & Test Mode)
Click on an empty area of the canvas to deselect all nodes and edges. The right Configuration panel displays Workflow Instellingen, where you can:
- Rename the workflow in the Name field.
- Toggle the Test Mode checkbox (
TestvsLive).
3. Step-by-Step: Testing a Workflow in the Built-in Test Chat
At the bottom of the right sidebar is the Test Workflow chat panel (you can drag the horizontal divider bar up or down to resize it).
- Select a Test User (Optional):
- Click User: Test User in the Test Workflow header to open the Select User dialog.
- Search by name, email, or ID and click a user to impersonate during the test run (or click Clear Selection). When a user is selected,
Agentnodes can persist and continue conversation history for that user.
- Reset Conversation Memory (Optional):
- Click Start New Conversation in the Test Workflow header to clear the chat history and set
clear_conversation = truefor the next test run.
- Click Start New Conversation in the Test Workflow header to clear the chat history and set
- Run a Test Message:
- Type a test prompt into Type your message... and click Test (or press
Enter). - Your message is passed as
globalVariables['question']into theStart Pointnode, and the current canvas definition is executed immediately (even before saving a draft).
- Type a test prompt into Type your message... and click Test (or press
- Inspect the Visual Execution Path:
- Every node that was executed during the run is highlighted on the canvas with a thicker colored border.
- Every traversed edge animates in blue when execution succeeds, or red along the path where an error occurred.
- Inspect the Step-by-Step JSON Execution Log:
- Inside the workflow's response bubble in the chat, click Show log.
- A Log side panel opens next to the right sidebar displaying the full JSON array of
WorkflowStepDtoentries (nodeName,outputData.content,outputData.data,meta.module_type, andmeta.next_route). - Press
Escor click×in the top-right of the Log panel to close it.
4. Step-by-Step: Saving Drafts & Publishing a Workflow
Workflows use a two-step Draft → Publish lifecycle so you can experiment safely in the editor without immediately overwriting your live workflow or PHP class file:
- Save as Draft (
Opslaan als concept):- Whenever you make changes on the canvas or in workflow settings, an amber
* Onopgeslagen wijzigingen(Unsaved changes) badge appears in the top bar. - Click Opslaan als concept (Save as draft) in the top-right bar. This stores a new
draftrecord inworkflow_versions.
- Whenever you make changes on the canvas or in workflow settings, an amber
- Publish a Version (
Publish):- Once all changes are saved as a draft, the blue Publish button becomes enabled.
- Click Publish to open the Publish Workflow modal.
- Select the version you want to make active from the Versie dropdown (versions are listed newest-first with
(Concept)or(Huidig)labels) and click Publish. - What happens on Publish:
- The selected
WorkflowVersionis marked aspublishedand becomes the workflow'sactiveVersion. - In local development, the
getDefinition()method insideapp/Ai/Workflows/{ClassName}.phpis automatically updated with the published node and edge graph. - In configured staging/test environments (when
tokomono/git-syncis installed), publishing triggers a GitSync Pull Request.
- The selected
5. Deleting a Workflow
- Navigate to Workflows.
- Click the red trash icon in the Actions column of the workflow you want to remove.
- Confirm deletion in the confirmation modal.