v2.7 (latest)
Create a Basic Workflow ​
This guide explains how to create a workflow in Rulecube. It covers the minimum steps to set up a working workflow with a start, one or more action steps, and an end.
This guide assumes you are familiar with workflows. If not, see Workflows for a conceptual overview, or follow the Tutorial: Using Workflows first.
Step 1: Enable the Workflow option ​
- Create a new ruleset or open an existing one.
- Click Version settings in the left menu.
- Select the Workflow checkbox.
↳ Rulecube converts the ruleset into a workflow. It adds a Workflow option to the left menu, and creates astateinput and aStateentity automatically.
Step 2: Define your state properties ​
The State entity holds data that persists across workflow steps. Add a property for each value you want to track.
- Click Entities in the left menu.
- Select the State entity.
- Click Add property for each value you want to track across steps.
- Set the Name, Type, and optionally a Default value for each property.
- Click Save.
Step 3: Build the workflow canvas ​
- Click Workflow in the left menu.
↳ The workflow canvas opens. A Start step and an End step are already present. - Drag one or more step types from the panel onto the canvas. Common step types:
- Action - executes code and moves to the next step automatically
- Switch - evaluates a condition and routes to different steps based on true or false
- Wait - pauses the workflow until an external signal is received
- Click a step to open its details panel. Set a Step name and optionally a Description.
- Connect steps by clicking the circle on a step, holding, and dragging to the next step.
↳ For Switch steps, Rulecube asks you to name each connection (e.g.true/false). - Make sure every path through the canvas ends at the End step.
Step 4: Add expressions to each step ​
- Click a step on the canvas.
- Enter the JavaScript expression for that step in the Expression field.
- Use
state.<property>to read or write values that persist across steps. - Use
return;to move to the next step without returning a value. - Use
return <value>;to return a value from the workflow.
- Use
- Repeat for each step.
- Click Save.