This guide explains the built-in process nodes available in Greentic and how to use them in your flows.
pub enum BuiltInProcess {
Debug(DebugProcessNode),
Script(ScriptProcessNode),
Template(TemplateProcessNode),
#[serde(rename = "qa")]
Qa(QAProcessNode),
Plugin { name: String, #[serde(skip)] path: PathBuf },
}
debug
A debugging process that lets you inspect message input/state.
debug_process:
debug:
print: false # logs only (no CLI output)
print: true
→ logs + prints to CLIscript
A Rhai scripting process that can transform messages, payloads, and state.
msg
: full message objectpayload
: parsed inputstate
: state context (keys are exposed directly too){ "output": ... }
__greentic
):return #{
__greentic: {
payload: #{ status: "ok" },
out: ["next_node"]
}
};
template
A Handlebars-based template processor for rendering string output.
msg
, payload
, state
if
, each
) supportedqa
A dynamic, multi-question form-like process with optional validation and routing.
text
(with optional max_words
, regex
)number
(with optional range
validation)choice
(predefined options)date
(with dialect
, max_words
)llm
(open-ended, always interpreted by LLM)routing:
- condition:
less_than:
question_id: "age"
threshold: 18
to: "minor_flow"
- to: "adult_flow"
Triggered when answers don’t meet constraints (e.g., too many words, invalid number).
fallback_agent:
task: "Reformat answer into a number."
ask_user:
qa:
welcome_template: "Hi! Let's get started."
questions:
- id: "name"
prompt: "What’s your name?"
answer_type: text
state_key: "user_name"
- id: "age"
prompt: "How old are you?"
answer_type: number
state_key: "user_age"
validate:
range:
min: 0
max: 120
routing:
- condition:
less_than:
question_id: "age"
threshold: 18
to: "underage"
- to: "main_process"
Answers are stored in state and passed on as a unified object.
plugin
A dynamically loaded process node compiled as .wasm
, located at /plugins/<name>.wasm
.
my_plugin_step:
plugin: "my_plugin"
Used for extending the platform with custom functionality.