Processors
Endpoints for discovering processor drivers and managing the processors attached to a Template. Processors supply dynamic data to a Template during rendering, drawing from sources such as the current User, Datasets, native SQL or Elasticsearch queries, Power Scripts, and AI Assistants.
Every route on this page requires the templates license feature. The
collection and lookup routes resolve the Template through the read_access
scope (template.lookup(params.id)), so a Template the caller cannot see
returns 404. {id} may be the Template uuid or its natural id
(ownerId:slug). Mutating routes additionally require a Template-level
permission, called out per endpoint below.
Processor phases
A processor runs in one of three phases during rendering, recorded in its
phase field:
- data - fetch data before the Template executes (the default and most common phase)
- pre - pre-process the context before Template execution
- post - post-process the output after Template execution
A processor's type is the id of its processor driver (see the discovery
endpoints below). Common types include current-user, dataset,
dataset-search, sql-query, power-script, adhoc, and assistant-prompt.
GET /api/processor-drivers
Discover the processor drivers available to the caller.
Authentication: Required
Response:
A HAL collection embedding inf:processor-driver, not raw Joi schemas. The list
is filtered by each driver's isEligible(req): adhoc, current-user,
dataset, dataset-search, power-script, and sql-query are always
eligible, while assistant-prompt appears only when AI is enabled on the
tenant. Each driver carries display metadata (name, description, icon,
image) and the client component names used to create and edit a processor of
that type.
{
"_links": {
"self": {
"href": "https://informer.example.com/api/processor-drivers"
}
},
"start": 0,
"count": 6,
"total": 6,
"_embedded": {
"inf:processor-driver": [
{
"_links": {
"self": {
"href": "https://informer.example.com/api/processor-drivers/adhoc"
}
},
"id": "adhoc",
"name": "Ad hoc Query",
"description": "Add an Ad hoc Query to the Template, binding input parameters",
"image": "/images/icons/query.svg",
"createComponent": "adhocProcessorForm",
"settingsComponent": "adhocProcessorForm",
"editComponent": "adhocProcessorTab",
"openOnCreate": true,
"icon": "flaticon-query"
},
{
"_links": {
"self": {
"href": "https://informer.example.com/api/processor-drivers/current-user"
}
},
"id": "current-user",
"name": "Current User",
"description": "Adds the current User and Session running the Template to the context.",
"image": "/images/icons/user.svg",
"createComponent": "currentUserProcessorComponent",
"openOnCreate": false,
"icon": "fas fa-user",
"editComponent": "current-userTemplateProcessor",
"settingsComponent": "current-userTemplateProcessor"
},
{
"_links": {
"self": {
"href": "https://informer.example.com/api/processor-drivers/dataset"
}
},
"id": "dataset",
"name": "Dataset",
"description": "Add a Dataset reference as a context variable, optionally including records",
"image": "/images/icons/dataset.svg",
"createComponent": "datasetTemplateProcessorForm",
"editComponent": "datasetTemplateProcessorTab",
"openOnCreate": true,
"icon": "far fa-file-search",
"settingsComponent": "datasetTemplateProcessor"
},
"… 3 more items (6 total) — omitted from docs"
]
}
}
GET /api/processor-templates
Discover pre-configured processor recipes ("processor templates").
Authentication: Required
Response:
A HAL doc built from the template-processor-builder driver manager's discover
output. Each items entry pairs display metadata with a processor stub
(carrying the type) that seeds a new processor. The collection is empty when
no processor-template builders are registered for the tenant.
{
"_links": {
"self": {
"href": "https://informer.example.com/api/processor-templates"
}
},
"items": [
{
"detective": "00000000-0000-4000-8000-000000000001",
"id": "00000000-0000-4000-8000-000000000001:0",
"value": {
"id": "adhoc",
"name": "Ad hoc Query",
"description": "Add an Ad hoc Query to the Template, binding input parameters",
"image": "/images/icons/query.svg",
"createComponent": "adhocProcessorForm",
"settingsComponent": "adhocProcessorForm",
"editComponent": "adhocProcessorTab",
"openOnCreate": true,
"icon": "flaticon-query",
"group": "__top",
"processor": {
"type": "adhoc"
}
}
},
{
"detective": "00000000-0000-4000-8000-000000000002",
"id": "00000000-0000-4000-8000-000000000002:0",
"value": {
"id": "current-user",
"name": "Current User",
"description": "Adds the current User and Session running the Template to the context.",
"image": "/images/icons/user.svg",
"createComponent": "currentUserProcessorComponent",
"openOnCreate": false,
"icon": "fas fa-user",
"editComponent": "current-userTemplateProcessor",
"settingsComponent": "current-userTemplateProcessor",
"group": "__top",
"processor": {
"type": "current-user"
}
}
},
{
"detective": "00000000-0000-4000-8000-000000000003",
"id": "00000000-0000-4000-8000-000000000003:0",
"value": {
"id": "dataset",
"name": "Dataset",
"description": "Add a Dataset reference as a context variable, optionally including records",
"image": "/images/icons/dataset.svg",
"createComponent": "datasetTemplateProcessorForm",
"editComponent": "datasetTemplateProcessorTab",
"openOnCreate": true,
"icon": "far fa-file-search",
"settingsComponent": "datasetTemplateProcessor",
"group": "__top",
"processor": {
"type": "dataset"
}
}
},
"… 4 more items (7 total) — omitted from docs"
],
"start": 0,
"count": 7,
"total": 7
}
GET /api/templates/{id}/processors
List a Template's processors, ordered by index.
Authentication: Required
Pre-blocks: template.lookup(params.id)
Response:
A HAL collection embedding the Template's processors as
inf:template-processor. Each row carries its type, name, index, phase,
and data, plus the nullable source ids (datasetId, queryId,
datasourceId, assistantId) and their eager-loaded relations (dataset,
query, datasource, assistant), which are null when unset.
{
"_links": {
"self": {
"href": "https://informer.example.com/api/templates/00000000-0000-4000-8000-000000000001/processors"
}
},
"start": 0,
"count": 3,
"total": 3,
"_embedded": {
"inf:template-processor": [
{
"_links": {
"self": {
"href": "https://informer.example.com/api/templates/00000000-0000-4000-8000-000000000001/processors/00000000-0000-4000-8000-000000000002"
}
},
"label": "currentUser",
"tenant": "acme",
"id": "00000000-0000-4000-8000-000000000002",
"type": "current-user",
"name": "currentUser",
"templateId": "00000000-0000-4000-8000-000000000001",
"datasetId": null,
"queryId": null,
"datasourceId": null,
"assistantId": null,
"index": 0,
"phase": "data",
"data": {},
"createdAt": "2026-01-15T16:20:00.000Z",
"updatedAt": "2026-01-15T16:20:00.000Z",
"assistant": null,
"dataset": null,
"query": null,
"datasource": null
},
{
"_links": {
"self": {
"href": "https://informer.example.com/api/templates/00000000-0000-4000-8000-000000000001/processors/00000000-0000-4000-8000-000000000003"
}
},
"label": "totals",
"tenant": "acme",
"id": "00000000-0000-4000-8000-000000000003",
"type": "power-script",
"name": "totals",
"templateId": "00000000-0000-4000-8000-000000000001",
"datasetId": null,
"queryId": null,
"datasourceId": null,
"assistantId": null,
"index": 1,
"phase": "data",
"data": {
"script": "return { total: 0 };"
},
"createdAt": "2026-01-15T16:20:00.000Z",
"updatedAt": "2026-01-15T16:20:00.000Z",
"assistant": null,
"dataset": null,
"query": null,
"datasource": null
},
{
"_links": {
"self": {
"href": "https://informer.example.com/api/templates/00000000-0000-4000-8000-000000000001/processors/00000000-0000-4000-8000-000000000004"
}
},
"label": "scratch",
"tenant": "acme",
"id": "00000000-0000-4000-8000-000000000004",
"type": "current-user",
"name": "scratch",
"templateId": "00000000-0000-4000-8000-000000000001",
"datasetId": null,
"queryId": null,
"datasourceId": null,
"assistantId": null,
"index": 2,
"phase": "data",
"data": {},
"createdAt": "2026-01-15T16:20:00.000Z",
"updatedAt": "2026-01-15T16:20:00.000Z",
"assistant": null,
"dataset": null,
"query": null,
"datasource": null
}
]
}
}
POST /api/templates/{id}/processors
Add a processor to a Template.
Authentication: Required
Pre-blocks: template.lookup(params.id), permission.template.write(pre.template)
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Processor driver id (see GET /api/processor-drivers) |
name | string | No | Variable name for the Template context |
datasetId | string | No | Dataset id (for a dataset processor) |
datasourceId | string | No | Datasource id (for a datasource-backed processor) |
assistantId | string | No | Assistant id (for an assistant-prompt processor) |
reportId | string | No | Report id |
queryId | string | No | Query id |
data | object | No | Processor-specific configuration |
The index is server-assigned to the current processor count, so a new
processor is appended to the end. phase is not accepted on create; set it
later with a PUT.
Example Request:
{
"type": "power-script",
"name": "subtotal",
"data": {
"script": "return { subtotal: 0 };"
}
}
Response:
Responds 201 Created with the new processor and a Location header. The fresh
row reports phase: null until it is set via PUT.
{
"type": "power-script",
"name": "subtotal",
"data": {
"script": "return { subtotal: 0 };"
}
}
{
"_links": {
"self": {
"href": "https://informer.example.com/api/templates/00000000-0000-4000-8000-000000000001/processors/00000000-0000-4000-8000-000000000002"
}
},
"label": "subtotal",
"tenant": "acme",
"id": "00000000-0000-4000-8000-000000000002",
"type": "power-script",
"name": "subtotal",
"data": {
"script": "return { subtotal: 0 };"
},
"templateId": "00000000-0000-4000-8000-000000000001",
"index": 3,
"updatedAt": "2026-01-15T16:20:00.000Z",
"createdAt": "2026-01-15T16:20:00.000Z",
"datasetId": null,
"queryId": null,
"datasourceId": null,
"phase": null,
"assistantId": null
}
GET /api/templates/{id}/processors/{processor}
Retrieve a single processor.
Authentication: Required
Pre-blocks: template.lookup(params.id)
Response:
The processor row. inf:datasource, inf:dataset, and inf:query are embedded
only when the matching id is set on the processor; there is no inf:assistant
embed.
{
"_links": {
"self": {
"href": "https://informer.example.com/api/templates/00000000-0000-4000-8000-000000000001/processors/00000000-0000-4000-8000-000000000002"
}
},
"label": "subtotal",
"tenant": "acme",
"id": "00000000-0000-4000-8000-000000000002",
"type": "power-script",
"name": "subtotal",
"templateId": "00000000-0000-4000-8000-000000000001",
"datasetId": null,
"queryId": null,
"datasourceId": null,
"assistantId": null,
"index": 3,
"phase": null,
"data": {
"script": "return { subtotal: 0 };"
},
"createdAt": "2026-01-15T16:20:00.000Z",
"updatedAt": "2026-01-15T16:20:00.000Z",
"assistant": null,
"dataset": null,
"query": null,
"datasource": null
}
PUT /api/templates/{id}/processors/{processor}
Update a processor's configuration.
Authentication: Required
Pre-blocks: template.lookup(params.id), permission.template.write(pre.template)
Request Body:
The payload is stripUnknown, so unrecognized fields are dropped. Every field
is nullable.
| Field | Type | Description |
|---|---|---|
name | string | null | Variable name for the Template context |
data | object | null | Processor-specific configuration |
type | string | null | Processor driver id |
datasetId | string | null | Dataset id |
queryId | string | null | Query id |
datasourceId | string | null | Datasource id |
assistantId | string | null | Assistant id |
index | number | null | Execution order |
phase | string | null | Execution phase: data, pre, or post |
reportId is not a PUT field (it is accepted only on create).
Example Request:
{
"name": "subtotal",
"phase": "pre",
"data": {
"script": "return { subtotal: 100 };"
}
}
Response:
Responds 200 with the updated processor.
{
"name": "subtotal",
"phase": "pre",
"data": {
"script": "return { subtotal: 100 };"
}
}
{
"_links": {
"self": {
"href": "https://informer.example.com/api/templates/00000000-0000-4000-8000-000000000001/processors/00000000-0000-4000-8000-000000000002"
}
},
"label": "subtotal",
"tenant": "acme",
"id": "00000000-0000-4000-8000-000000000002",
"type": "power-script",
"name": "subtotal",
"templateId": "00000000-0000-4000-8000-000000000001",
"datasetId": null,
"queryId": null,
"datasourceId": null,
"assistantId": null,
"index": 3,
"phase": "pre",
"data": {
"script": "return { subtotal: 100 };"
},
"createdAt": "2026-01-15T16:20:00.000Z",
"updatedAt": "2026-01-15T16:20:00.000Z",
"assistant": null,
"dataset": null,
"query": null,
"datasource": null
}
POST /api/templates/{id}/_processor-order
Reorder a Template's processors by updating their index values.
Authentication: Required
Pre-blocks: template.lookup(params.id), permission.template.write(pre.template)
Request Body:
An object with a processors array, not a bare array of ids. Each entry updates
one processor's index.
| Field | Type | Required | Description |
|---|---|---|---|
processors | array | Yes | Processors to reorder |
processors[].id | string | Yes | Processor id |
processors[].index | number | No | New execution order |
processors[].name | string | No | Processor name |
Each row's index is updated inside a deferred transaction.
Example Request:
{
"processors": [
{ "id": "00000000-0000-4000-8000-000000000002", "index": 0 },
{ "id": "00000000-0000-4000-8000-000000000003", "index": 1 }
]
}
Response:
Responds 200 with an empty body.
{
"processors": [
{
"id": "00000000-0000-4000-8000-000000000002",
"index": 0
},
{
"id": "00000000-0000-4000-8000-000000000003",
"index": 1
}
]
}
DELETE /api/templates/{id}/processors/{processor}
Remove a processor from a Template.
Authentication: Required
Pre-blocks: template.lookup(params.id), permission.template.edit(pre.template)
Response:
Responds 200 with an empty body. Deletion cascades any embedded Dataset the
processor created.
This route resolves with an empty body and a 200 status (the Informer
db.remove convention), not 204 No Content.