Workflow-Execution Tracer for an n8n Document Pipeline
An SMB accounting/fintech platform
Overview
A focused command-line utility that locates which n8n workflow execution processed a given document, by paging through the n8n REST API and matching on document_id, then reporting the last-executed node. It is the debugging companion to the platform’s document-processing automation.
Why It Exists
When a document fails or stalls in a multi-node OCR/classification pipeline, an operator needs to find the exact execution that handled it and see where it stopped. The n8n UI makes that tedious at scale, so a scriptable lookup was needed.
What We Built
A Node script (index.js) that calls the n8n executions API (/api/v1/executions?includeData=true) with cursor-based pagination, scans each execution payload for the target document_id passed as a CLI argument, and prints the matching execution ID and the name of the last node executed. A test.sh curl snippet exercises the platform’s document API for quick checks.
Technologies & Approach
Plain Node.js with axios and the authenticated n8n REST API, using recursive cursor pagination to walk the full execution history. Deliberately minimal, a single-purpose operational tool rather than a service.
Outcome / Impact
Gave engineers a fast way to trace a document’s path through the automation engine and pinpoint failures, shortening debugging cycles for the document pipeline.
Capabilities Demonstrated
- Building pragmatic operational/debugging tooling for production automation
- Working fluently with workflow-engine APIs and paginated data
- Turning a recurring manual investigation into a one-command lookup