# Agent workflow exports

> Analyse n8n, Flowise, Langflow and other agent workflow exports without running them; binaries and strings dumps have their own page.

Source: https://keryn.dev/docs/guides/workflows-and-binaries/

## Goal

Check an agent that is defined outside source code, in a workflow export from a platform such as n8n. You get findings, a gate and evidence files, like a scan, without running the workflow. (A compiled helper is checked on the [binary analysis](https://keryn.dev/docs/guides/binary-analysis/) page.)

## Before you start

- The Keryn CLI ([install](https://keryn.dev/docs/start/install/)). Or [Keryn Web](https://keryn.dev/docs/guides/web-app/): drop the file, or a folder or zip that contains it.
- An export from your workflow platform (JSON or YAML).
- Nothing is executed, fetched or sent. Keryn reads the file.

Risky combinations found in an export can be drawn and analysed as chains on the [Trust Canvas](https://keryn.dev/docs/guides/trust-canvas/).

## 1. Analyse a workflow export

Here is a small n8n export, written for this page: a webhook receives a ticket, an agent node asks a model, and the model's answer is run as a command before the result is posted to a URL.

```json
{
  "name": "Support triage",
  "nodes": [
    {"id": "1", "name": "Ticket webhook", "type": "n8n-nodes-base.webhook", "typeVersion": 1, "position": [0, 0], "parameters": {"path": "ticket", "httpMethod": "POST"}},
    {"id": "2", "name": "Ask model", "type": "@n8n/n8n-nodes-langchain.agent", "typeVersion": 1, "position": [200, 0], "parameters": {"text": "={{ $json.body.text }}"}},
    {"id": "3", "name": "Run command", "type": "n8n-nodes-base.executeCommand", "typeVersion": 1, "position": [400, 0], "parameters": {"command": "={{ $json.output }}"}},
    {"id": "4", "name": "Post result", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4, "position": [600, 0], "parameters": {"url": "https://hooks.example.invalid/result", "method": "POST"}}
  ],
  "connections": {
    "Ticket webhook": {"main": [[{"node": "Ask model", "type": "main", "index": 0}]]},
    "Ask model": {"main": [[{"node": "Run command", "type": "main", "index": 0}]]},
    "Run command": {"main": [[{"node": "Post result", "type": "main", "index": 0}]]}
  }
}
```

```sh
keryn workflow analyze flow.json --no-config
```

```text
n8n export (explicit_graph) · 4 nodes · 4 tools · 8 dangerous compositions · 1 external effects · approval coverage 0% · 2 findings
coverage: n8n export (explicit_graph): 4 nodes, 4 tools, 8 dangerous compositions, 1 external effects, approval coverage 0%; 2 findings from 28 analyzers; no rules executed.
result: FAIL (exit 1) - 2 violation(s)/finding(s) at or above 'error'
```

Keryn normalised the export into a workflow graph, whose edges are the links between steps, and ran its analysers over it: tool authority, approval boundaries, blast radius, dangerous compositions (risky combinations of steps on one path, such as code execution and an external send) and a threat model. The platform was detected from the export's shape; `keryn workflow platforms` lists the 18 it knows, and `--platform` forces one. The coverage line says what ran: the analysers, and **no rules**.

The two findings are the high-impact steps with no approval boundary. List them with their ids:

```sh
keryn workflow analyze flow.json --no-config --sarif - --quiet | jq -r '.runs[0].results[] | "\(.level)  \(.message.text)"'
```

```text
error  Code execution + network access (Ticket webhook, Ask model, Run command, Post result)
error  High-impact action path without enforced approval (Ticket webhook, Ask model, Run command, Post result)
```

The same weakness is reported once. A composition risk, an approval gap and the threat-model entry that restates them are folded into one finding, and the folded ids are kept as correlated evidence.

## 2. Keep the evidence files

```sh
keryn workflow analyze flow.json --no-config --evidence-dir evidence --quiet || true
ls evidence
```

```text
manifest.json
seceng-workflow-analysis.json
seceng-workflow-graph.mmd
seceng-workflow-report.md
seceng-workflow-risk-register.csv
seceng-workflow-threat-model.json
seceng-workflow-xyflow.json
workflow.sarif
```

`--evidence-dir` writes the Markdown report, a Mermaid diagram of the graph, a CSV risk register, the threat model, a graph file for diagram tools and SARIF. (File names keep the product's earlier prefix; the content is the analysis above.)

## 3. Binaries and strings dumps

A compiled helper, an MCP server binary or a strings dump is checked with `keryn artifact analyze`, which has its own page: [binary analysis](https://keryn.dev/docs/guides/binary-analysis/). It works the same way as the workflow command above: static, nothing executed, findings that gate. Neither command produces an AI-BOM. In [Keryn Web](https://keryn.dev/docs/guides/web-app/), both kinds of file found inside a scanned folder or zip are analysed automatically and join the result.

## What you just proved

An agent's authority is not only in its code. A workflow export is a graph of **calls and sends** with no source file. You checked it without running it, and you got the same kind of answer as for code: which steps can act without an approval, what they reach, and how much of that Keryn could see. The limits are the usual ones: this is a static reading of an export, and a clean result is not a statement that the workflow is safe.

## Next

- Compiled helpers and strings dumps: [binary analysis](https://keryn.dev/docs/guides/binary-analysis/).
- Draw the chain and find its chokepoint: [Trust Canvas](https://keryn.dev/docs/guides/trust-canvas/).
- Gate it in the pipeline: [CI](https://keryn.dev/docs/guides/ci/).
- Read a flow in a repository scan: [read an attack chain](https://keryn.dev/docs/guides/attack-chain/).
