Task 15 of the ingestion restructure. Edited the live n8n workflow
(005iI4jX5mq9DsTR) directly via MCP and published the new version.
Repointed Watchdog: List Stuck, Watchdog: Reset Stuck Rows, Fetch Pending
Batches, Atomic Claim, Claim Successful?, Download File and Escalate
Failure from data_import_batches/status onto purchase_orders/
processing_status. Verified zero in-flight rows would be orphaned: all
26 old purchase_orders-type batches were already processed or failed,
and all 24 real PO rows had processing_status unset (won't match the new
pending filter).
Two things found on the live workflow that the plan didn't anticipate:
- Atomic Claim had no ?filter=processing_status="pending" guard at all --
an unconditional PATCH, despite the workflow's own name and this doc's
prior description both calling it "atomic". Added while repointing the
same node.
- Build Callback Payload sent the extracted PO number as `po_number`.
process-batch's validator requires the field named exactly
`purchase_order_number` -- the old field name would have failed
validation on every single real upload, a total silent outage. Fixed
before publishing, verified against the route's actual validateExtracted().
Also removed the n8n-side duplicate short-circuit: the old
Build Callback Payload queried purchase_orders and PATCHed the batch row
directly from n8n code to pre-empt process-batch's own dedup logic.
process-batch's merge branch (Task 14) already does this correctly,
server-side, tested. Keeping both meant the same decision made twice in
two places that could disagree. Is Duplicate? node removed; Build
Callback Payload connects straight to Send Callback.
Published as the active version and verified by reading the workflow
back in full -- every repointed node confirmed, connections confirmed,
zero validation warnings.
Rewrote docs/n8n/purchase-order-ingest-implementation.md end to end to
describe the deployed shape rather than the retired one. Flagged (not
fixed, separate decision) a plaintext PB superuser password baked into
the Auth PB Admin node.
Marked Tasks 1-15 complete in the plan's own checkboxes.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>