servflow-pro CLI — which is what you want for version control, code review, and CI/CD.
In this tutorial you’ll define a “Hello World” workflow as a file, validate it without deploying, deploy it, and call it.
Prerequisites
- ServFlow Pro installed — see Installation
- A text editor and a terminal
What you’ll build
AGET /hello-world endpoint that returns a JSON greeting, defined entirely in a YAML file and deployed from the command line.
Step 1: Create a configuration file
Create a project directory with aconfigs folder:
config.toml in the project root:
config_folder is the only required setting. See the Configuration Reference for the rest.
Step 2: Start from a real example
Rather than writing a workflow from memory, ask the CLI for a complete, valid one:Step 3: Write your workflow
Createconfigs/hello-world.yaml:
Steps connect with reference strings —
action.<key>, conditional.<key>, or response.<key> — where the key is the map key in that section. Here the entry routes straight to response.success.
Step 4: Validate before deploying
Dry-run the config. This validates it and prints exactly what would be stored, without writing anything:0. On failure it prints one specific error — a missing required field, say, or a reference to a step that doesn’t exist. Fix that one thing and run it again.
Step 5: Deploy it
Run the same command without--dry-run:
--reload is on by default, so a running instance picks up the change immediately; if no server is running the command notes that and completes anyway.
Step 6: Start the server and call it
You’ve defined, validated, and deployed your first workflow from the command line.
Adding an action
Most workflows do more than return a fixed value. This version reads a query parameter and builds the response from it:- Dynamic values use
{{ }}templates.paramreads a query or form parameter,bodyreads a field from a JSON body, andurlparamreads a path variable. See Dynamic Content. - An action’s result is available as
{{ .<actionKey> }}to every later step, andfailroutes execution when the action errors.
Discovering what’s available
The CLI is the authoritative source for what your engine supports — more reliable than any document, because it reflects the binary you are running:Version control
Because workflows are plain files, they can be reviewed and deployed like any other code. A typical.gitignore:
Next steps
Deploy with the dashboard
Build the same kind of workflow visually.
Actions
Browse every action you can put in a workflow.
Dynamic Content
Template syntax for dynamic values.
Running ServFlow
How to deploy an instance to production.