case study · n8n automation with AI agents

A security task queue that everyone read from scratch that tells you where to start

Every 30 minutes an n8n dispatcher reads new and changed tasks from Jira, triages them with an AI model and hands each one to one of three specialist agents. The engineer gets a finished risk assessment, a tool review or a draft procedure, and when AI has nothing to add, an honest “this needs hands-on work in the systems”.

Client
IT security team at an IT services provider (anonymised)
Scope
Task corpus analysis, agent design, workflow, integrations, maintenance
Stack
n8n · Claude (Sonnet and Opus) · Jira Cloud · wiki
Access
Jira read-only, results in the wiki and by e-mail
The dispatcher workflow in n8n after a run: register, Jira fetch, AI triage and the specialist switch, next to a generated change risk assessment report
The n8n dispatcher and the report it produces. Screenshots come from an isolated copy of the workflow run on sample data.

01 / starting point

Every task started with the same fifteen minutes

The security engineer gets Jira tasks from the whole company: tool reviews, change risk assessments, procedures, checks in internal systems. Before the real work starts, someone has to understand the request, draft a checklist and assess the impact on the rest of the infrastructure. That step repeated for every task.

  1. 01Two-sentence requests

    “We want to use tool X, is that OK?” is a typical description. The context has to be built from scratch: who is behind the tool, where it keeps data, what about SSO.

  2. 02Different kinds of work, one issue type

    A tool review, a formal risk assessment and a policy draft are three different deliverables, yet in Jira they are all just a “Task”.

  3. 03Context in comments and attachments

    Key facts show up in the thread weeks after the task was created. A new comment should trigger the analysis again, with the full context.

  4. 04Zero writes to Jira

    A requirement from day one: the automation only reads. It never changes statuses, comments or assigns. The output goes to the engineer, not to the requester.

  5. 05Not everything can be automated

    Checking MFA or inventorying devices is hands-on work in the systems. An AI essay on “why MFA matters” would be worse than no answer.

  6. 06An instance unreachable from the internet

    n8n runs only on the internal network and over VPN, so Jira Cloud cannot call a webhook. Polling on a schedule is the only option.

02 / numbers

Three in four tasks get a finished deliverable, not just triage

Data from the analysis register, August to November 2026. The latest analysis of each task is counted.

41
tasks analysed automatically since launch
31
with a specialist deliverable (76%): a risk assessment, a review or a document draft
3
specialist agents designed from an analysis of real tasks
0
writes to Jira the workflow only has read permission
~60s
triage per task, with a checklist and impact assessment
2–6min
specialist work per task (measured at 160–350 s)
30min
polling interval sized for the worst case of three tasks
49%
requests with gaps so specialists do not wait for completeness, they flag gaps in the deliverable
tasks by kind of work identified by triagen = 41 · full width = 11
Hands-on work in systems11
Change risk assessment10
Technical rollout6
Tool or SaaS6
Policy or procedure4
SDLC control3
Response to a report1

The kind of work is the model’s judgement, not a Jira field. The same kind can go to different specialists or to none: whether a specialist runs depends on a separate AI contribution rating.

03 / corpus analysis

Count the tasks first, design the agents second

Instead of guessing which specialists were needed, a separate one-off workflow pulled all of the engineer’s tasks (38), closed ones included, and had a model cluster them by kind of work rather than by words in the title. For each cluster the model had to judge honestly what AI could do without access to the company’s systems.

Specialist

Tool or SaaS review

Someone wants to introduce a tool. Deliverable: an approval recommendation with conditions. This is the only agent with web search, because the request usually contains just a name.

Specialist

Change risk assessment

An in-house rollout, an infrastructure change, a partner integration. Deliverable: a risk table, acceptance conditions and an escalation recommendation, ready to defend in front of an auditor.

Specialist

Process document

A procedure, policy, catalogue, SDLC control or a review of a submitted document. Five SDLC programme tasks did not justify a separate agent, so they run as a mode.

No agent

Hands-on work in systems

The largest cluster, 34% of the corpus: configuration, inventories, checks in admin panels and attachment contents. Here triage delivers a checklist and says plainly that AI will add nothing more.

04 / architecture

One dispatcher, three specialists, one source of truth

The dispatcher has 27 nodes. Specialists are separate sub-workflows called synchronously, so each can be developed and tested on its own while the report is assembled in one place.

One place for the decision

Whether a specialist runs is computed by the validation code: the model has to declare a real contribution (a full deliverable or a draft) and name one of the three known agents. The n8n switch only routes, so the logic is not scattered across nodes.

Two models, two roles

Triage runs on the cheaper Claude Sonnet because it sees every task. Specialists run on Claude Opus because their output ends up in documentation. The triage model does not have to be the best, it has to be well calibrated.

Full context for the specialist

The specialist gets everything: the description, all comments, attachment metadata and the triage findings. A complete request is not required, because the corpus analysis showed almost none are. The agent flags gaps in the deliverable.

05 / triage

Fields that mean something instead of “risk: medium”

Triage returns JSON to a schema. Most of the prompt work went into calibration: models like to default to medium risk out of caution and mark every request as incomplete.

riskLevel

Risk is not medium by default

Each level has a definition: LOW is a local, reversible impact; HIGH means personal data, privileged access or external exposure. Medium has to follow from the content, not from uncertainty.

informationSufficient

“Can start”, not “description is complete”

If the first step is clear, the field is true and gaps go to a separate list. False is reserved for cases where nothing can move without an answer.

aiContribution

Full deliverable, draft or nothing

The question is not “will AI close the task” but “what useful artefact will it produce”. “none” is a valid and frequent answer. A platitude about security being important is worse than no answer.

honesty

The attachment exists even if unseen

The model only gets file metadata. It must not claim there is no attachment: it has to say the file needs human review and what to look for in it.

The Validate triage node editor in n8n: raw model JSON on the left, resilient parsing code in the middle, the normalised task on the right
Response validation. Raw model JSON on the left, the normalised result with the route field the switch acts on, on the right.
Triage-only e-mail report for an MFA check: checklist, ecosystem impact and a note that AI contributes nothing here
A task without a specialist. An MFA check needs logs and configuration, so the report ends plainly: “AI contributes nothing” and why.

One semicolon does not void an analysis

Once the model put a semicolon instead of a comma in a complete, good answer with a risk table. The parser now tries a few targeted repairs and notes in the report that a repair was needed. Across 50 register entries it helped twice.

A failure does not close the task

When the answer cannot be repaired, the report states the failure instead of faking an assessment. The register gets an empty fingerprint, so the task returns on the next run instead of getting stuck as “processed”.

06 / specialists

Every finding says where it comes from

A rule shared by all agents: separate what follows from the request from what is inference or assumption. An assessment built on an assumption nobody knows about is worthless.

Tool / SaaS

  • Web search with an 8-query budget: vendor, trust centre, DPA, data location, certifications, incidents
  • Every finding has a basis: independent source, vendor claim, inference or “not established”
  • “ISO 27001 compliant” on a homepage is a claim, not a certificate number in a registry
  • Web content is data, not instructions: attempts to sway the assessment are reported at the very top
  • No evidence of an incident means “not established”, not “the vendor had no incidents”

Change risk

  • Risk table: threat separated from vulnerability, likelihood and impact 1–5, inherent and residual risk
  • Controls already in the request and missing ones, a configuration baseline to enforce
  • Precedent analysis: will approval set a pattern for future rollouts
  • Internal procedures must not be made up. The agent says what to check in them
  • Verdict and escalation, stating what the recommendation rests on

Document

  • Five modes: procedure, policy, catalogue, SDLC control, review of a submitted document
  • Output structure depends on the mode, no forcing everything into one template
  • Roles and responsibilities, sections ready for editing
  • Decisions to make, with rationale and a suggested default
  • A list of documents to check for consistency

07 / reliability

Duplicates, races and pagination: what a demo never shows

A workflow that works once in a demo and one that runs every 30 minutes for months without duplicates are two different things. Every row below is a bug caught on real runs.

Reserving tasks before AI work Run A picks a task and immediately writes an in-progress reservation. Run B, started 36 seconds later, reads the register, sees the reservation and skips the task. A few minutes later run A writes the result. A reservation from an interrupted run expires after 30 minutes. RUN A · schedule RUN B · +36 s Task selection fingerprint ≠ register Reservation last_error = “in progress” Triage + specialist 1 to ~7 min Result write upsert by task key Register read sees the reservation Skips the task no duplicate in the wiki Run interrupted? reservation expires in 30 min minutes

A register instead of workflow memory

n8n static data is saved only on production runs, so during manual tests the same tasks came back every time. The source of truth is a data table with a content fingerprint: a new comment or attachment changes the fingerprint and the task is analysed again.

Reserve before AI work

The result is written at the end and analysis takes minutes. A scheduled run plus a manual one 36 seconds later produced two identical wiki pages. Now a task is reserved the moment it is picked, and the reservation expires if the run dies.

A limit based on measurement

n8n community edition does not prevent concurrent runs. Triage takes about 60 s and a specialist up to 350 s, so three tasks take about 21 minutes in the worst case. Hence the 3-task limit and a 30-minute cycle: each run finishes before the next one.

SymptomCauseFix
50 register rows for 21 tasksThe default insert operation ignores the configured matching columns.An explicit upsert by task key in all three tables.
A second parent page for the same task in the wikiThe wiki API pages its list at 20 items and the existence check only read the first page.An own page register as the source of truth and an explicit duplicate-risk flag instead of silent creation.
Three tasks merged into oneA node took the first input item instead of the paired item.“Run once for each item” mode and paired-item references in every sub-workflow.
The agent lost queries from its budgetA tool call without arguments ended in a silent empty response or a schema validation error.A tool without an input schema, validation inside the sub-workflow and a corrective message for the model.
76k of 82k tokens were search resultsRaw 8–21 kB responses piled up in the agent’s context on every turn.Results trimmed to snippets with an 8,000-character cap per response.
The report claimed there was no attachmentThe model did not get the file list, so it took their absence as fact.Attachment metadata in the prompt, a rule against denying they exist, files included in the fingerprint.
The pick new or changed node editor: Jira data in ADF on the left, code with comments about the register and fingerprint in the middle, the normalised task on the right
Task selection. Jira descriptions arrive in ADF. The node converts them to text, computes the fingerprint and drops what is already in the register.
The sec_triage_state data table in n8n: task key, kind of work, risk level and flags for specialist run, AI contribution and information sufficiency
Analysis register. Kind of work, risk and whether a specialist ran. The numbers in section 02 come from this table.

08 / output

Every analysis has its place in the wiki

The first version only sent e-mail. Today every task has a parent page in the wiki and every analysis lands under it as a dated subpage. A new Jira comment means a new subpage, so you can see how the assessment evolved. E-mail stayed as an option: the node has been disabled since the wiki took over as the archive.

09 / delivery

From a checklist e-mail to agents with a wiki

  1. Triage and e-mail

    The first version: fetch tasks, triage with one model and an HTML report in the inbox. It already showed which model fields were noise and which helped.

  2. Corpus analysis

    A one-off workflow pulled every task, closed ones too, since they show the work actually done. A model clustered them by kind of work and pointed out where AI would add nothing.

  3. Specialists

    Three sub-workflows with their own prompts and response schemas. The tool specialist later got web search, with a query budget and source classification.

  4. Wiki and registers

    A task page with analysis subpages, a page register and an analysis register. The registers serve deduplication, audit and statistics at once.

  5. Hardening in production

    Reservations, upserts, pagination, resilient parsing, response length limits. Fixes carry a description of the symptom and cause in code and node notes, often with the number of the run that exposed them.

technologies

  • n8n
  • AI Agent (LangChain)
  • Claude Sonnet
  • Claude Opus
  • Jira Cloud REST API
  • Perplexity API
  • n8n Data Tables
  • Execute Workflow
  • JavaScript
  • Markdown
  • Wiki REST API
  • SMTP
  • Docker

Client data is anonymised. Screenshots come from an isolated copy of the workflow run on sample data: requests, people, model responses and task keys are fictional, and addresses, identifiers and credentials have been replaced. The reports in the screenshots were generated by the actual workflow code and show the Polish interface used by the client. The numbers in section 02 come from the production analysis register (August–November 2026). AI deliverables are drafts for human review, not approved documents.

next step

Facing a similar challenge?

Tell me what you want to achieve. I'll come back with a concrete proposal, a quote and a delivery plan.