Rensei docs
Nodes

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 IDBranch logicKey input
agent.dispatch_count.under_capUnder session cap vs. at capissueId
agent.session.failure_backoffCircuit breaker: allowed vs. in backoffissueId
agent.session.has_prSession produced a PR vs. notsessionId
agent.session.statusSession status matches expected vs. notsessionId, expectedStatus
agent.work_type.detectWork type from comment + issue statuscommentBody, issueStatus
agent.work_type.valid_for_statusWork type valid for current issue statusworkType, issueStatus
github.branch.existsNamed branch exists vs. notowner, repo, branch
github.pr.checks_passingAll checks passing vs. failingowner, repo, pullNumber
github.pr.has_conflictsPR has conflicts vs. cleanowner, repo, pullNumber
linear.comment.body_prefix_switchComment body prefix matches a casebody, prefixes
linear.issue.predicateConfigurable issue predicatecheck, issueId
rensei.agent_result.switchAgent completion classificationsession output
rensei.value.switchGeneric scalar switchvalue, 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

PortTypeRequiredDescription
issueIdstringyesLinear issue ID to check
maxSessionsnumbernoMaximum 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

PortTypeRequiredDescription
issueIdstringyesLinear 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

PortTypeRequired
sessionIdstringyes

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

PortTypeRequiredDescription
sessionIdstringyesAgent session ID
expectedStatusstringyesOne 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

PortTypeRequiredDescription
commentBodystringnoMention or comment body to scan for keyword hints
issueStatusstringnoCurrent Linear issue status (e.g. "Backlog", "Started")
issueIdstringnoLinear issue ID; used to fetch status when issueStatus is absent
existingSessionsnumbernoPrior dispatch count for this issue (used by the first-touch override)
statusWorkTypeMapobjectnoOverride map from status name → work type
keywordPoolstring[]noConstrained pool of work types eligible for keyword scanning
firstTouchOverrideobjectnoFirst-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

PortTypeRequired
workTypestringyes
issueStatusstringyes

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

PortTypeRequired
ownerstringyes
repostringyes
branchstringyes

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

PortTypeRequired
ownerstringyes
repostringyes
pullNumbernumberyes

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

PortTypeRequired
ownerstringyes
repostringyes
pullNumbernumberyes

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

PortTypeRequiredDescription
bodystringyesComment body to match against
prefixesstring[]yesOrdered list of prefixes to test
caseSensitivebooleannoCase-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

PortTypeRequiredDescription
checkstringyesWhich predicate to evaluate (see table below)
issueIdstringnoLinear issue UUID or identifier
issueStatusstringnoPre-resolved status name (avoids extra API call for is_terminal)
statusstringnoStatus name to compare against (for status_equals)
projectNamestringnoLinear project name (for project_allowed)
allowedProjectsstring[]noExplicit project allow-list (for project_allowed)

Check modes

check valueWhat it testsRequired extra inputs
status_equalsIssue's current state name equals statusissueId, status
is_terminalIssue is in a terminal stateissueId or issueStatus
is_parentIssue has sub-issuesissueId
is_childIssue is a sub-issue of anotherissueId
has_sub_issuesIssue has at least one sub-issueissueId
has_blocking_incompleteIssue has blocking relations with incomplete blockersissueId
assignee_is_humanIssue's assignee is a human user (not an agent)issueId
project_allowedIssue's project is in the allowedProjects listissueId, 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

PortTypeRequiredDescription
valuestring | number | boolean | nullnoThe scalar value to match
casesstring[]noOrdered case label list
caseSensitivebooleannoDefault: 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")

On this page