Condition Nodes
13 condition nodes for branching on agent state, issue predicates, and GitHub facts.
Condition nodes branch workflow execution based on boolean or multi-value predicates. Each condition node emits to a true output port (or a named case port) and a false (or default) port. Both branches carry a typed result object so downstream nodes can use evaluation details without re-fetching state.
Node summary
| Node ID | Branch logic | Key input |
|---|---|---|
agent.dispatch_count.under_cap | Under session cap vs. at cap | issueId |
agent.session.failure_backoff | Circuit breaker: allowed vs. in backoff | issueId |
agent.session.has_pr | Session produced a PR vs. not | sessionId |
agent.session.status | Session status matches expected vs. not | sessionId, expectedStatus |
agent.work_type.detect | Work type from comment + issue status | commentBody, issueStatus |
agent.work_type.valid_for_status | Work type valid for current issue status | workType, issueStatus |
github.branch.exists | Named branch exists vs. not | owner, repo, branch |
github.pr.checks_passing | All checks passing vs. failing | owner, repo, pullNumber |
github.pr.has_conflicts | PR has conflicts vs. clean | owner, repo, pullNumber |
linear.comment.body_prefix_switch | Comment body prefix matches a case | body, prefixes |
linear.issue.predicate | Configurable issue predicate | check, issueId |
rensei.agent_result.switch | Agent completion classification | session output |
rensei.value.switch | Generic scalar switch | value, cases |
Agent conditions
agent.dispatch_count.under_cap
Checks whether the number of agent sessions dispatched for a Linear issue is below the configured cap. Pair with agent.dispatch_count.increment to enforce a maximum number of concurrent agent sessions per issue.
Input ports
| Port | Type | Required | Description |
|---|---|---|---|
issueId | string | yes | Linear issue ID to check |
maxSessions | number | no | Maximum concurrent sessions for this issue. Omit to use the platform default. |
Output ports - true (under cap) / false (at or above cap). Both carry { issueId: string; effectiveCount: number; cap: number; underCap: boolean }.
agent.session.failure_backoff
Circuit-breaker condition for a Linear issue. Checks whether the failure backoff window for the issue has elapsed, allowing a retry. Routes to true (dispatch allowed) when the circuit is open and to false (in backoff) when the exponential window is active or a hard stop has been reached.
Input ports
| Port | Type | Required | Description |
|---|---|---|---|
issueId | string | yes | Linear issue ID to evaluate |
Output ports - true (allowed) / false (in backoff). Both carry { issueId: string; allowed: boolean; backoffWindowMs: number }.
backoffWindowMs is 0 on the true branch. On the false branch it reflects the remaining backoff window in milliseconds.
agent.session.has_pr
Checks whether an agent session has produced an associated pull request. Useful for branching SDLC flows: skip the PR-creation step if the agent already opened one.
Input ports
| Port | Type | Required |
|---|---|---|
sessionId | string | yes |
Output ports - true (AgentSessionSnapshot with prUrl and prNumber) / false (AgentSessionSnapshot without PR fields)
AgentSessionSnapshot shape
{
sessionId: string
status: 'queued' | 'running' | 'completed' | 'failed' | 'crashed'
prUrl?: string
prNumber?: number
}agent.session.status
Checks whether an agent session's current status matches an expected value.
Input ports
| Port | Type | Required | Description |
|---|---|---|---|
sessionId | string | yes | Agent session ID |
expectedStatus | string | yes | One of: queued, running, completed, failed, crashed |
Output ports - true (status matches) / false (status does not match). Both carry { sessionId, status, expectedStatus, matches }.
agent.work_type.detect
Derives the SDLC work type from a comment body and issue status using keyword scanning, a status-to-work-type map, and an optional first-touch override rule. Output ports are dynamic - the canvas generates one handle per configured work-type case plus a default fallback.
Input ports
| Port | Type | Required | Description |
|---|---|---|---|
commentBody | string | no | Mention or comment body to scan for keyword hints |
issueStatus | string | no | Current Linear issue status (e.g. "Backlog", "Started") |
issueId | string | no | Linear issue ID; used to fetch status when issueStatus is absent |
existingSessions | number | no | Prior dispatch count for this issue (used by the first-touch override) |
statusWorkTypeMap | object | no | Override map from status name → work type |
keywordPool | string[] | no | Constrained pool of work types eligible for keyword scanning |
firstTouchOverride | object | no | First-touch promotion rule: { from, to, when: "no-existing-sessions" } |
Output ports (dynamic): research, backlog-creation, development, coordination, qa, acceptance, and default.
agent.work_type.valid_for_status
Checks whether a given work type is valid for the current issue status. Used in the SDLC pipeline to guard stage transitions - for example, preventing a QA dispatch when the issue is still in research.
Input ports
| Port | Type | Required |
|---|---|---|
workType | string | yes |
issueStatus | string | yes |
Output ports - true (valid combination) / false (not valid for current status). Carries { workType, issueStatus, valid }.
GitHub conditions
github.branch.exists
Checks whether a named branch exists in a GitHub repository.
Input ports
| Port | Type | Required |
|---|---|---|
owner | string | yes |
repo | string | yes |
branch | string | yes |
Output ports - true ({ branch, sha }) / false (branch not found)
github.pr.checks_passing
Checks whether all required status checks are passing on a pull request. Use this before merging to confirm CI is green.
Input ports
| Port | Type | Required |
|---|---|---|
owner | string | yes |
repo | string | yes |
pullNumber | number | yes |
Output ports - true ({ allPassing: true; checks: CheckResult[] }) / false ({ allPassing: false; failing: CheckResult[] })
github.pr.has_conflicts
Checks whether a pull request has merge conflicts with its base branch.
Input ports
| Port | Type | Required |
|---|---|---|
owner | string | yes |
repo | string | yes |
pullNumber | number | yes |
Output ports - true ({ hasConflicts: true }) / false (no conflicts)
Linear conditions
linear.comment.body_prefix_switch
Routes on the prefix of a Linear comment body. Declare a list of prefixes; the node routes to the matching branch or default if none match. This is the routing node used in SDLC templates to dispatch different work types from a single comment trigger.
Input ports
| Port | Type | Required | Description |
|---|---|---|---|
body | string | yes | Comment body to match against |
prefixes | string[] | yes | Ordered list of prefixes to test |
caseSensitive | boolean | no | Case-sensitive matching (default: false) |
Output ports - one named output port per configured prefix + a default fallback. Each output carries { body, matchedPrefix }.
linear.issue.predicate
Unified Linear issue predicate - a single configurable node that replaces eight single-purpose predicates. Select a check mode and supply the mode-specific fields. Has a bespoke config panel with a dropdown that shows human-readable check descriptions.
Input ports
| Port | Type | Required | Description |
|---|---|---|---|
check | string | yes | Which predicate to evaluate (see table below) |
issueId | string | no | Linear issue UUID or identifier |
issueStatus | string | no | Pre-resolved status name (avoids extra API call for is_terminal) |
status | string | no | Status name to compare against (for status_equals) |
projectName | string | no | Linear project name (for project_allowed) |
allowedProjects | string[] | no | Explicit project allow-list (for project_allowed) |
Check modes
check value | What it tests | Required extra inputs |
|---|---|---|
status_equals | Issue's current state name equals status | issueId, status |
is_terminal | Issue is in a terminal state | issueId or issueStatus |
is_parent | Issue has sub-issues | issueId |
is_child | Issue is a sub-issue of another | issueId |
has_sub_issues | Issue has at least one sub-issue | issueId |
has_blocking_incomplete | Issue has blocking relations with incomplete blockers | issueId |
assignee_is_human | Issue's assignee is a human user (not an agent) | issueId |
project_allowed | Issue's project is in the allowedProjects list | issueId, projectName or allowedProjects |
Output ports - true (PredicateResult) / false (nullable PredicateResult)
PredicateResult shape
{
check: string // which mode was evaluated
issueId?: string
result: boolean
}Value conditions
rensei.agent_result.switch
Routes on the result classification produced by an agent session. Extracts the classification or workType field from an agent's completion output and branches accordingly. Useful for dispatching follow-up work based on what the agent decided.
Output ports (dynamic): bug, feature, chore, skip, default - and any custom output keys defined in the agent card's completion_contract.
rensei.value.switch
Generic scalar switch - routes on any string, number, or boolean value. Configure a list of case labels; the canvas generates one output handle per label plus a default fallback. String matching is case-insensitive by default.
Input ports
| Port | Type | Required | Description |
|---|---|---|---|
value | string | number | boolean | null | no | The scalar value to match |
cases | string[] | no | Ordered case label list |
caseSensitive | boolean | no | Default: false |
Output ports - one port per case label + default fallback. Output ports are dynamic: generated from the cases config when the node is rendered.
Example: branch on issue priority
- id: priority_branch
type: condition
nodeId: rensei.value.switch
config:
value: "{{ $trigger.data.priority }}"
cases:
- "1"
- "2"
- "3"This produces four output handles: 1 (urgent), 2 (high), 3 (medium), and default (anything else).
Usage pattern: SDLC dispatch guard
The SDLC v2 template chains these nodes to guard every stage dispatch:
linear.agent_session.created
→ agent.session.failure_backoff (issueId)
→ true (allowed)
→ agent.dispatch_count.under_cap (issueId)
→ true → agent.dispatch_count.increment
→ agent.invoke
→ false → linear.comment.create ("Dispatch cap reached")
→ false (in backoff) → linear.comment.create ("Backing off - prior failure")Related pages
- Agent Action Nodes -
agent.dispatch_count.increment,agent.session.get_state - Linear Action Nodes -
linear.issue.update,linear.issue.predicateinterplay - Gate Node - suspend execution pending human decision
- Runtime: DAG Executor - how condition branches propagate through the execution graph