AI decision nodes
AI decision nodes let AI make a judgment call inside a workflow. You give the node a state (the data to look at) and a question about it, and AI answers with yes or no, an option from a list, or a score.
Like condition nodes, an AI decision node can branch the workflow. The difference is the kind of decision each one makes:
- Condition nodes perform structural manipulation. A JQ expression checks the shape and values of your data, for example whether a field equals
"production"or a number is above a threshold. - AI decision nodes perform semantic classification. AI reads the meaning of the data and applies plain-language instructions, for example "Is this incident customer facing?" or "Which team should own this request?".
In the workflow builder, add it from the AI category by selecting Make AI decision.
How it works
- The workflow reaches the AI decision node.
- Port resolves any JQ templates in the node's
state, then sends the state and the question to Port AI. - AI answers the question. The answer is stored in the node's outputs.
- For boolean and choice questions, the workflow continues down the outlet that matches the answer. For score questions, the node doesn't branch and the workflow continues to the next node.
AI decision nodes use Port AI, so Port AI must be enabled for your organization. Each decision counts toward your organization's AI decision quota and rate limits, see limitations. If the request fails or times out, the node fails and the workflow run fails.
Example
The following node asks AI whether an incident affects customers, and routes the workflow to the yes or no outlet:
{
"identifier": "is-customer-facing",
"title": "Is customer facing?",
"config": {
"type": "DECISION",
"state": "{{ .outputs.trigger.incident }}",
"questions": {
"decision": {
"type": "boolean",
"instructions": "Decide whether this incident affects external customers.",
"criteria": {
"true": "The incident impacts a customer-facing service, API, or UI.",
"false": "The incident only affects internal tools, staging, or background jobs."
}
}
}
}
}
Configuration
An AI decision node is defined by a config object with "type": "DECISION" and the following fields:
| Field | Required | Description |
|---|---|---|
type | Yes | Must be "DECISION". |
state | Yes | The text or JSON object the question is asked about. Supports JQ templates, for example "{{ .outputs.trigger }}", so you can pass data from the workflow run context. |
questions | Yes | An object holding the question to answer about the state, under the decision key (for example "questions": { "decision": { ... } }). Exactly one question is supported. See question types below. |
timeoutMinutes | No | The maximum time the node can run before it times out. Defaults to 60. |
Pass only the data AI needs to answer the question, for example {{ .outputs.trigger.entity.properties }} instead of the whole trigger output. A smaller, focused state leads to more accurate answers.
Question types
The question is always stored under the decision key in questions, and its answer is returned under the same key in the node's outputs (answers.decision). The workflow builder sets this key for you.
Each question has a type, an instructions field that describes what AI should decide about the state, and an optional or required criteria field depending on the type.
Boolean
A yes/no question. The node has two outlets, yes and no.
| Field | Required | Description |
|---|---|---|
type | Yes | Must be "boolean". |
instructions | Yes | What AI should decide about the state. |
criteria.true | No | Guidance for when the answer is yes (the yes outlet). |
criteria.false | No | Guidance for when the answer is no (the no outlet). |
AI returns a probability between 0 and 1 that the answer is yes. The workflow takes the yes outlet when the probability is 0.5 or higher, and the no outlet otherwise.
For a boolean question example, see the example at the top of this page.
Choice
A multiple-choice question. The node has one outlet per option, and the outlet identifier is the option key.
| Field | Required | Description |
|---|---|---|
type | Yes | Must be "choice". |
instructions | Yes | What AI should decide about the state. |
criteria | Yes | An object of at least two options, keyed by the option identifier, with a description of when to choose each. |
Choice question example (click to expand)
{
"identifier": "route-request",
"title": "Route request",
"config": {
"type": "DECISION",
"state": "{{ .outputs.trigger.request_description }}",
"questions": {
"decision": {
"type": "choice",
"instructions": "Decide which team should handle this request.",
"criteria": {
"platform": "Infrastructure, CI/CD, Kubernetes, or cloud resources.",
"security": "Access requests, vulnerabilities, or secrets.",
"data": "Databases, data pipelines, or analytics."
}
}
}
}
}
This node has three outlets: platform, security, and data.
Score
A rating question. Score questions don't branch the workflow. Use them to enrich data, and reference the score in later nodes (for example, in a condition node).
| Field | Required | Description |
|---|---|---|
type | Yes | Must be "score". |
instructions | Yes | What AI should decide about the state. |
criteria | Yes | An array of at least two score levels, ordered from lowest to highest. |
Score question example (click to expand)
{
"identifier": "rate-deployment-risk",
"title": "Rate deployment risk",
"config": {
"type": "DECISION",
"state": "{{ .outputs.trigger.change_description }}",
"questions": {
"decision": {
"type": "score",
"instructions": "Rate the risk of deploying this change to production.",
"criteria": ["Low", "Medium", "High", "Critical"]
}
}
}
}
The score is available in later nodes as {{ .outputs["rate-deployment-risk"].answers.decision.score }}.
Connections
Connections from a boolean or choice AI decision node must specify which outlet they're connected to, using sourceOutletIdentifier. Unlike condition nodes, AI decision nodes don't support a fallback connection, since AI always picks one of the outlets:
{
"connections": [
{
"sourceIdentifier": "is-customer-facing",
"targetIdentifier": "page-on-call",
"sourceOutletIdentifier": "yes"
},
{
"sourceIdentifier": "is-customer-facing",
"targetIdentifier": "open-ticket",
"sourceOutletIdentifier": "no"
}
]
}
Each sourceOutletIdentifier must reference a valid outlet on the node: yes or no for boolean questions, or one of the criteria keys for choice questions.
Score questions have a single output, so their connections don't need a sourceOutletIdentifier.
Outputs
An AI decision node produces the following outputs, which subsequent nodes can reference through data flow:
| Output | Description |
|---|---|
answers | The answer, stored under the decision key (answers.decision). The answer has a type and a value: probability for boolean, choice for choice, or score for score. Choice and score answers may also include probabilities per option. |
selectedOutlet.identifier | The identifier of the outlet the workflow continued on. Only set for boolean and choice questions. |
provider | The AI provider that made the decision. |
model | The AI model that made the decision. |
usage | Token usage for the decision: inputTokens, outputTokens, and totalTokens. |
For example, to reference the answer to the boolean question above in a downstream node:
{{ .outputs["is-customer-facing"].answers.decision.probability }}
Limitations
| Limitation | Default | Notes |
|---|---|---|
| Questions per node | One. | To ask several questions about the same data, chain multiple AI decision nodes, or use a score question in one node and branch on the result with a condition node. |
| State size | No fixed character limit. | A decision must complete within 60 seconds. A very large state increases the chance of a timeout and reduces answer accuracy, so keep the state to the fields AI actually needs. |
| Monthly quota | 10,000 decisions per organization. | Separate from the Port AI invocations quota. Each successful decision counts as one request, regardless of state size or tokens used. Failed decisions don't count. Resets on the first day of each calendar month (UTC). Contact your account team for higher limits. |
| Rate limit | 200 decisions per minute per organization. | When the monthly quota or rate limit is exceeded, the request is rejected and the node fails, which fails the workflow run. Port doesn't retry automatically, and AI decision nodes don't support onFailure: "continue". |
FAQ
No. AI decision nodes always use Port's dedicated decision model. The LLM providers you configure for Port AI don't apply to AI decision nodes.
No. Unlike the AI action node, an AI decision node has no tools. AI only sees the state you pass to the node, so include all the context it needs, for example by referencing earlier node outputs with JQ.
Not strictly. AI may give different answers to borderline cases. To make results more consistent, write specific instructions and describe each outcome clearly in criteria. For boolean questions, you can also inspect answers.decision.probability in a later node to handle low-confidence answers differently.
Related links
- Condition nodes - Branch a workflow based on JQ expressions.
- Input nodes - Branch a workflow based on human responses.
- AI action nodes - Invoke Port AI or AI agents from a workflow.
- Data flow - Pass outputs between nodes.