Every error is JSON:
Invocation errors also include invocationId.
504 means unknown, not failed. Re-read state before deciding anything.