Step types
Reference for all pipeline step types -- Agent, Council, Gate, Cron, Lambda, Terminal, and TerminalFail.
Each step in a pipeline has a step_type that determines what it does when executed. There are seven step types.
Agent
Runs an LLM agent to perform a task. This is the most common step type.
Resolution order
The executor resolves which agent and role to use in this order:
role_idon the step (orconfig.role_id) -- looks up the role'sassigned_agent_idand uses the role as an override.agent_idon the step -- uses the agent directly (the agent's default role applies).- Fallback -- uses the first available agent if neither is set.
Required fields
Either agent_id or role_id must be set. Validation rejects agent steps that have neither.
Config fields
| Field | Type | Description |
|---|---|---|
role_id | string (UUID) | Alternative to the top-level role_id field |
metadata | JSON | Injected into templates as {{ step.metadata }} |
Behavior
- The agent receives the pipeline context (ticket details, git branch, previous outputs, gate feedback).
- When the pipeline trigger is
cron, the agent uses the role'scron_tasktemplate instead ofticket_task. - The result is a
StepResultwithpassed: true/falseand the agent's output text.
Council
Runs a multi-agent council session. Multiple roles collaborate on the task through structured conversation.
Required fields
council_id must be set. The agent_id field should be null for council steps.
Config fields
Same as agent steps. The council configuration (roles, orchestration mode) is defined on the council itself.
Behavior
The council executor manages the multi-agent session and returns a single StepResult. See Councils for details on council configuration.
Gate
A quality gate that evaluates the output of the previous step against specified criteria. Gate steps use an LLM agent to perform the evaluation.
Resolution
Gate steps resolve their agent the same way as agent steps (via role_id, agent_id, or fallback). The agent receives the previous step's result and the gate criteria.
Config fields
| Field | Type | Description |
|---|---|---|
criteria | string | Evaluation criteria. Default: "Evaluate whether the output is correct and complete." |
metadata | JSON | Injected into templates as {{ step.metadata }} |
Behavior
- Receives the most recent
StepResultfrom the pipeline context. - The agent evaluates the output against the criteria and returns
passed: trueorpassed: false. - On failure, the gate's output is stored as
gate_feedbackin the pipeline context. If the failing step connects to another agent via anon_failedge, that agent receives the feedback so it knows what to fix. - The
ticket_sourceis updated to the gate's role name, so downstream agents know the feedback came from the gate.
Cron
A polling step that repeatedly executes a function (agent or lambda) at a fixed interval until it signals completion or times out. See Cron and scheduling for the full reference.
Required fields
At least one of role_id, lambda_id, or council_id must be set. If both lambda_id and role_id are present, lambda takes precedence.
Config fields
| Field | Type | Description |
|---|---|---|
interval | string | Polling interval, e.g., "30s", "5m", "1h". Default: "60s" |
timeout | string | Maximum time before the cron step aborts, e.g., "2h", "1d". Default: "24h" |
role_id | string (UUID) | Alternative to the top-level role_id |
lambda_id | string (UUID) | Alternative to the top-level lambda_id |
Duration format
Durations use a simple format: a number followed by a unit suffix.
| Suffix | Unit | Example |
|---|---|---|
s | Seconds | 30s |
m | Minutes | 5m |
h | Hours | 1h |
d | Days | 2d |
Signaling
The function signals its status using a JSON object in its output:
{"cron_status": "pass", "reason": "PR was merged"}| Status | Meaning |
|---|---|
pass | Work is done -- take the on_pass edge |
fail | Work is done but failed -- take the on_fail edge |
wait | Not done yet -- sleep and run again next tick |
abort | Unrecoverable error -- abort the pipeline immediately |
A legacy format is also supported: CRON_DONE:PASS and CRON_DONE:FAIL markers in the output text.
Modes
| Mode | Resolved from | Description |
|---|---|---|
| Agent | role_id | Runs an LLM agent on each polling cycle |
| Lambda | lambda_id | Runs a lambda script on each polling cycle |
Lambda
Runs a deterministic script without an LLM. Use lambda steps for tasks like running tests, checking git status, or calling external APIs.
Required fields
lambda_id must be set (either on the step or in config.lambda_id).
Config fields
| Field | Type | Description |
|---|---|---|
lambda_id | string (UUID) | Alternative to the top-level lambda_id |
interpreter_override | string | Override the lambda's default interpreter (auto, bash, sh, python3, node) |
timeout | string | Maximum execution time. Default: "5m" |
Behavior
- The script is resolved from
~/.nenjo/lambdas/{lambda.path}. - Pipeline context is injected via
NENJO_*environment variables and aNENJO_CONTEXT_FILEJSON file. - The script's exit code determines
passed: exit 0 means pass, non-zero means fail. - stdout is captured as the step's output.
See Lambdas for the full reference.
Terminal
Marks a successful end of the pipeline. Every pipeline must have at least one terminal step.
Required fields
None. Terminal steps do not require agent_id, role_id, or any other reference.
Behavior
- Returns the most recent step result from the pipeline context.
- If no previous steps have run (single-step pipeline), returns
passed: truewith the initial input as output. - Terminal steps must not have outgoing edges.
TerminalFail
Marks a failure end of the pipeline. Use this to explicitly terminate a pipeline with a failure status when a particular path is reached.
Config fields
| Field | Type | Description |
|---|---|---|
failure_reason | string | Reason for the failure. Default: "Pipeline terminated with failure" |
Behavior
- Always returns
passed: falsewith the configured failure reason as output. - Useful for explicit failure paths in branching pipelines (e.g., after exhausting retry options).
Summary table
| Step type | LLM | Required reference | Purpose |
|---|---|---|---|
agent | Yes | agent_id or role_id | Run an agent task |
council | Yes | council_id | Multi-agent collaboration |
gate | Yes | agent_id or role_id (or fallback) | Quality evaluation |
cron | Depends | role_id, lambda_id, or council_id | Polling loop |
lambda | No | lambda_id | Run a script |
terminal | No | None | Successful end |
terminal_fail | No | None | Failure end |