> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lyzr.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Node Types

> Every node type accepted in a SuperFlow flow_data document, with parameters and outputs.

This page is the exhaustive catalog of node types accepted in a `flow_data` document, grouped by category. The `type` value of every node is prefixed `lyzr-nodes-base.`. For the document structure, connections, and expression syntax, see the [flow\_data reference](/enterprise/api/superflow/flow-data).

All string parameters support `{{ }}` expressions as described in the [expression syntax](/enterprise/api/superflow/flow-data#expression-syntax); the tables below note only additional per-node handling. In the tables, "Req" marks required parameters.

## Conventions

Two conventions apply across the catalog. First, some parameters name a field to look up in the item rather than a literal value; this applies to Set assignments, the DateTime `date` parameter, the Crypto `value` parameter, and the Sort and Aggregate field parameters, and is called out per node. Second, numbers arrive as JSON numbers: where a parameter expects a number, boolean, or string, a value of the wrong JSON type falls back to the documented default.

## Control flow

### Trigger

`lyzr-nodes-base.trigger` is the universal entry node. Exactly one is required per workflow. It takes no parameters and has one output: output 0 emits all injected input items, or a single empty item `{}` if there are none, so downstream nodes always run.

### No-Op

`lyzr-nodes-base.noOp` is a pass-through. It takes no parameters and has one output: output 0 emits all input items unchanged.

### Set / Edit Fields

`lyzr-nodes-base.set` adds or overwrites fields on each item. It does not remove fields. Assignments are read from the first of the following accepted shapes that yields entries.

| Param         | Type   | Req | Default | Notes                                                                                                                                                                                                 |
| ------------- | ------ | --- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `assignments` | object | No  | None    | Reads `assignments.assignments[]`, each `{name, value, type}`. Only `name` and `value` are used; `type` is ignored. If the `assignments.assignments` key is present, this shape wins even when empty. |
| `fields`      | object | No  | None    | Reads `fields.values[]`, each `{name, stringValue \| numberValue \| booleanValue \| value}` (the first present wins). Used only if it yields at least one result.                                     |
| `values`      | object | No  | None    | Reads `values.string[]`, `values.number[]`, and `values.boolean[]`, each entry `{name, value}`.                                                                                                       |

The node has one output: output 0 emits one modified item per input item, with `newItem[name] = value` applied for each assignment.

### If

`lyzr-nodes-base.if` routes each item to a true branch or a false branch. It supports a rule mode and an AI mode.

| Param               | Type   | Req           | Default       | Notes                                                                                                      |
| ------------------- | ------ | ------------- | ------------- | ---------------------------------------------------------------------------------------------------------- |
| `evaluationMode`    | string | No            | `""`          | The value `"ai"` selects the LLM branch; anything else selects rule mode.                                  |
| `conditions`        | object | No            | None          | Rule mode. Reads `conditions.conditions[]` (shape below) plus `conditions.combineOperation` as a fallback. |
| `combineOperation`  | string | No            | `and`         | The values `or` and `any` select OR; anything else selects AND. An empty condition list evaluates to true. |
| `conditionPrompt`   | string | Yes (AI mode) | `""`          | AI mode. The natural-language condition.                                                                   |
| `provider`          | string | No            | `openai`      | AI mode.                                                                                                   |
| `model`             | string | No            | `gpt-4o-mini` | AI mode.                                                                                                   |
| `llm_credential_id` | string | No            | None          | AI mode. See [credential precedence](#llm-credential-precedence).                                          |

Each entry of `conditions.conditions[]` is a condition object with `leftValue` (any type; a string is stripped of a leading `=` and then dot-path looked up in the item, and an unresolved string is treated as a literal), `rightValue` (handled the same way), `operator` (an `{operation}` object or a bare string), and `leftType` and `rightType` (`string`, `number`, `boolean`, `any`, or `""`).

The supported operators are `exists`, `notExists`, `isEmpty`, `isNotEmpty`, `equals`/`equal`, `notEquals`/`notEqual`, `contains`, `notContains`, `startsWith`, `endsWith`, `gt`/`greaterThan`, `lt`/`lessThan`, `gte`/`greaterThanOrEqual`, and `lte`/`lessThanOrEqual`.

In AI mode, the model is asked per item with the text `"Condition: <prompt>"` followed by the item JSON as data, and must answer true or false. A per-item evaluation error routes that item to false.

The node has two outputs: output 0 receives matched (true) items and output 1 receives unmatched (false) items. Items pass through unchanged.

### Switch

`lyzr-nodes-base.switch` routes each item to the first matching rule's output.

| Param            | Type             | Req           | Default       | Notes                                                               |
| ---------------- | ---------------- | ------------- | ------------- | ------------------------------------------------------------------- |
| `evaluationMode` | string           | No            | `""`          | The value `"ai"` selects the LLM branch.                            |
| `rules`          | object           | No            | None          | Rule mode. Reads `rules.rules[]` in either of the two shapes below. |
| `outputLabels`   | array of strings | Yes (AI mode) | None          | AI mode. Each label corresponds to an output index in array order.  |
| `classifyPrompt` | string           | No            | `""`          | AI mode. Appended to the system prompt.                             |
| `provider`       | string           | No            | `openai`      | AI mode.                                                            |
| `model`          | string           | No            | `gpt-4o-mini` | AI mode.                                                            |

Rules take one of two shapes. The legacy shape applies when `value` is not null: `{value, operand, operator}` acts as a single condition. The conditions shape reads `conditions.conditions[]` (the same sub-keys as the If node) plus `conditions.combineOperation`.

The node has N+1 outputs, where N is the number of rules. Output `i` receives items matching rule `i`, with the first match winning; unmatched items go to output index N, the default output. In AI mode the output is the label index, and an error or no match routes to the last label index. Items pass through unchanged.

### Merge

`lyzr-nodes-base.merge` combines items from multiple inputs.

| Param       | Type   | Req | Default  | Notes                                                                                                                                            |
| ----------- | ------ | --- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `mode`      | string | No  | `append` | One of `append`, `combineBySql`, `combineByPosition`, `combineByFields`, `mergeByKey`, or `chooseBranch`. An unknown value falls back to append. |
| `joinField` | string | No  | `id`     | For `combineByFields` and `mergeByKey`: the join key (a dot-path) between input 0 and input 1.                                                   |
| `output`    | string | No  | `input1` | For `chooseBranch`: the value `input2` selects input 1, anything else selects input 0.                                                           |

Mode behavior: `append` concatenates all inputs. `combineBySql` and `combineByPosition` pair input 0 and input 1 by position, with input 1's fields winning on collision. `combineByFields` and `mergeByKey` join by `joinField`, with input 0's fields winning on collision. `chooseBranch` emits the chosen input verbatim. With fewer than two inputs, every mode falls back to append.

The node has one output (index 0) in all modes.

### Loop

`lyzr-nodes-base.splitInBatches` runs a loop body once per item or once per batch; body nodes execute inline.

| Param       | Type    | Req | Default | Notes                                                                                 |
| ----------- | ------- | --- | ------- | ------------------------------------------------------------------------------------- |
| `mode`      | string  | No  | `each`  | The value `batches` splits by `batchSize`; anything else runs one item per iteration. |
| `batchSize` | integer | No  | `10`    | Used in `batches` mode only. Must be greater than 0.                                  |

The node also reads `settings.continueOnFail` (boolean, default false): on a failed iteration it appends `{_error, _iteration}` and continues, but if every iteration fails, the node errors.

The node emits on output index 1, the "done" output, which carries the items accumulated from the body's terminal nodes across all iterations. Output 0 feeds the loop body during iteration. Empty input emits `{}` on output 1.

### Stop and Error

`lyzr-nodes-base.stopAndError` halts the workflow with a terminal, non-retryable error.

| Param          | Type   | Req | Default            | Notes                           |
| -------------- | ------ | --- | ------------------ | ------------------------------- |
| `errorMessage` | string | No  | `Workflow stopped` | Embedded in the returned error. |
| `errorType`    | string | No  | `errorMessage`     | Read but effectively unused.    |

The node has no outputs; the run stops with an error.

### Wait

`lyzr-nodes-base.wait` pauses, then passes items through. The pause is capped at 5 minutes.

| Param    | Type   | Req | Default   | Notes                                                                                            |
| -------- | ------ | --- | --------- | ------------------------------------------------------------------------------------------------ |
| `amount` | number | No  | `1`       | Read only if it is a JSON number.                                                                |
| `unit`   | string | No  | `seconds` | One of `milliseconds`, `seconds`, `minutes`, or `hours`. An unknown value falls back to seconds. |

The node has one output: output 0 emits the input items unchanged.

### Filter

`lyzr-nodes-base.filter` keeps only matching items, without branching. It uses the same condition parsing as the If node's rule mode and has no AI mode.

| Param              | Type   | Req | Default | Notes                                                                                          |
| ------------------ | ------ | --- | ------- | ---------------------------------------------------------------------------------------------- |
| `conditions`       | object | No  | None    | Reads `conditions.conditions[]` plus `conditions.combineOperation` as a fallback.              |
| `combineOperation` | string | No  | `and`   | The values `or` and `any` select OR; anything else selects AND. An empty list keeps all items. |

The node has one output: output 0 emits matching items only.

## Data transformation

### Aggregate

`lyzr-nodes-base.aggregate` collapses many items into one.

| Param                  | Type   | Req | Default                     | Notes                                                                                                                                                                                                |
| ---------------------- | ------ | --- | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `aggregate`            | string | No  | `aggregateIndividualFields` | One of `aggregateIndividualFields` or `aggregateAllItemData`. An unknown value is an error.                                                                                                          |
| `fieldsToAggregate`    | array  | No  | None                        | Individual-fields mode. Entries are `{fieldToAggregate, renameField}`, where `fieldToAggregate` is the source field (a dot-path) and `renameField` is the output key, defaulting to the source name. |
| `destinationFieldName` | string | No  | `data`                      | All-item-data mode: the output key holding the array of all items.                                                                                                                                   |

The node has one output: output 0 emits exactly one item, either `{outputKey: [values...]}` in individual-fields mode (including only items where the field existed) or `{destField: [item1, ...]}` in all-item-data mode. Empty input emits `{}`.

### Sort

`lyzr-nodes-base.sort` performs a stable multi-field reorder.

| Param          | Type   | Req | Default | Notes                                                                                                                                                                     |
| -------------- | ------ | --- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sortFieldsUi` | object | No  | None    | Reads `sortFieldsUi.sortField[]`, each `{fieldName, order}`. `fieldName` is a dot-path and empty names are skipped; `order` is `ascending` (the default) or `descending`. |

Comparison is numeric when both sides are numbers, and string comparison otherwise. With no fields configured, the items pass through unchanged.

The node has one output: output 0 emits the sorted items. Empty input emits `{}`.

### Limit

`lyzr-nodes-base.limit` truncates the item list to at most N items.

| Param      | Type    | Req | Default      | Notes                                               |
| ---------- | ------- | --- | ------------ | --------------------------------------------------- |
| `maxItems` | integer | No  | `10`         | Applied only if it is a JSON number greater than 0. |
| `keep`     | string  | No  | `firstItems` | One of `firstItems` or `lastItems`.                 |

The node has one output: output 0 emits the truncated slice, or all items if `maxItems` is greater than or equal to the input length. Empty input emits `{}`.

### Remove Duplicates

`lyzr-nodes-base.removeDuplicates` keeps the first occurrence of each unique key.

| Param             | Type   | Req | Default     | Notes                                                                                  |
| ----------------- | ------ | --- | ----------- | -------------------------------------------------------------------------------------- |
| `compare`         | string | No  | `allFields` | One of `allFields` or `selectedFields`. Falls back to all fields if no fields resolve. |
| `fieldsToCompare` | array  | No  | None        | Entries are `{fieldName}`, where `fieldName` is a dot-path. Empty names are skipped.   |

The node has one output: output 0 emits the deduplicated items with order preserved. Empty input emits `{}`.

### Rename Keys

`lyzr-nodes-base.renameKeys` renames top-level keys on each item.

| Param  | Type   | Req | Default | Notes                                                                                                                                                                                          |
| ------ | ------ | --- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `keys` | object | No  | None    | Reads `keys.key[]`, each `{currentKey, newKey}`. Both are flat top-level keys, not dot-paths. An entry is skipped if either key is empty, and applied only if `currentKey` exists on the item. |

The node has one output: output 0 emits one renamed item per input item. Empty input emits `{}`.

### TOON

`lyzr-nodes-base.toon` converts between JSON items and TOON (Token-Oriented Object Notation).

| Param         | Type   | Req           | Default  | Notes                                                                                                                                           |
| ------------- | ------ | ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `operation`   | string | No            | `encode` | One of `encode` or `decode`. An unknown value is an error.                                                                                      |
| `source`      | any    | No            | None     | Encode only. The value to encode; if absent or blank, all input items are encoded as an array.                                                  |
| `delimiter`   | string | No            | `comma`  | Encode only. One of `comma`, `tab`, or `pipe`. An unknown value is an error.                                                                    |
| `outputField` | string | No            | `toon`   | Encode only. The output key for the TOON string.                                                                                                |
| `text`        | string | Conditionally | `""`     | Decode only. The TOON text; if blank, the node falls back to the first `toon` or `text` field in the inputs, and errors if that is still empty. |

The node has one output. Encode emits a single item `{outputField: "<toon>"}`. Decode emits the items from the document, one item per array element, with non-object elements wrapped as `{value: ...}`.

## Computation and I/O

### Code

`lyzr-nodes-base.code` runs sandboxed JavaScript over the input items, with a 10-second timeout.

| Param    | Type   | Req | Default | Notes                                                                                                                                                                        |
| -------- | ------ | --- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `jsCode` | string | No  | `""`    | The JavaScript source. An empty value passes input through. If the string is itself valid JSON (an array or object), it is returned directly without running any JavaScript. |

The sandbox exposes the globals `$input.all()`, `$input.first()`, `$input.item.json`, `$json` (the first item), `$items` (all items), `$('NodeName')` (an object with `json`, `all()`, `first()`, and `item.json`), and `console.log` and `console.warn`.

Return values map to items as follows: an array of objects becomes the output items, with objects wrapped as `{json: {...}}` unwrapped; an array of primitives is an error, so wrap primitives in objects; a single object becomes one item; and a primitive becomes `{result: value}`.

The node has one output (index 0).

### HTTP Request

`lyzr-nodes-base.httpRequest` makes an authenticated HTTP request with an optional multipart or file body.

| Param              | Type                           | Req | Default | Notes                                                                                                                           |
| ------------------ | ------------------------------ | --- | ------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `url`              | string                         | Yes | `""`    | Errors if empty.                                                                                                                |
| `method`           | string                         | No  | `GET`   | Uppercased. POST, PUT, and PATCH automatically enable `sendBody`.                                                               |
| `auth`             | object                         | No  | None    | See the [auth sub-object](#the-auth-sub-object).                                                                                |
| `sendBody`         | boolean                        | No  | `false` | Automatically true for POST, PUT, and PATCH.                                                                                    |
| `contentType`      | string                         | No  | `json`  | The value `multipart-form-data` selects multipart; anything else selects JSON.                                                  |
| `body`             | string, object, array, or file | No  | None    | See the body precedence below.                                                                                                  |
| `bodyParameters`   | object                         | No  | None    | `{parameters: [{name, value}]}`. Used as the JSON body when `body` is absent, or as multipart fields.                           |
| `jsonBody`         | string                         | No  | None    | Raw JSON body fallback.                                                                                                         |
| `sendHeaders`      | boolean                        | No  | `false` | Must be truthy for headers to apply.                                                                                            |
| `headerParameters` | object                         | No  | None    | `{parameters: [{name, value}]}`.                                                                                                |
| `sendQuery`        | boolean                        | No  | `true`  | Opt-out flag: query parameters are applied unless this is explicitly `false`.                                                   |
| `queryParameters`  | object                         | No  | None    | `{parameters: [{name, value}]}`.                                                                                                |
| `responseFormat`   | string                         | No  | `""`    | The value `blob` returns bytes and `text` returns a raw string; anything else JSON-decodes the response with a string fallback. |

For non-multipart requests, the body is resolved in this precedence order: a file `body` sends raw bytes; a string `body` is sent as-is; an object or array `body` is sent as JSON; `bodyParameters.parameters` is assembled into a JSON object; `jsonBody` is used as a fallback; otherwise no body is sent. For multipart requests, each `bodyParameters.parameters` entry becomes a file part when its value is a file, and a form field otherwise, with `name` set to the stringified `value`.

#### The auth sub-object

The `auth` object's `scheme` key selects one of `""`, `bearer`, `basic`, `api_key`, `oauth2_client_credentials`, `aws_sigv4`, `jwt_bearer`, or `mtls`. Each scheme reads its own keys:

| Scheme                      | Keys                                                                                                                                                                                                  |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `bearer`                    | `token`                                                                                                                                                                                               |
| `basic`                     | `username`, `password`                                                                                                                                                                                |
| `api_key`                   | `api_key`, `api_key_name`, `api_key_in` (`header` by default, or `query`)                                                                                                                             |
| `oauth2_client_credentials` | `token_url`, `client_id`, `client_secret`, `scopes[]`, `audience`                                                                                                                                     |
| `aws_sigv4`                 | `aws_access_key`, `aws_secret_key`, `aws_session_token`, `aws_region`, `aws_service`                                                                                                                  |
| `jwt_bearer`                | `jwt_private_key_pem`, `jwt_algorithm` (RS, ES, or HS variants of 256, 384, and 512), `jwt_issuer`, `jwt_audience`, `jwt_subject`, `jwt_key_id`, `jwt_ttl_seconds` (default 3600), `jwt_extra_claims` |
| `mtls`                      | `mtls_cert_pem`, `mtls_key_pem`, `mtls_ca_cert_pem`                                                                                                                                                   |

The node has one output: output 0 emits a single item `{statusCode, headers, body}`, where `headers` is a comma-joined map. The `body` value depends on `responseFormat`: `blob` yields a file object `{bytes, filename, content_type, size}`, `text` yields the raw string, and anything else yields parsed JSON with a string fallback.

### Execute Workflow

`lyzr-nodes-base.executeWorkflow` runs another workflow, inline or by ID, with the incoming items as its input.

| Param          | Type             | Req | Default | Notes                                                                               |
| -------------- | ---------------- | --- | ------- | ----------------------------------------------------------------------------------- |
| `workflowJson` | string or object | No  | None    | Tried first. A string is parsed as a workflow document; an object is used directly. |
| `workflowId`   | string           | No  | `""`    | Fallback: loads a stored workflow by ID.                                            |

One of the two parameters is required; providing neither is an error.

The node has one output: output 0 emits the flattened concatenation of all sub-workflow output items. If the sub-workflow produced nothing, the node's own input items pass through.

## Utility

### Date & Time

`lyzr-nodes-base.dateTime` performs per-item date operations.

| Param        | Type   | Req | Default      | Notes                                                                   |
| ------------ | ------ | --- | ------------ | ----------------------------------------------------------------------- |
| `action`     | string | No  | `format`     | One of `format`, `add`, `subtract`, or `diff`.                          |
| `date`       | string | No  | `date`       | A field name looked up in the item, not a literal date.                 |
| `format`     | string | No  | `YYYY-MM-DD` | Supports the tokens `YYYY`, `YY`, `MM`, `DD`, `HH`, `mm`, and `ss`.     |
| `unit`       | string | No  | `days`       | One of `seconds`, `minutes`, `hours`, `days`, `months`, or `years`.     |
| `toTimezone` | string | No  | `""`         | An IANA timezone; converts the parsed time if the timezone is loadable. |
| `duration`   | number | No  | `0`          | The amount to add or subtract, truncated to an integer.                 |

The `diff` action reads the end date from the item's `toDate` field. Input dates are parsed flexibly, accepting ISO 8601, `YYYY-MM-DD HH:MM:SS` (with a space or `T` separator), `YYYY-MM-DD`, `MM/DD/YYYY`, `DD-MM-YYYY`, `Jan 2, 2006`, and RFC 1123.

The node has one output: output 0 emits each input item copied with the `date` key overwritten by the formatted value, the diff as a number string, or an `"error: ..."` string.

### Crypto

`lyzr-nodes-base.crypto` performs per-item hashing, HMAC, or AES-256-GCM encryption.

| Param       | Type   | Req           | Default  | Notes                                                                                                    |
| ----------- | ------ | ------------- | -------- | -------------------------------------------------------------------------------------------------------- |
| `action`    | string | No            | `hash`   | One of `hash`, `hmac`, `encrypt`, or `decrypt`.                                                          |
| `algorithm` | string | No            | `sha256` | One of `md5`, `sha256`, or `sha512`, for the hash and hmac actions.                                      |
| `secret`    | string | Conditionally | `""`     | Required for hmac, encrypt, and decrypt. Encrypt and decrypt derive a 32-byte key from it using SHA-256. |
| `value`     | string | No            | `""`     | A field name to look up in the item. If empty or missing, the whole item JSON is used as the input.      |

The `encrypt` action produces base64 of the nonce plus ciphertext, and `decrypt` decodes that format.

The node has one output: output 0 emits each input item copied with `data` set to the result string, or an `"error: ..."` string.

## Human-in-the-loop

### Wait for Approval

`lyzr-nodes-base.waitForApproval` pauses the workflow until a reviewer approves or rejects, optionally emailing reviewers and collecting form data. The approval is resolved via [Resume Execution](/enterprise/api/superflow/executions/resume) or [Resolve Approval](/enterprise/api/superflow/approvals/resolve).

| Param          | Type            | Req | Default | Notes                                                                                                                                                                           |
| -------------- | --------------- | --- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `message`      | string          | No  | `""`    | Shown in the approval UI and email.                                                                                                                                             |
| `notifyEmails` | array or string | No  | None    | Reviewer emails, as an array of strings or a comma-separated string. Values are trimmed and deduplicated.                                                                       |
| `subject`      | string          | No  | None    | Email subject override.                                                                                                                                                         |
| `formSchema`   | array           | No  | None    | Field descriptors `{name, label?, type, required?, requiredOn?, options?, defaultValue?, description?}`. Surfaced to the UI and used for server-side required-field validation. |

Each `formSchema` entry's `requiredOn` is one of `never` (the default), `approve`, `reject`, or `both`. The legacy `required: true` is treated as `approve`, and fields with `type: "boolean"` skip required-gating. The resume call supplies `{approved, reason?, ...form fields}`.

The node has two outputs. Output 0 (approved) emits the input items copied with all resume data merged, including form fields and `approved: true`. Output 1 (rejected) emits the items copied with all resume data merged plus `rejection_reason` and `approved: false`. Empty input emits a single empty item.

## AI

### LLM credential precedence

The AI Agent, LLM, and AI-mode If and Switch nodes resolve their LLM credential in the following order: a loaded agent's credential, then the node's `llm_credential_id`, then an ambient credential supplied by the caller, then inline `credentials` (`<provider>Api.apiKey` or `apiKey`), and finally the platform's default credential for the provider. If nothing resolves, the node errors.

### Reasoning models

Reasoning models ignore `temperature` and `topP`, while `maxTokens` is honored. The reasoning model families are o1, o3, and o4, gpt-5, claude-opus-4-5 through 4-7, claude-sonnet-4-6, gemini-2.5 and later, gemini-3, deepseek-reasoner, sonar-reasoning and sonar-deep-research, and grok reasoning models.

### Delegation with isSubAgent

A downstream `lyzr.agent`, `lyzr.llm`, `lyzr.tool`, or `lyzr.a2aAgent` node with `isSubAgent: true` becomes a tool the upstream LLM can call within its reasoning loop, and is skipped in the main graph. A `waitForApproval` node placed on the delegate path wraps the delegated call in a human-approval gate.

### AI Agent

`lyzr-nodes-base.lyzr.agent` runs a managed agent by ID. As a normal node it delegates to the platform, which resolves the agent's model, prompt, and tools and runs the full reasoning loop, so inline LLM parameters are not read here.

| Param        | Type      | Req | Default | Notes                                                                                                                                                  |
| ------------ | --------- | --- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `agent_id`   | string    | Yes | `""`    | Errors if empty.                                                                                                                                       |
| User message | See notes | Yes | None    | Taken from the `prompt` parameter, or the first non-empty of the input fields `chatInput`, `prompt`, `query`, `input`, `message`, `text`, or `output`. |

As a delegate (`isSubAgent: true`) the node reads `description` (the tool description, falling back to `systemPrompt`) and `responseFormat` (appended to the tool description as the output schema).

The node has one output: output 0 emits the first input item merged with `status: "completed"` and `output`, which holds the agent's text, parsed into an object or array when it is JSON and kept as the raw string otherwise.

### LLM

`lyzr-nodes-base.lyzr.llm` makes an inline single LLM call, or runs a reasoning loop when tools are present.

| Param               | Type      | Req | Default                        | Notes                                                                                          |
| ------------------- | --------- | --- | ------------------------------ | ---------------------------------------------------------------------------------------------- |
| `provider`          | string    | No  | `openai`                       |                                                                                                |
| `model`             | string    | No  | `gpt-4o`                       |                                                                                                |
| `systemPrompt`      | string    | No  | `You are a helpful assistant.` | The system message.                                                                            |
| `maxIterations`     | integer   | No  | `25`                           | The reasoning-loop cap, applied only when tools are present.                                   |
| `temperature`       | number    | No  | Unset                          | Sent only if present and the model is not a reasoning model.                                   |
| `topP`              | number    | No  | `0`                            | Sent only if greater than 0 and the model is not a reasoning model.                            |
| `maxTokens`         | integer   | No  | Unset                          | Sent if present.                                                                               |
| `responseFormat`    | object    | No  | None                           | When set, `output` is parsed into an object.                                                   |
| `llm_credential_id` | string    | No  | `""`                           | A bring-your-own-model credential ID. See [credential precedence](#llm-credential-precedence). |
| User message        | See notes | Yes | None                           | The `prompt` parameter or the input fields listed under the AI Agent node.                     |

Tools are not a node parameter. They come from an `_extra_tools` field on the input item and from downstream `isSubAgent` delegate nodes. Prior turns are read from an input item's `history` field, an array of `{role, content, tool_calls?, tool_call_id?}` objects.

The node has one output: output 0 emits an item with `status`, `output` (a parsed object when `responseFormat` is set, a string otherwise), `input_tokens`, and `output_tokens`, plus `iterations` in a reasoning loop. If client-side tool calls are pending, the item carries `status: "requires_action"` and `pending_tool_calls`.

### Task Decomposition

`lyzr-nodes-base.lyzr.taskDecomposition` breaks a task into subtasks with one LLM call, runs each subtask in parallel, then aggregates the results with one more LLM call. It accepts the same inline LLM parameters as the LLM node, plus the following.

| Param                 | Type    | Req | Default  | Notes                                   |
| --------------------- | ------- | --- | -------- | --------------------------------------- |
| `decompositionPrompt` | string  | No  | Built-in | The decompose-phase system prompt.      |
| `aggregationPrompt`   | string  | No  | Built-in | The aggregate-phase system prompt.      |
| `maxSubtasks`         | integer | No  | `10`     | Caps the number of subtasks.            |
| `agent_id`            | string  | No  | `""`     | An optional agent used to run subtasks. |

A subtask may carry its own `agent_id` to run as a nested agent. This node cannot itself be a delegate.

The node has one output: output 0 emits an item with `status`, `output` (the aggregation text), `subtasks[]`, `subtask_results[]` (each `{id, description, status, output|error}`), and summed `input_tokens` and `output_tokens`.

### Tool

`lyzr-nodes-base.lyzr.tool` directly executes a platform tool without an LLM. It runs once per input item.

| Param          | Type   | Req | Default | Notes                                                                                                                                                                                     |
| -------------- | ------ | --- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `tool_name`    | string | Yes | `""`    | Errors if empty.                                                                                                                                                                          |
| `tool_configs` | array  | No  | `[]`    | Passed through to the platform; carries tool credentials.                                                                                                                                 |
| `arguments`    | object | No  | None    | Used as the tool arguments (with empty values stripped) if present and non-empty; otherwise the arguments are built from the input item's fields, excluding `_extra_tools` and `history`. |

The node has one output, emitting one item per input item, and every item carries `tool_name`. The tool's response is mapped as follows: an object `result` is spread into the item; a scalar or array `result` is stored at `item["result"]`; a response with no `result` key is spread into the item whole; and a non-JSON response is stored at `item["result"]` as the raw string.

As a delegate, the node reads `tool_name` (the delegate tool name), `description`, `tool_configs`, `fixedInputs` (injected values hidden from the LLM), and `action_schema`, whose `properties` and `required` become the tool's parameter schema.

### A2A Agent

`lyzr-nodes-base.lyzr.a2aAgent` calls a remote Agent2Agent server using agent-card discovery and `message/send`. No local LLM is involved.

| Param          | Type      | Req         | Default                         | Notes                                                                                          |
| -------------- | --------- | ----------- | ------------------------------- | ---------------------------------------------------------------------------------------------- |
| `agentUrl`     | string    | Yes         | `""`                            | The agent card is resolved at `<url>/.well-known/agent-card.json`.                             |
| User message   | See notes | Yes         | None                            | The `prompt` parameter or the input fields listed under the AI Agent node.                     |
| `authType`     | string    | No          | `api_key`                       | One of `none`, `oauth`, or `api_key`.                                                          |
| `apiKey`       | string    | No          | `""`                            | For api\_key auth. An empty value sends no auth header.                                        |
| `apiKeyHeader` | string    | No          | `Authorization`                 | The header name. `Authorization` sends `Bearer <key>`; any other name sends the raw key value. |
| `tenantId`     | string    | Yes (oauth) | `""`                            | The OAuth tenant.                                                                              |
| `clientId`     | string    | Yes (oauth) | `""`                            | The OAuth client.                                                                              |
| `clientSecret` | string    | Yes (oauth) | `""`                            | The OAuth secret. OAuth errors if any of the three values is empty.                            |
| `scope`        | string    | No          | `https://ai.azure.com/.default` | The OAuth scope.                                                                               |

The node has one output: output 0 emits an item with `status: "completed"`, `output` (the agent reply), `input_tokens: 0`, `output_tokens: 0`, and `task_state` if present.

## Document intelligence

The Parse, Extraction, and Label nodes call the document service. The `tier` parameter, defaulting to `standard`, selects the processing tier: `standard` covers OCR, DPI, and language options; `advanced` covers tables, formulas, and output format; and `agentic` uses a VLM. An unknown tier is an error. Parse and Extraction share the same tier configuration.

### Parse

`lyzr-nodes-base.lyzr.parse` downloads a file and returns its parsed pages, chunks, and full text.

The common parameters are `tier`, `timeout_seconds` (default 300), `file_url`, `file_type` (inferred from the URL or file when empty; must be one of pdf, docx, xlsx, pptx, image, txt, or csv), `chunk_size` (default 1000), and `chunk_overlap` (default 100).

Tier-specific parameters are applied only for the relevant tier:

| Tier       | Parameters and defaults                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `standard` | `ocr_enabled` (true), `language` (`en`), `dpi` (150), `target_pages` (`""`), `max_pages` (0, applied if greater than 0).                                                                                                                                                                                                                                                                                                                |
| `advanced` | `extract_tables` (true), `extract_formulas` (true), `extract_charts` (false), `extract_seals` (false), `auto_orient` (true), `auto_unwarp` (false), `output_format` (`markdown`), `language`, `target_pages`.                                                                                                                                                                                                                           |
| `agentic`  | `vlm_provider` (empty selects `google`), `vlm_model` (empty selects the platform default), `parsing_mode` (`full`), `parsing_instructions`, `chunking_strategy` (`basic`), `chunk_max_tokens` (512), `table_format` (`markdown`), `describe_images` (false), `parallel_pages` (5), `start_page` and `end_page` (applied if greater than 0), `extract_tables`, `dpi`, and `credential_id` (a bring-your-own VLM key, agentic tier only). |

The file is resolved in this order: an explicit `file_url` parameter, then an inline file in the inputs, then the first upstream `file_url` field. If none is found, the node errors. The download limit is 100 MB.

The node has one output: output 0 emits `{status: "completed", tier, file_url, file_type, pages[], full_text, chunks[], metadata, file}`, where each page is `{number, text}`, each chunk is `{text, metadata}`, and `metadata` holds `{total_pages, total_chunks, engine}`.

### Extraction

`lyzr-nodes-base.lyzr.extraction` extracts structured data matching a JSON Schema.

| Param                                                                           | Type          | Req | Default       | Notes                                                                           |
| ------------------------------------------------------------------------------- | ------------- | --- | ------------- | ------------------------------------------------------------------------------- |
| `extraction_schema`                                                             | string (JSON) | Yes | None          | A JSON Schema object as a string. An empty or invalid value is an error.        |
| `target`                                                                        | string        | No  | `per_doc`     | One of `per_doc`, `per_page`, or `per_table_row`. An unknown value is an error. |
| `tier`                                                                          | string        | No  | `standard`    | The same tiers as Parse.                                                        |
| `annotate`                                                                      | boolean       | No  | `false`       | Overlays annotations on the source and forwards `file_url` for writeback.       |
| `timeout_seconds`                                                               | number        | No  | `300`         |                                                                                 |
| `file_url`, `file_type`, `chunk_size`, `chunk_overlap`, and all tier parameters | Varies        | No  | Same as Parse | Extraction does not read `credential_id`.                                       |

If an input item carries a non-empty `full_text` field, for example from a Parse node, the download is skipped and `full_text` (plus a `file_url` hint) is submitted instead.

The node has one output: output 0 emits `{status: "completed", file_url, file_type, file, ...extraction fields}`, where the service's presigned `file_url` wins over the input value and `file` is present only when a file was downloaded.

### Label / Classify

`lyzr-nodes-base.lyzr.label` classifies text against a set of rules.

| Param             | Type                | Req           | Default | Notes                                                                                       |
| ----------------- | ------------------- | ------------- | ------- | ------------------------------------------------------------------------------------------- |
| `text`            | string              | Conditionally | `""`    | Falls back to an upstream `full_text` or `text` field; if still empty, the node errors.     |
| `rules`           | string (JSON array) | Yes           | None    | A JSON array of `{type, description}`. An empty, invalid, or empty-array value is an error. |
| `timeout_seconds` | number              | No            | `120`   |                                                                                             |

The node has one output: output 0 emits `{status: "completed", text_preview, rules[], file_url, ...classification fields}`, where `text_preview` is the first 200 characters, `rules[]` echoes the input rules, `file_url` is included if an upstream one exists, and the classification fields typically include `label`, `confidence`, and `reasoning`.

## Safety

### Guardrails

`lyzr-nodes-base.lyzr.guardrails` evaluates text against a Responsible AI policy and routes items to an allowed or blocked output. Service errors are terminal and fail closed; there is no fail-open routing.

| Param             | Type   | Req           | Default | Notes                                                                                                                                          |
| ----------------- | ------ | ------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `policy_id`       | string | Yes           | None    | The policy to evaluate against. An empty value is an error.                                                                                    |
| `text`            | string | Conditionally | `""`    | Falls back to upstream fields in order: `full_text`, `text`, `output`, `content`, `chatInput`, `input`, `message`. An empty value is an error. |
| `endpoint`        | string | No            | `""`    | A service URL override.                                                                                                                        |
| `api_key`         | string | No            | `""`    | Falls back to the request's API key.                                                                                                           |
| `timeout_seconds` | number | No            | `100`   |                                                                                                                                                |

The node has two outputs. Output 0 (allowed) emits the base item copied with `blocked: false`, `warnings`, `text` (the redacted text if redaction happened, the original otherwise), and `original_text` only when redaction changed the text. Output 1 (blocked) emits the base item copied with `blocked: true`, `block_reason`, `detections` (an object), `warnings`, and `original_text`.
