Skip to main content
n8n workflows are best monitored via Muster’s HTTP webhook. The n8n scanner requires network access to your n8n instance and won’t work for locally-hosted setups.

Overview

Add a single HTTP Request node at the end of your n8n workflow. This sends quality signals to Muster after every execution.

Setup

1. Register the workflow in Muster

In your Muster dashboard → Add Agent:
  • Name: your workflow name (e.g. invoice-processing-n8n)
  • Framework: N8N
  • Owner email and department

2. Add an HTTP Request node

In your n8n workflow, add an HTTP Request node as the last step: Node settings:
SettingValue
MethodPOST
URLhttps://app.getmuster.io/api/v1/jobs/{{ $now.toMillis() }}/quality
AuthenticationNone
Send BodyEnabled
Body Content TypeJSON
JSON body:
{
  "agent_id": "invoice-processing-n8n",
  "job_id": "{{ $now.toMillis() }}",
  "overall_passed": true,
  "checks": [
    {
      "check_id": "output_not_empty",
      "severity": "HIGH",
      "passed": {{ $json.output ? true : false }}
    }
  ]
}

3. Handle errors

To report failures, use an Error Trigger node connected to a second HTTP Request node:
{
  "agent_id": "invoice-processing-n8n",
  "job_id": "{{ $now.toMillis() }}",
  "overall_passed": false,
  "checks": [
    {
      "check_id": "output_not_empty",
      "severity": "HIGH",
      "passed": false,
      "message": "{{ $json.message }}"
    }
  ]
}

Dynamic checks

For more detailed monitoring, build the checks array dynamically using n8n’s Code node before the HTTP Request:
// Code node
const output = $input.first().json;

const checks = [
  {
    check_id: "output_not_empty",
    severity: "HIGH",
    passed: !!output.result
  },
  {
    check_id: "required_fields_present",
    severity: "HIGH",
    passed: !!(output.vendor && output.total && output.date),
    expected: "vendor,total,date",
    actual: Object.keys(output).filter(k => ["vendor","total","date"].includes(k)).join(",")
  }
];

return [{
  json: {
    agent_id: "invoice-processing-n8n",
    job_id: $now.toMillis().toString(),
    overall_passed: checks.every(c => c.passed),
    checks
  }
}];
Then connect this node’s output to an HTTP Request node posting to Muster.

Tracking token usage

If your n8n workflow calls OpenAI or Anthropic, pass token counts to Muster for cost tracking:
{
  "agent_id": "invoice-processing-n8n",
  "job_id": "{{ $now.toMillis() }}",
  "overall_passed": true,
  "token_input": {{ $node["OpenAI"].data.usage.prompt_tokens }},
  "token_output": {{ $node["OpenAI"].data.usage.completion_tokens }},
  "model": "gpt-4o",
  "checks": []
}