AxonFlow API integration for n8n. Call the AxonFlow policy and HITL endpoints directly from your n8n workflows.
This package contributes a single AxonFlow node with four operations against an AxonFlow Agent:
| Operation | Endpoint | When to use |
|---|---|---|
| Check Policy | POST /api/v1/mcp/check-input |
Before a workflow takes a sensitive action — receive {allowed, block_reason?} and branch on it. |
| Record Decision | POST /api/v1/audit/tool-call |
After a successful action — capture inputs, outputs, policies applied. |
| Audit Log | POST /api/v1/audit/tool-call |
From error branches — record the failed action with success: false and error_message. |
| Wait for Approval | POST /api/v1/hitl/queue |
When the workflow needs a human in the loop — creates an approval entry and pairs with an n8n Wait node for webhook resume. |
Plus a single AxonFlow API credential type holding the endpoint + Basic-auth (clientId + userToken).
- Settings > Community Nodes > Install.
- npm package name:
@axonflow/n8n-nodes-axonflow. - Restart n8n.
cd ~/.n8n/custom
npm install @axonflow/n8n-nodes-axonflow
# restart n8nn8n Cloud does not currently allow unverified community nodes. Use the stock-HTTP-node recipe on n8n Cloud until this package is verified.
Credentials > New > AxonFlow API.
| Field | Description |
|---|---|
| Endpoint | Base URL of your AxonFlow Agent. SaaS: https://try.getaxonflow.com. Self-hosted: typically port 8080. |
| Client ID | Your tenant identifier. |
| User Token | Sent as the password half of HTTP Basic auth. Stored encrypted in n8n. |
- Install the community node (see above).
- Create an AxonFlow API credential with your endpoint + Client ID + User Token.
- Add an AxonFlow node to your workflow.
- Pick an operation:
- Check Policy — submit a proposed action and branch on
allowed: true/false. - Record Decision — log the outcome of a downstream action.
- Audit Log — log a failed action from an error branch.
- Wait for Approval — create a HITL request and pair with a Wait node for webhook resume.
- Check Policy — submit a proposed action and branch on
- Run the workflow.
- Bearer Auth > Header Auth. This credential uses the Header Auth pattern (Authorization built inline) rather than n8n's built-in Bearer Auth class, which silently drops the header in some n8n versions (n8n#15261).
- Idempotency by default. Every operation sends
Idempotency-Key: {executionId}-{itemIndex}-{nodeName}so n8n'sRetry on Faildoesn't double-record. Override at the node parameter level if you need a domain-specific key. - HITL pairs with the Wait node.
Wait for Approvalcreates the AxonFlow approval entry; pair it with a downstream Wait node configured for On Webhook Call mode. As of platform v8.1.0+, pass the Wait node's webhook URL asnotify_urlin the HITL queue request and AxonFlow will POST to it automatically on approval/rejection — no polling sidecar needed. For self-hosted deployments on v8.0.x, two manual paths work: (a) run a small polling sidecar that watchesGET /api/v1/hitl/queue/{id}and POSTs to the Wait node's webhook URL when status changes, or (b) have a reviewer trigger the resume URL manually from the portal. See the n8n integration docs for details.
examples/governed-loan-workflow.json — an importable workflow that:
- Receives a loan request via HTTP trigger,
- Calls Check Policy on the amount,
- If
allowed=false, branches to Wait for Approval (workflow pauses), - On approval, calls the downstream loan-issuance HTTP endpoint,
- Records the outcome with Record Decision, with an error branch to Audit Log.
Import in n8n: Workflows > Import from File > governed-loan-workflow.json.
git clone https://github.com/getaxonflow/axonflow-n8n-node.git
cd axonflow-n8n-node
npm install
npm run build # tsc > dist/
npm run lint
npm test # node --test (25 tests)- n8n + AxonFlow Integration Guide — full walkthrough including the stock-HTTP-node recipe, HITL polling sidecar, and idempotency details.
- AxonFlow — main project site.
- AxonFlow on GitHub — community edition.
MIT