AutomationFlowsAI & RAG › Convert Legal Timesheets to Ledes and PDF Invoices

Convert Legal Timesheets to Ledes and PDF Invoices

ByAI Solutions @legalgpts on n8n.io

This template is built for solo attorneys, small law firms, and legal billing coordinators who receive timesheet documents by email and need to produce LEDES-compliant e-billing files for client billing management systems. If you have an IMAP inbox, an OpenAI API key, a…

Manual trigger★★★★★ complexityAI-powered34 nodesEmail Read ImapMicrosoft ExcelN8N Nodes Word2TextOpenAI ChatAgentHTTP RequestMicrosoft Outlook
AI & RAG Trigger: Manual Nodes: 34 Complexity: ★★★★★ AI nodes: yes Added:

This workflow corresponds to n8n.io template #15121 — we link there as the canonical source.

This workflow follows the Agent → HTTP Request recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "7EhhaujkqeXOwi2u",
  "name": "LEDEs Conversion",
  "tags": [
    {
      "id": "ZXSeAHpp4ECBJHKC",
      "name": "Compliance",
      "createdAt": "2026-03-22T19:22:00.160Z",
      "updatedAt": "2026-03-22T19:22:00.160Z"
    },
    {
      "id": "PGrd4SU7B9p4E6Gv",
      "name": "LEDES",
      "createdAt": "2025-10-17T20:01:22.807Z",
      "updatedAt": "2026-03-22T18:23:39.776Z"
    },
    {
      "id": "p0LGic5RoJQcPi4H",
      "name": "Invoice",
      "createdAt": "2025-10-17T20:01:22.807Z",
      "updatedAt": "2026-03-22T18:23:21.223Z"
    },
    {
      "id": "p7d66niWAG5ijZY7",
      "name": "AI",
      "createdAt": "2025-10-19T20:35:12.051Z",
      "updatedAt": "2026-03-22T18:22:29.537Z"
    },
    {
      "id": "v0qdZQrIENz1TXgD",
      "name": "PDF",
      "createdAt": "2025-08-09T22:56:54.358Z",
      "updatedAt": "2025-08-09T22:56:54.358Z"
    },
    {
      "id": "5cE6I3gcKGby5iar",
      "name": "Email",
      "createdAt": "2025-06-14T22:02:16.737Z",
      "updatedAt": "2025-06-14T22:02:16.737Z"
    },
    {
      "id": "vHVvr905dk6aqmKq",
      "name": "Template",
      "createdAt": "2025-05-16T19:05:27.035Z",
      "updatedAt": "2025-05-16T19:05:27.035Z"
    }
  ],
  "nodes": [
    {
      "id": "8ed4df23-ec3c-4e02-b560-dd5148a8018c",
      "name": "Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -224,
        -240
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "f99e08b7-55fd-4ffa-8104-5536d03e2e9e",
      "name": "Sticky \u2014 Trigger",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        304,
        -240
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "d6f97374-c4e0-4071-a61a-32c3a18d1bd2",
      "name": "Sticky \u2014 Classify",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        688,
        -240
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "7558d79a-e17b-4ed2-8a08-d006fb414374",
      "name": "Sticky \u2014 AI Extraction",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1136,
        -240
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "b6cb14c8-1369-40fc-a35c-2fd728c693b3",
      "name": "Sticky \u2014 Generate",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2096,
        -240
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "69fe0530-fde2-4be3-bbdc-4b687ef46633",
      "name": "Sticky \u2014 Deliver",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2720,
        -240
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "f602fe93-691e-4bb6-9d4d-0807d2748bdb",
      "name": "Sticky \u2014 Warning",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        368
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "e30280cf-0afe-48f9-a3bc-7f3fa0a96c69",
      "name": "IMAP \u2014 Watch Inbox",
      "type": "n8n-nodes-base.emailReadImap",
      "position": [
        352,
        -96
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "3a6da29a-8bb8-493a-991e-6e118fb4d899",
      "name": "Classify Attachment",
      "type": "n8n-nodes-base.code",
      "position": [
        528,
        -96
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "caf4a624-fcac-4e31-ae3d-b0a9bcc81e86",
      "name": "If PDF",
      "type": "n8n-nodes-base.if",
      "position": [
        736,
        -96
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "2f18da78-91da-40e4-92b6-e9cc090c4fe1",
      "name": "If Word",
      "type": "n8n-nodes-base.if",
      "position": [
        736,
        64
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9c395fa0-bf43-4143-9986-23dff089498d",
      "name": "Excel \u2014 Read Invoice Numbers",
      "type": "n8n-nodes-base.microsoftExcel",
      "position": [
        736,
        208
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "1d15a7fa-57e6-4af8-86d4-109d821b44de",
      "name": "Extract \u2014 PDF Text",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        960,
        -96
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "1abe8dcb-aa42-4b07-8b53-8066898196f8",
      "name": "Extract \u2014 Word Text",
      "type": "n8n-nodes-word2text.word2text",
      "position": [
        960,
        64
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "e939b38a-9322-41b4-901c-6a54cc9875b5",
      "name": "Get Next Invoice Number",
      "type": "n8n-nodes-base.code",
      "position": [
        960,
        208
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "b288712e-bbe7-4df0-bd0d-5bcca9f278d9",
      "name": "LLM \u2014 GPT-4o (Time Entries)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1168,
        80
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "2a65c5ec-4c1d-404c-8e3a-9d8cbb50c447",
      "name": "AI Agent \u2014 Extract Time Entries",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1200,
        -96
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "9043e254-fddc-4032-977a-5223b373b0a7",
      "name": "Parse Time Entry Output",
      "type": "n8n-nodes-base.code",
      "position": [
        1488,
        -96
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "0cca8e75-aa97-41da-858c-5e2a663a166a",
      "name": "LLM \u2014 GPT-4o-mini (Sender Info)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1648,
        96
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "94b2deca-dcf1-444b-800f-b44417bea32c",
      "name": "AI Agent \u2014 Extract Sender Info",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1664,
        -96
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "feca749a-9d9d-418f-a783-eae8ff3ff49e",
      "name": "Merge Sender Info",
      "type": "n8n-nodes-base.code",
      "position": [
        1952,
        -96
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "e0e2e352-de49-4f1f-a4fa-741ef8924fe8",
      "name": "Merge \u2014 Time Entries + Invoice Number",
      "type": "n8n-nodes-base.merge",
      "position": [
        2144,
        16
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "71a03cf3-c445-4c08-a3de-3cc4eeb487f9",
      "name": "Generate \u2014 LEDES 1998B",
      "type": "n8n-nodes-base.code",
      "position": [
        2336,
        -112
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "0bac72a7-fd61-4135-b6c6-2bd570000fe8",
      "name": "Generate \u2014 LEDES XML 2.0",
      "type": "n8n-nodes-base.code",
      "position": [
        2336,
        80
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "235e1a37-a6e0-470c-8b6e-aa4878073370",
      "name": "Generate \u2014 Invoice HTML",
      "type": "n8n-nodes-base.code",
      "position": [
        2336,
        256
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "bc22d73a-e6ea-4697-b147-a4191ecf2d7d",
      "name": "Prep Excel Rows",
      "type": "n8n-nodes-base.code",
      "position": [
        2336,
        448
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "8a1631b1-2816-4e5a-896d-1557d45ddd8e",
      "name": "Create \u2014 LEDES 1998B File",
      "type": "n8n-nodes-base.code",
      "position": [
        2528,
        -112
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "5da7be39-82ff-4c8d-9ca5-c4f639d747a3",
      "name": "Create \u2014 LEDES XML File",
      "type": "n8n-nodes-base.code",
      "position": [
        2528,
        80
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "2c5d9adc-3b8d-43e4-9bca-eaccfeba544d",
      "name": "Convert HTML to PDF",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2560,
        256
      ],
      "parameters": {},
      "typeVersion": 4.4
    },
    {
      "id": "d614b047-8a54-46f1-abd9-46da3b49ad76",
      "name": "Excel \u2014 Append Time Entries",
      "type": "n8n-nodes-base.microsoftExcel",
      "position": [
        2784,
        352
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "f23961ff-921d-4cc9-a4bc-ba9ac635da6f",
      "name": "Merge \u2014 LEDES 1998B + XML",
      "type": "n8n-nodes-base.merge",
      "position": [
        2784,
        0
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "b3b20f5b-c23e-426c-8dd4-f22ddc861271",
      "name": "Merge \u2014 All Files",
      "type": "n8n-nodes-base.merge",
      "position": [
        2928,
        176
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "c62beab3-35ed-4f7a-a657-e59b2299b8ab",
      "name": "Excel \u2014 Append Invoice Number",
      "type": "n8n-nodes-base.microsoftExcel",
      "position": [
        3072,
        352
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "7ebac533-f6ef-44a5-a97c-0b391b906707",
      "name": "Send a message",
      "type": "n8n-nodes-base.microsoftOutlook",
      "position": [
        3088,
        176
      ],
      "parameters": {},
      "typeVersion": 2
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "1ea2ae08-5233-450e-a072-a4c407a5f19b",
  "connections": {
    "If PDF": {
      "main": [
        [
          {
            "node": "Extract \u2014 PDF Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Word": {
      "main": [
        [
          {
            "node": "Extract \u2014 Word Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prep Excel Rows": {
      "main": [
        [
          {
            "node": "Excel \u2014 Append Time Entries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Sender Info": {
      "main": [
        [
          {
            "node": "Merge \u2014 Time Entries + Invoice Number",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classify Attachment": {
      "main": [
        [
          {
            "node": "If PDF",
            "type": "main",
            "index": 0
          },
          {
            "node": "If Word",
            "type": "main",
            "index": 0
          },
          {
            "node": "Excel \u2014 Read Invoice Numbers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert HTML to PDF": {
      "main": [
        [
          {
            "node": "Merge \u2014 All Files",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge \u2014 All Files": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract \u2014 PDF Text": {
      "main": [
        [
          {
            "node": "AI Agent \u2014 Extract Time Entries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IMAP \u2014 Watch Inbox": {
      "main": [
        [
          {
            "node": "Classify Attachment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract \u2014 Word Text": {
      "main": [
        [
          {
            "node": "AI Agent \u2014 Extract Time Entries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Next Invoice Number": {
      "main": [
        [
          {
            "node": "Merge \u2014 Time Entries + Invoice Number",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Parse Time Entry Output": {
      "main": [
        [
          {
            "node": "AI Agent \u2014 Extract Sender Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate \u2014 LEDES 1998B": {
      "main": [
        [
          {
            "node": "Create \u2014 LEDES 1998B File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create \u2014 LEDES XML File": {
      "main": [
        [
          {
            "node": "Merge \u2014 LEDES 1998B + XML",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Generate \u2014 Invoice HTML": {
      "main": [
        [
          {
            "node": "Convert HTML to PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate \u2014 LEDES XML 2.0": {
      "main": [
        [
          {
            "node": "Create \u2014 LEDES XML File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create \u2014 LEDES 1998B File": {
      "main": [
        [
          {
            "node": "Merge \u2014 LEDES 1998B + XML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge \u2014 LEDES 1998B + XML": {
      "main": [
        [
          {
            "node": "Merge \u2014 All Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Excel \u2014 Append Time Entries": {
      "main": [
        [
          {
            "node": "Excel \u2014 Append Invoice Number",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LLM \u2014 GPT-4o (Time Entries)": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent \u2014 Extract Time Entries",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Excel \u2014 Read Invoice Numbers": {
      "main": [
        [
          {
            "node": "Get Next Invoice Number",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent \u2014 Extract Sender Info": {
      "main": [
        [
          {
            "node": "Merge Sender Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent \u2014 Extract Time Entries": {
      "main": [
        [
          {
            "node": "Parse Time Entry Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LLM \u2014 GPT-4o-mini (Sender Info)": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent \u2014 Extract Sender Info",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Merge \u2014 Time Entries + Invoice Number": {
      "main": [
        [
          {
            "node": "Generate \u2014 LEDES 1998B",
            "type": "main",
            "index": 0
          },
          {
            "node": "Generate \u2014 LEDES XML 2.0",
            "type": "main",
            "index": 0
          },
          {
            "node": "Generate \u2014 Invoice HTML",
            "type": "main",
            "index": 0
          },
          {
            "node": "Prep Excel Rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This template is built for solo attorneys, small law firms, and legal billing coordinators who receive timesheet documents by email and need to produce LEDES-compliant e-billing files for client billing management systems. If you have an IMAP inbox, an OpenAI API key, a…

Source: https://n8n.io/workflows/15121/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

K&S-Media Downloadliste SQL. Uses httpRequest, agent, googleSheets, lmChatOpenAi. Event-driven trigger; 97 nodes.

HTTP Request, Agent, Google Sheets +3
AI & RAG

Automate Microsoft Teams Meeting Analysis with GPT-4.1, Outlook & Mem.ai Watch the YouTube video to get started Follow along with the blog post

Postgres, OpenAI Chat, HTTP Request +3
AI & RAG

Send one WhatsApp message → Get AI-optimized content across 7+ social platforms.

Output Parser Structured, Google Gemini Chat, OpenAI Chat +8
AI & RAG

Marketing, growth, and automation teams that need to ship polished bilingual newsletters—complete with images, optional video, and multi-channel distribution—without writing a line of code. A Webhook

Agent, Microsoft SharePoint, HTTP Request +4
AI & RAG

JoinDAn8n. Uses httpRequest, dataTable, emailReadImap, lmChatOpenAi. Webhook trigger; 37 nodes.

HTTP Request, Data Table, Email Read Imap +6