Partial Failures Between n8n and PostgreSQL

Hello I have an n8n workflow that updates PostgreSQL and then calls an external API. The difficult part is when one step succeeds and the next one fails.
If PostgreSQL updates successfully but the API call times out, the workflow can be left in an uncertain state. Retrying the entire workflow could also create duplicate side effects.
I’m thinking about using statuses such as pending, processing, completed, and failed, along with an idempotency key.
My questions are:
How would you design the workflow so it can safely resume after a failure?Would you use a PostgreSQL transaction, an outbox table, or a separate recovery workflow?
What should happen when the API succeeds but n8n crashes before saving the result?
At what point would you move a job to a dead-letter state?
I’m looking for a practical pattern for making multi-step n8n workflows recoverable without relying on manual intervention.

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hello @Peter_Gavin I would make the workflow state driven and idempotent, rather than trying to wrap the whole process in one large transaction.

For example:pending
↓
processing
↓
API Call
↓
completed

Store an idempotency key for each operation so a retry can safely determine whether the API call was already made.

For PostgreSQL, I’d use a unique constraint:

INSERT INTO orders (order_id, status)
VALUES ($1, ‘processing’)
ON CONFLICT (order_id) DO NOTHING;

If the API times out, the recovery workflow can check the API using that same idempotency key before sending the request again.

For more complex workflows, I’d also consider an outbox table so database changes and pending external actions are recorded reliably.

The pattern that survives production here is: make the side effect claimable before it happens, and never let “unknown” collapse into “failed”.

Order of writes matters more than the transaction. A PostgreSQL transaction can’t cover the external API, so don’t try to make it. Instead write the intent before the call and the outcome after:

-- before the API call
UPDATE jobs SET status='processing', attempt=attempt+1, claimed_at=NOW()
WHERE id=$1 AND status IN ('pending','failed')
RETURNING id;

If that returns no row, someone else owns it — stop. That single conditional update is your idempotency key and your lock in one statement, and it’s atomic without an explicit transaction.

“API succeeded but n8n crashed before saving” is the case everything hinges on. The rule I’d hold to: because you wrote processing before the call, a row still sitting in processing means the API may have run. That is not the same as failed, and it must never be auto-retried. Give it its own terminal state:

UPDATE jobs SET status='unknown'
WHERE status='processing' AND claimed_at < NOW() - INTERVAL '15 minutes';

unknown is resolved by reading the provider, not by retrying — query their API for your idempotency key and settle to completed or failed from their answer. If you collapse unknown into failed and retry, you will double-charge someone eventually. This is the single most expensive mistake in this design, and it’s silent.

Outbox vs recovery workflow: outbox if the API call can be derived entirely from DB state (then a separate worker drains it and crashes are free). A recovery workflow is simpler and fine if the job payload is self-contained — sweep processing older than your lease, move to unknown, resolve against the provider.

Dead-letter: on attempt N (3 is reasonable) with a definite failure. Never dead-letter from unknown — that’s how a successful payment gets marked dead. And make sure the DLQ is visible; a dead-letter nobody looks at is the same as a silent branch.

One practical note: send the idempotency key to the external API too, if it supports one. Then even a retry you didn’t intend is safe at their end rather than only at yours.

@Peter_Gavin Emmas and Jarvis1 have already covered the important part (write the intent to the DB be4 the call, keep “unknown” as its own state, resolve it by asking the provider). What was missing for me was how you actually wire that up in n8n, which node settings matter & what happens when n8n itself dies mid call. So I built it and tried to break it. have n8n 2.38.7 in docker, Postgres 16, plus a tiny fake payment API where I can make a request timeout, get declined, or kill n8n while the call is in flight.

The short answer is that u don’t need n8n to “resume” anything. 2 scheduled workflows and 1 table. The table is your outbox and every tick jst asks the DB what is still owed.

The table

CREATE TABLE jobs (
  id         bigserial PRIMARY KEY,
  order_id   text NOT NULL UNIQUE,   -- business key = idempotency key
  amount     integer NOT NULL,
  status     text NOT NULL DEFAULT 'pending'
             CHECK (status IN ('pending','processing','completed','failed','unknown','review','dead')),
  attempt    integer NOT NULL DEFAULT 0,   -- charge attempts
  reconcile_attempt integer NOT NULL DEFAULT 0,   -- times we asked the provider about an unknown row
  claimed_at timestamptz,
  charge_id  text,
  last_error text,
  updated_at timestamptz NOT NULL DEFAULT now()
);

Whatever triggers ur flow today (webhook, form, another workflow) should only INSERT a pending row and stop. It should not call the API. Once the side effect is driven by a row in Postgres instead of by an execution that happens to be running, recovery becomes boring, which is what you want.

Workflow 1: charge jobs (Schedule Trigger, every minute)

Schedule Trigger → Postgres (claim) → Filter → HTTP Request (charge) → IF (2xx?) → Postgres (completed / failure), plus a Postgres node on the error output of the HTTP Request

Postgres, Execute Query, “Claim up to 10 jobs”. Same idea as Jarvis1’s conditional update, just batched:

UPDATE jobs j
SET    status = 'processing', attempt = attempt + 1,
       claimed_at = now(), updated_at = now()
FROM  (SELECT id FROM jobs
       WHERE  status IN ('pending', 'failed')
       ORDER  BY id
       FOR UPDATE SKIP LOCKED
       LIMIT  10) c
WHERE  j.id = c.id
RETURNING j.id, j.order_id, j.amount, j.attempt;

FOR UPDATE SKIP LOCKED means 2 overlapping executions (or 2 workers in queue mode) can’t grab the same row. No explicit transaction needed, a single UPDATE is atomic anyway.

Filter, “Skip if nothing was claimed”, condition {{ $json.order_id }} exists. Easy to miss: when the query above matches no rows the Postgres node does not output zero items, it outputs one item { "success": true }. Without the Filter the HTTP Request runs with an undefined order_id on every idle tick. I only noticed because my first version did exactly that and my fake API got a charge with order_id null. With the Filter in place an idle tick looks like this, claim outputs the success item, Filter keeps nothing, HTTP node never runs:

HTTP Request, “POST /charge”. Four settings do the real work here:

  • Header Idempotency-Key: {{ $json.order_id }}, so a retry is also safe on their side if they support it.
  • Options > Timeout = 5000 ms. Set it explicitly so “uncertain” has a known upper bound you can size the recovery lease against. (HTTP Request node docs, Timeout)
  • Options > Response > Never Error = on and Include Response Headers and Status = on. Every HTTP response, 200 or 502, now comes out of the Success output as an item with statusCode and body. The Error output is left with only the cases where there was no HTTP response at all (timeout, reset, DNS). (Response options)
  • Settings tab > On Error = Continue (using error output), and Retry On Fail = off.

“Continue (using error output)” gives the node a second output with the error attached to the item, so the transport failures get recorded in the same execution instead of stopping it. (node settings docs) Why split it this way: the error item only carries message, name and stack, no status code, so anything you classify from it is string matching. The full response on the Success output gives you a real status code and a parsed body to decide on.

About Retry On Fail being off: it retries on a timeout as well, and a timeout is exactly the case where the provider may already have done the work. I checked this with a separate little workflow (Retry On Fail on, 3 s timeout, provider that answers after 20 s). The provider counted two requests for one item. The second one was only harmless because my fake provider honours the idempotency key. Without that it’s a second charge. And even when it is safe, the retry happens inside n8n where your table can’t see it. I’d rather keep retries in the table (failed rows get re-claimed on the next tick) so they are counted and visible.

IF, “2xx?” on {{ $json.statusCode }} between 200 and 299.

Postgres, “Mark completed” on the true branch:

UPDATE jobs
SET    status = 'completed', charge_id = $2, updated_at = now()
WHERE  order_id = $1 AND status = 'processing'
RETURNING order_id, status, attempt, charge_id;

Query Parameters: {{ [ $('Claim up to 10 jobs').item.json.order_id, $json.body.charge_id ] }}

Postgres, “Record failure” on the false branch. The provider answered, but not 2xx. The default is unknown. Only a response that the provider documents as “nothing happened” is allowed to reach the attempt-limit / failed / dead logic:

UPDATE jobs
SET    status = CASE
         WHEN NOT $2::boolean THEN 'unknown'   -- 5xx, 502 html page, empty body, anything unfamiliar
         WHEN attempt >= 3    THEN 'dead'      -- definite failure, out of attempts
         ELSE                      'failed'    -- definite failure, re-claimed next tick
       END,
       last_error = $3, updated_at = now()
WHERE  order_id = $1 AND status = 'processing'
RETURNING order_id, status, attempt, last_error;

Query Parameters:

{{ [ $('Claim up to 10 jobs').item.json.order_id,
     [402, 400, 422].includes($json.statusCode) && ['card_declined','insufficient_funds','invalid_request'].includes($json.body?.error),
     `${$json.statusCode} ${typeof $json.body === 'object' ? JSON.stringify($json.body) : String($json.body ?? '').slice(0,200)}` ] }}

The whitelist in the second parameter is the one bit you write from your provider’s docs, and it is the only way to failed. Everything that is not on it, a 502 from a gateway, a bare 504, a 500 with an empty body, a new error code they added last week, stays unknown and gets resolved by workflow 2 asking the provider. (My first version had this backwards: a regex that recognised timeouts and treated everything else as definite. @DovahkiinMOL pointed out below that an unfamiliar error would then fall through to failed, which contradicts the whole point. He is right, and the fix is the inverted default above, not a longer regex.)

Postgres, “No response → unknown” on the Error output. Nothing to classify here, the provider may have done the work:

UPDATE jobs
SET    status = 'unknown', last_error = $2, updated_at = now()
WHERE  order_id = $1 AND status = 'processing'
RETURNING order_id, status, attempt, last_error;

Query Parameters: {{ [ $('Claim up to 10 jobs').item.json.order_id, String($json.error?.message ?? 'no response') ] }}

(Docs for the $1, $2 placeholders: Postgres node, query parameters. Passing them as a single array expression worked for me on Postgres node v2.6 and avoids the problem of an error message that contains commas.)

One tick with five orders set up to hit every path: a good one, a structured 402 decline, a 502 html page, a 500 with an empty body, and one where the provider takes 20 s to answer:

    order_id    |  status   | attempt |  charge_id  |  last_error
----------------+-----------+---------+-------------+------------------------------------------------
 ord-4001       | completed |       1 | ch_90361165 |
 ord-4002-fail  | failed    |       1 |             | 402 {"error":"card_declined","message":"Your card was declined."}
 ord-4003-502   | unknown   |       1 |             | 502
 ord-4004-empty | unknown   |       1 |             | 500
 ord-4005-slow  | unknown   |       1 |             | timeout of 5000ms exceeded

Only the documented decline reached failed. And on the provider side for the timed-out one, the charge exists, n8n just never got the response:

GET /charges?idempotency_key=ord-4005-slow
{"found": true, ...}

If that row had been marked failed and retried, that’s your double charge.

Workflow 2: reconcile unknown jobs (Schedule Trigger, every 5 minutes)

Schedule Trigger → Postgres (sweep + list) → Filter → HTTP Request (GET by idempotency key) → IF → Postgres (settle), plus a Postgres node on the error output of the GET

Postgres, “Sweep stale processing to unknown”. Three things in one statement: stale processing rows become unknown, rows that have been unknown too long become review (a human’s problem, see below), and everything else that is unknown gets asked about and counted:

WITH swept AS (
  UPDATE jobs SET status = 'unknown', updated_at = now()
  WHERE  status = 'processing' AND claimed_at < now() - interval '5 minutes'
  RETURNING id
),
aged AS (
  UPDATE jobs SET status = 'review', updated_at = now()
  WHERE  status = 'unknown'
    AND (updated_at < now() - interval '24 hours' OR reconcile_attempt >= 288)
  RETURNING id
),
asked AS (
  UPDATE jobs SET reconcile_attempt = reconcile_attempt + 1
  WHERE  status = 'unknown'
    AND NOT (updated_at < now() - interval '24 hours' OR reconcile_attempt >= 288)
  RETURNING id, order_id, amount, attempt, reconcile_attempt
)
SELECT id, order_id, amount, attempt, reconcile_attempt FROM asked
UNION ALL
SELECT j.id, j.order_id, j.amount, j.attempt, j.reconcile_attempt
FROM   jobs j WHERE j.id IN (SELECT id FROM swept)
ORDER  BY id;

The 5 minute lease has to be comfortably longer than the HTTP timeout in workflow 1, otherwise you sweep a row that is still genuinely in flight. 288 is just 24 hours of 5 minute ticks. The aged and asked conditions are complements of each other on purpose, Postgres does not support updating the same row from two CTEs in one statement. updated_at is only written when a row changes state, never by the “ask the provider” step, so it doubles as the “unknown since” clock. Same Filter on order_id after this node, same reason as before.

HTTP Request, “GET /charges?idempotency_key=” with Options > Response > Never Error turned on, so a 404 (“we have nothing for that key”) is data and not an exception. (HTTP Request node docs, Response options) Never Error only covers response codes though. A timeout or a dropped connection has no code and still throws, and with the default On Error = Stop Workflow one unreachable provider ends the tick and the rest of the batch waits. So this node also gets Settings > On Error = Continue (using error output), and the error output goes to a small Postgres node that leaves the row where it is:

-- error output of the GET: provider could not answer. Stay unknown, note why,
-- and do NOT touch updated_at, the 24h clock keeps running.
UPDATE jobs SET last_error = $2
WHERE  order_id = $1 AND status = 'unknown';

IF, “Provider has it?” on {{ $json.found }} (or whatever your provider returns), then:

-- true: it succeeded, we just never heard
UPDATE jobs SET status = 'completed', charge_id = $2, last_error = NULL, updated_at = now()
WHERE order_id = $1 AND status = 'unknown';

-- false: that attempt definitely did not happen. Now it is safe to count it.
UPDATE jobs SET status = CASE WHEN attempt >= 3 THEN 'dead' ELSE 'failed' END, updated_at = now()
WHERE order_id = $1 AND status = 'unknown';

The crash test (API succeeds but n8n dies before saving)

With workflow 1 published I added a slow order and ran docker kill on the n8n container about 1.5 s after the row went to processing, so while the request was in flight.

After the restart n8n shows this:

The executions list shows it as an error (status crashed if you look at it through the API) and the node panel literally says the data was not saved. So n8n has no idea whether the call returned. One warning here: don’t reach for the Retry button on that execution. I tried it. It runs from the trigger again, the claim finds nothing because the stranded rows are processing, the execution goes green and nothing is recovered. Only the sweep in workflow 2 brings those rows back. Meanwhile the provider had this:

GET /charges?idempotency_key=ord-1004-slow
{"found": true, "charge_id": "ch_69032535", ...}

and both rows from that execution were stuck in processing:

   order_id    |   status   | attempt |          claimed_at
---------------+------------+---------+-------------------------------
 ord-1002-fail | processing |       2 | 2026-09-13 13:55:38
 ord-1004-slow | processing |       1 | 2026-09-13 13:55:38

Workflow 1 kept running every minute after that (you can see the ticks in the sidebar of the screenshots) and never touched those two rows, because processing is not claimable. So a crash can’t cause a double charge no matter how long recovery takes. Once the lease expired, workflow 2 settled both based on what the provider said, not on a guess:

   order_id    |  status   | attempt |  charge_id
---------------+-----------+---------+-------------
 ord-1002-fail | failed    |       2 |               (provider had nothing, re-claimed next tick)
 ord-1004-slow | completed |       1 | ch_69032535   (provider had it, n8n just never saw the response)

Two ticks of workflow 1 later the declined order hit attempt 3 and went to dead:

 ord-1002-fail | dead      |       3 |

So, to your questions

How to resume safely: don’t resume the execution, re-derive the work from the table. A schedule that claims pending/failed rows is a “resume” that works after a node error, a timeout, a crash or a redeploy and needs nothing from n8n’s execution history.

Transaction vs outbox vs recovery workflow: the table above is the outbox, workflow 1 drains it, workflow 2 is the recovery workflow. A Postgres transaction only helps for the pure DB part. The Postgres node does have a Query Batching > Transaction option if you have several statements that must succeed together (docs), but it can’t cover the HTTP call, so don’t try to make it.

API succeeded but n8n crashed before saving: the row is still processing with a claimed_at. Nothing retries it. After the lease it becomes unknown and only the provider’s answer moves it to completed or failed. That is the test above.

Dead letter: on a definite failure at attempt N (I used 3), decided in SQL where the attempt counter lives. Never from unknown, in the crash test that would have dead-lettered a charge that actually went through. Unknown gets its own exit instead: if the provider has not been able to answer for 24 hours the row goes to review. dead is the machine saying it definitely failed, review is the machine saying it could not find out, and that one might be money, so they need separate alerts. A third tiny workflow doing SELECT status, count(*) FROM jobs WHERE status IN ('dead','review') GROUP BY status and posting to Slack is enough. For real node errors (bad credentials, Postgres down) set an Error Workflow on both workflows so you at least hear about it (docs).

Happy to paste the two workflow JSONs if that helps, they are 8 nodes each and you’d only need to swap the Postgres credential and the two URLs.

Edit 14 Sep: added the review state, the error output on the reconcile GET and the Retry warning after @Anshul_Namdev’s review below. The test run for those changes is in my follow up post.
Edit 14 Sep, later: inverted the failure classification in workflow 1 (unknown by default, failed only on a documented provider response) after @DovahkiinMOL’s review below.

Three gaps in the design above, all of them the quiet kind.

The Retry button will not rescue a crashed run of workflow 1. Retry re-runs the claim, and the claim only matches pending and failed, so it picks up a fresh batch while the rows the crash stranded sit in processing untouched. The execution goes green and nothing was recovered. Only the sweep recovers those rows. Worth saying out loud, because a crashed execution in the list is exactly what makes someone reach for Retry.

Never Error on the reconcile GET only covers response codes. The docs describe it as returning success regardless of the code returned, so a 404 becomes data as intended, but a timeout or a dropped connection produces no code at all and still throws. Workflow 2 has no error output, so one unreachable provider ends that tick and abandons the rest of the batch. Give that node Continue (using error output) as well and leave the row in unknown on the error branch.

unknown has no way out. Workflow 2 resolves it from the provider’s answer, which is right, but if the provider cannot answer, because the key predates their retention or their lookup is down for a day, the row circles every five minutes forever and nobody is told. Give reconciliation its own counter and an age cap:
UPDATE jobs SET status = 'review' WHERE status = 'unknown' AND updated_at < now() - interval '24 hours';
review is the one state that means a human. dead is the machine saying it definitely failed, review is the machine saying it cannot find out. Those need different queues and different alerts, and collapsing them puts an unresolved possible charge in the same bucket as a declined card.

@Anshul_Namdev all three are right, and I went back to the same docker setup to check each one rather than just nod. Results below, with the fixes applied to workflow 2.

1. Retry on the crashed execution. Confirmed. The Retry menu says “from node with error”, but for a crashed run the input of that node was never saved (the panel literally says so), and in my test it ran from the trigger again. I left one row stranded in processing, pressed Retry on the crashed execution, and got “Succeeded in 23ms, Retry of execution #28”. The claim matched nothing, the Filter kept nothing, the stranded row was still processing afterwards and the provider’s request counter did not move. So yes: green execution, nothing recovered. Only the sweep in workflow 2 brings that row back. Worth knowing before you reach for that button.

2. Never Error only covers status codes. Also confirmed. I made the provider’s lookup endpoint hang for one key and left the GET node as it was (no error output). The execution ended with an error on the timeout and a second unknown row in the same batch, which the provider actually had a charge for, was not settled. With On Error = Continue (using error output) on that node and a small Postgres node on the error branch, the same two rows give a green execution, the good one settles to completed and the one the provider could not answer stays unknown with the reason recorded:

-- error branch of the GET: provider could not answer. Stay unknown, note why,
-- and do NOT touch updated_at, that column is the "unknown since" clock now.
UPDATE jobs SET last_error = $2
WHERE  order_id = $1 AND status = 'unknown';

3. unknown had no exit. Agreed, and I like review as a separate state from dead for exactly the reason you give. I added review to the CHECK constraint, a reconcile_attempt counter, and folded the age cap into the sweep query so it is one statement:

WITH swept AS (
  UPDATE jobs SET status = 'unknown', updated_at = now()
  WHERE  status = 'processing' AND claimed_at < now() - interval '5 minutes'
  RETURNING id
),
aged AS (
  UPDATE jobs SET status = 'review', updated_at = now()
  WHERE  status = 'unknown'
    AND (updated_at < now() - interval '24 hours' OR reconcile_attempt >= 288)
  RETURNING id
),
asked AS (
  UPDATE jobs SET reconcile_attempt = reconcile_attempt + 1
  WHERE  status = 'unknown'
    AND NOT (updated_at < now() - interval '24 hours' OR reconcile_attempt >= 288)
  RETURNING id, order_id, amount, attempt, reconcile_attempt
)
SELECT id, order_id, amount, attempt, reconcile_attempt FROM asked
UNION ALL
SELECT j.id, j.order_id, j.amount, j.attempt, j.reconcile_attempt
FROM   jobs j WHERE j.id IN (SELECT id FROM swept)
ORDER  BY id;

The aged and asked conditions are complements of each other on purpose. Postgres does not support updating the same row from two CTEs in one statement (one of the two changes silently wins). 288 is just 24 hours of 5 minute ticks, so the counter and the age cap agree with each other. updated_at is only written when a row changes state (into unknown, into review, into completed/failed), never by the “ask the provider” step or the error branch, so it works as the unknown-since timestamp without adding another column.

One run of the patched workflow 2 with four rows set up to hit each path:

      order_id       |  status   | attempt | reconcile_attempt |  charge_id  | last_error
---------------------+-----------+---------+-------------------+-------------+----------------------------
 ord-2001-stranded   | failed    |       1 |                 0 |             |                              <- swept from processing, provider had nothing
 ord-3001-slow       | completed |       1 |                 1 | ch_97517646 |                              <- provider had it
 ord-3002-lookupslow | unknown   |       1 |                 1 |             | timeout of 5000ms exceeded   <- provider lookup timed out, stays unknown
 ord-3003-old        | review    |       1 |                 0 |             |                              <- unknown for 25h, now a human's problem

So the state list ends up as: pending, processing, completed, failed, unknown, review, dead. dead and review get different alerts. dead is “the provider said no, N times”. review is “we could not find out”, and that one might be money.

Thanks for the careful read, the Retry one in particular is the kind of thing that only bites at 2am.

One small but important mismatch between the stated rule and the example in ‘Record failure’: the regex makes an unrecognised error a definite failure. For example, 502 Bad Gateway, a bare 504, or an empty error message do not match that regex and can fall through to failed/dead, although none establishes that the charge did not happen. Your prose correctly says uncertain outcomes belong in unknown.

I would invert that default: keep the outcome unknown unless a structured provider response explicitly establishes a definite no-effect failure under that provider’s documented semantics. Only that confirmed branch should reach the attempt-limit / failed / dead logic; adding more strings to the timeout regex still leaves the next unfamiliar error unsafe. This is a review of the expression, not an n8n/provider integration test.

@DovahkiinMOL you are right, and it is a worse mismatch than “add 502 to the regex”. The expression had the default the wrong way round: unknown was the exception, definite failure was what everything else fell into. A new error string from the provider would have gone straight to failed and then dead.

Adding strings to the regex does not fix that, as you say. I went one step further than inverting the boolean, because the regex itself was the problem: the error output item of the HTTP Request node only carries message, name and stack, no status code, so any classification there is string matching on an axios message.

What I changed in workflow 1 (post 4 is edited to match):

  • HTTP Request: Options > Response > Never Error = on and Include Response Headers and Status = on. Every HTTP response now comes out of the Success output as { statusCode, body }. The Error output is left with only transport failures (timeout, reset, DNS), which are unknown by definition, so that branch goes straight to a Postgres node that sets unknown, no expression at all.
  • IF on statusCode 2xx: true goes to Mark completed.
  • false goes to Record failure, where the CASE is now WHEN NOT $2 THEN 'unknown', and $2 is a whitelist from the provider’s docs: [402, 400, 422].includes(statusCode) && ['card_declined','insufficient_funds','invalid_request'].includes(body.error). That is the only path to failed or dead.

One tick with five orders covering each case:

    order_id    |  status   | last_error
----------------+-----------+------------------------------------------------
 ord-4001       | completed |
 ord-4002-fail  | failed    | 402 {"error":"card_declined","message":"Your card was declined."}
 ord-4003-502   | unknown   | 502
 ord-4004-empty | unknown   | 500
 ord-4005-slow  | unknown   | timeout of 5000ms exceeded

The 502 html page and the empty 500 both land in unknown now, and workflow 2 resolves them against the provider. Thanks for reading the expression and not just the prose.

Thanks for the reply guys