Build an agent
This section is for developers building an agent that runs as a step in a Nora agentic workflow, for example an n8n workflow or your own service. If you only want to start runs and read results, see Run agentic extraction via API instead.
An agent is an HTTPS endpoint. For each step, Nora sends it one JSON request (the envelope) and reads back one result (the completion). Nora treats every agent the same way, whether Nora hosts it or you do.
The envelope
For each step, Nora sends POST <your webhook URL> with Content-Type: application/json:
{
"workflowRunId": "1d2e3f4a-…",
"agentRunId": "7b8c9d0e-…",
"threadId": "5f0c3a6e-…",
"messages": [
{ "role": "user", "content": "Please quote the attached fleet, renewal from 1 November." }
],
"attachments": [
{ "fileId": "a1c2e3f4-…", "name": "fleet-schedule.xlsx", "mimeType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "size": 40211, "source": "thread" }
],
"authToken": null,
"schema": null,
"workflowParams": { "submissionId": "3b7f0a1e-…" },
"previousPayload": { "submissionId": "3b7f0a1e-…" },
"assistant": {
"name": "Nora",
"descriptor": "Insly's AI assistant",
"tone": "friendly/casual",
"styleNotes": null,
"instructions": "…"
},
"callbackToken": "eyJhbGciOiJIUzI1NiIs…"
}agentRunId
This step's id. Return it in your completion.
workflowRunId, threadId
The run and the conversation this step belongs to.
messages
The conversation so far, oldest first, ending with the message that triggered the run. At most 30 messages. role is user for the sender and system for Nora.
attachments
The conversation's documents, as ids only, never as bytes or URLs. Download them with the file endpoint.
workflowParams
The run's parameters: what was gathered from the sender, what is pinned for this step, and what earlier steps produced (see configuration).
previousPayload
The previous step's outputPayload. null on the first step.
authToken
Your organisation's token for this agent, if your agent's settings declare one. Otherwise null.
schema
The JSON Schema stored in your agent's settings, if any, forwarded as is. Useful for an agent that extracts data against a schema. Otherwise null.
assistant
Your organisation's assistant name and tone. If your agent writes text for the customer, paste assistant.instructions into your system prompt, so your messages sound like Nora's own replies.
callbackToken
A credential for this step only. Use it as Authorization: Bearer on the agent endpoints. It is valid for your agent's configured timeout.
Answering: right away, or later
Answer with any 2xx. Nora reads the response body and decides which of these two cases applies.
Answer right away. If the body is a completion, the step finishes straight away:
A body counts as a completion only if it has type: "completion", a string agentRunId, a boolean isComplete and a string outputMessage. outputPayload is an optional JSON object.
Answer later. Any other 2xx body, including an empty one or "OK", counts as an acknowledgement. The step waits until you send the same completion JSON to the callback endpoint. Use this for anything that takes longer than a few seconds.
You must answer, or call back, within your agent's timeout. After that the step fails with a "took too long" message, and the whole run fails, even if the step is optional. A non-2xx response, or a connection error, fails the step with a generic error message.
Outcomes
isComplete: true
The step succeeded. outputPayload becomes the next step's previousPayload. On the last step, outputMessage is the reply the customer receives.
isComplete: false
The step failed. The run stops here, later steps don't run, and the customer receives an error reply based on outputMessage. If the step is marked optional, the run carries on without it.
isComplete: true with outputPayload.haltWorkflow: true
The run stops here with status completed, not failed, and outputMessage is the reply. Use this when stopping early is a normal result. Nora's validation step uses it for "required fields are missing".
Write outputMessage for the customer. Nora may adjust the wording to match your organisation's tone and the conversation, but keeps the content.
Declaring what your agent needs
Each agent is registered with two declarations. Insly stores them when it registers your agent.
Settings are fixed per organisation when the agent is installed: credentials, a tenant URL and similar. The agent's settings schema (settings_schema) is a JSON Schema (draft-07), and the organisation's settings must match it. Nora checks this when the workflow is set up and again before every call. If the check fails, the step fails with a "not set up correctly" message and your agent is not called.
Declare an
authTokenproperty if you want a per-organisation token. Nora sends it asauthTokenin the envelope, and only if you declare it.Declare a
ledgerproperty if your agent works with the organisation's Insly Ledger. Nora then addstenantId,ledgerBaseUrlandroletoworkflowParams.An agent that needs no settings declares none.
Configuration (configuration) describes each run: what the agent needs and what it gives to later steps.
parametersis a JSON Schema for what your agent reads fromworkflowParams. Before the first step runs, Nora asks the sender for every required parameter that nothing else supplies. On the API nothing is asked; the start request fails with400instead. Thedescriptionappears in the question sent to the sender, so write it for the customer.produceslists the keys of youroutputPayloadthat later steps may use. After your step completes, Nora copies those keys intoworkflowParamsfor every later step. This is howsubmissionIdgets from the conversion step to every later one.
A workflow asks the sender only for what is actually missing. That is every step's required parameters, minus anything an earlier step produces and anything pinned on the step.
Pinned inputs. A workflow can set a fixed value for a parameter on one step (inputs), for example { "productCode": "MOTOR-FLEET" }. The pinned value goes to that step only and is never asked for. tenantId, ledgerBaseUrl and role are reserved for Nora and can't be pinned.
Registering an agent
There is no self-service API for registering agents yet. To register one, send Insly:
the webhook URL (HTTPS, reachable from the internet),
a timeout in seconds. This is how long you may take to answer or call back. It also sets how long the
callbackTokenis valid,the
settings_schema, and the organisation'ssettings,the
configuration(parametersandproduces),which workflow the agent belongs in, and at which position.
Next: Agent endpoints, for sending a completion later, reporting progress, and reading or attaching files.
Was this helpful?