{
  "name": "Automate medical claims processing with GPT-4 multi-agent orchestration",
  "nodes": [
    {
      "id": "b56efdda-7050-4140-af52-e7c445e38458",
      "name": "Schedule Trigger - Process Claims",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2624,
        352
      ]
    },
    {
      "id": "9958a281-8536-4e51-b8b0-abfe07cf353d",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -2400,
        352
      ]
    },
    {
      "id": "37cbe18b-fcfe-4809-974b-3d1433dcc1c8",
      "name": "Simulate EHR/Billing Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -2176,
        352
      ]
    },
    {
      "id": "84799e9d-c6b5-4e2b-a0a6-81530828b298",
      "name": "Orchestrator Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1392,
        352
      ]
    },
    {
      "id": "b54c3ce7-b2d7-4323-99f7-6cb8b9fbc646",
      "name": "Coding Validation Agent Tool",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        -1824,
        576
      ]
    },
    {
      "id": "1f01c98c-bb9f-49bd-82a9-b8598443bb69",
      "name": "Claims Submission Agent Tool",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        -1536,
        576
      ]
    },
    {
      "id": "5653ede8-4243-48b1-9b5f-882b457551c2",
      "name": "Denial Detection Agent Tool",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        -1248,
        576
      ]
    },
    {
      "id": "feddb7dc-0893-4c21-a5d1-190361540fa9",
      "name": "Payer Follow-up Agent Tool",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        -960,
        576
      ]
    },
    {
      "id": "f897c624-ed2a-47c9-8ca2-f75f8664b8a9",
      "name": "Orchestrator Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -672,
        576
      ]
    },
    {
      "id": "459895d4-b572-4f35-a0c9-8402592c92f8",
      "name": "Coding Validation Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1696,
        784
      ]
    },
    {
      "id": "97352772-152b-4e3b-a246-1bf45c77e013",
      "name": "Claims Submission Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1392,
        848
      ]
    },
    {
      "id": "22f8e05f-11bb-470d-8dab-ffc7e5f51ff2",
      "name": "Denial Detection Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1088,
        784
      ]
    },
    {
      "id": "34980791-136b-4f5c-b102-aff74f9456c5",
      "name": "Payer Follow-up Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -768,
        800
      ]
    },
    {
      "id": "7ed45553-9b19-40f3-97f5-c87ddadeaf40",
      "name": "OpenAI Model - Orchestrator",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1952,
        576
      ]
    },
    {
      "id": "22a5c861-07fb-4879-9711-798994c7ac41",
      "name": "OpenAI Model - Coding Validation",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1872,
        784
      ]
    },
    {
      "id": "2fb10ed8-66e8-4105-9ef4-a048850c292e",
      "name": "OpenAI Model - Claims Submission",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1536,
        784
      ]
    },
    {
      "id": "8ea1f293-a484-42fc-aa4d-aba582694908",
      "name": "OpenAI Model - Denial Detection",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1232,
        848
      ]
    },
    {
      "id": "2ae98fa2-590e-4e61-9a7c-0b96b997d221",
      "name": "OpenAI Model - Payer Follow-up",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -928,
        784
      ]
    },
    {
      "id": "40e58e6f-cd48-44ba-b494-b25e028fc82d",
      "name": "Route by Risk Level",
      "type": "n8n-nodes-base.switch",
      "position": [
        -464,
        384
      ]
    },
    {
      "id": "11593528-0d32-4f54-84cd-dcb3dc670982",
      "name": "Check Compliance Flags",
      "type": "n8n-nodes-base.if",
      "position": [
        -160,
        416
      ]
    },
    {
      "id": "2a5e8833-a156-4166-8142-0c1f2ca1d8c3",
      "name": "Store Audit Trail",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        64,
        320
      ]
    },
    {
      "id": "2bb2b46a-0e2c-491d-bf19-6d5f2f857c3e",
      "name": "Store Claims Records",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        64,
        704
      ]
    },
    {
      "id": "c0f29359-20dc-4592-9aa7-b84a53526c91",
      "name": "Store Denial Records",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        64,
        896
      ]
    },
    {
      "id": "a3a5dc62-1a26-4aa9-b28e-030c9a1ba68d",
      "name": "Merge Results",
      "type": "n8n-nodes-base.merge",
      "position": [
        288,
        608
      ]
    },
    {
      "id": "7649abc8-9ec3-4dab-8b9a-7c014f403b5c",
      "name": "Escalate to Revenue Specialist",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        64,
        512
      ]
    },
    {
      "id": "fc909bcd-f61c-4c50-b907-796f1c2961b8",
      "name": "Format Final Report",
      "type": "n8n-nodes-base.set",
      "position": [
        736,
        608
      ]
    },
    {
      "id": "bc4b078c-b07b-4e5b-adc9-e54c51476b2d",
      "name": "Calculate Metrics",
      "type": "n8n-nodes-base.code",
      "position": [
        512,
        608
      ]
    },
    {
      "id": "e038b99b-d46c-4a90-bed2-f9fff64dc0bf",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1456,
        -224
      ],
      "parameters": {
        "width": 640,
        "height": 336,
        "content": "## Prerequisites\nn8n, OpenAI API key (GPT-4) and Gmail or SMTP account \n## Use Cases\nHospital billing departments automating claims submission and denial follow-up\n## Customization\nSwap OpenAI for NVI"
      }
    },
    {
      "id": "8c2b5738-bce1-405f-925b-26a25b8c63b1",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2016,
        -144
      ],
      "parameters": {
        "width": 480,
        "height": 272,
        "content": "## Setup Steps\n1. Import workflow JSON into your n8n instance.\n2. Add OpenAI API credentials.\n3. Configure Schedule Trigger with desired processing frequency. \n4. Update Workflow Configuration node wi"
      }
    },
    {
      "id": "c3fa2cd3-51bc-4eae-a771-42af7673068a",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2656,
        -144
      ],
      "parameters": {
        "width": 608,
        "height": 304,
        "content": "## How It Works\nThis workflow automates end-to-end medical claims processing using a multi-agent AI orchestration system built on OpenAI GPT-4. It targets healthcare revenue cycle teams, billing depar"
      }
    },
    {
      "id": "e8f51f8f-a695-45f3-966e-d066fc3ec2b7",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        192
      ],
      "parameters": {
        "width": 976,
        "height": 864,
        "content": "## Escalation & Reporting\n**What:** High-risk claims email Revenue Specialist; metrics calculated; final report generated.\n**Why:** Ensures human oversight on complex cases while automating routine ou"
      }
    },
    {
      "id": "23bd3e95-8ba6-46a2-bd6e-1e6af9162be0",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1968,
        208
      ],
      "parameters": {
        "width": 1424,
        "height": 864,
        "content": "## Orchestrator Agent\n**What:** Central AI agent delegates tasks to four specialist sub-agents.\n**Why:** Enables parallel, specialized processing—improving accuracy and speed."
      }
    },
    {
      "id": "bbff7e5e-d869-453f-922c-d9c79d754b46",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2672,
        224
      ],
      "parameters": {
        "width": 672,
        "height": 672,
        "content": "\n## Simulate Billing Data\n**What:** Generates or loads EHR/billing records for processing.\n**Why:** Provides structured claim input for downstream AI agents."
      }
    },
    {
      "id": "ba4b2fe5-3c2f-49d5-8598-dcae535a0126",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -512,
        192
      ],
      "parameters": {
        "width": 480,
        "height": 848,
        "content": "## Risk Routing & Storage\n**What:** Claims are routed by risk level; stored in Claims, Denial, or Audit records.\n**Why:** Prioritizes high-risk cases and maintains full compliance audit trails."
      }
    }
  ],
  "connections": {
    "Merge Results": {
      "main": [
        [
          {
            "node": "Calculate Metrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Metrics": {
      "main": [
        [
          {
            "node": "Format Final Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store Audit Trail": {
      "main": [
        [
          {
            "node": "Merge Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Orchestrator Agent": {
      "main": [
        [
          {
            "node": "Route by Risk Level",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Risk Level": {
      "main": [
        [
          {
            "node": "Check Compliance Flags",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Store Claims Records",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Store Denial Records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store Claims Records": {
      "main": [
        [
          {
            "node": "Merge Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store Denial Records": {
      "main": [
        [
          {
            "node": "Merge Results",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Check Compliance Flags": {
      "main": [
        [
          {
            "node": "Escalate to Revenue Specialist",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Store Audit Trail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Simulate EHR/Billing Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simulate EHR/Billing Data": {
      "main": [
        [
          {
            "node": "Orchestrator Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Orchestrator Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Orchestrator Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Payer Follow-up Agent Tool": {
      "ai_tool": [
        [
          {
            "node": "Orchestrator Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Denial Detection Agent Tool": {
      "ai_tool": [
        [
          {
            "node": "Orchestrator Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model - Orchestrator": {
      "ai_languageModel": [
        [
          {
            "node": "Orchestrator Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Claims Submission Agent Tool": {
      "ai_tool": [
        [
          {
            "node": "Orchestrator Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Coding Validation Agent Tool": {
      "ai_tool": [
        [
          {
            "node": "Orchestrator Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Payer Follow-up Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Payer Follow-up Agent Tool",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Denial Detection Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Denial Detection Agent Tool",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Escalate to Revenue Specialist": {
      "main": [
        [
          {
            "node": "Merge Results",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "OpenAI Model - Payer Follow-up": {
      "ai_languageModel": [
        [
          {
            "node": "Payer Follow-up Agent Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Claims Submission Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Claims Submission Agent Tool",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Coding Validation Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Coding Validation Agent Tool",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model - Denial Detection": {
      "ai_languageModel": [
        [
          {
            "node": "Denial Detection Agent Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model - Claims Submission": {
      "ai_languageModel": [
        [
          {
            "node": "Claims Submission Agent Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model - Coding Validation": {
      "ai_languageModel": [
        [
          {
            "node": "Coding Validation Agent Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger - Process Claims": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}