Skip to main content
ServFlow is an agent builder: you define AI agents and the workflows they run, and a Go engine serves them. Alongside the visual builder, every object can be defined as a JSON or YAML configuration file and deployed with the 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.
Prefer a visual interface? See Deploy your first API with the dashboard. Both produce the same objects, so you can move between them freely.

Prerequisites

  • ServFlow Pro installed — see Installation
  • A text editor and a terminal
You do not need the dashboard running for this tutorial. The CLI works directly against the store.

What you’ll build

A GET /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 a configs folder:
Add a 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:
This prints a fully-formed workflow showing how entries, actions, conditionals, and responses wire together. It is the best reference for the schema, because it comes from the engine you are running.

Step 3: Write your workflow

Create configs/hello-world.yaml:
The pieces: 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:
On success it prints the materialized workflow and exits 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.
This validate-fix loop is the fastest way to author configs. Lean on it rather than trying to get a file perfect in one pass.

Step 5: Deploy it

Run the same command without --dry-run:
The workflow is saved and the command returns the stored object. --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

The engine owns the root path, so your workflow answers at its listen path directly:
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:
Deploy and call it:
Two things worth noting:
  • Dynamic values use {{ }} templates. param reads a query or form parameter, body reads a field from a JSON body, and urlparam reads a path variable. See Dynamic Content.
  • An action’s result is available as {{ .<actionKey> }} to every later step, and fail routes 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.