Bug report: error code 400 bad request returned as success

Describe the problem/error/question

In n8n when the instagram graph api returns http error code 400, n8n still considers it a success.
This is wrong, it should have went to the error branch.
See screenshot below.

It should not ignore the “Response Code” by default.

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Succes, but should be error branch.

Information on your n8n setup

  • n8n version: latest community
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): no idea where to find this
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system: ubuntu

Fyi: the error code 400 is because I need to add a wait block of 60 seconds in between posting the image to instagram and then posting the post itself.
Ideally n8n would handle this itself by GET /{creation_id}?fields=status_code request, with verification of output of FINISHED.

Raise this issue on GitHub from here. Temporarily, add an IF statement right after this node with a logic similar to the quote below until the internal team investigates this.

IF {{$json.statusCode}} IS NOT 200 OR 202

Ok, added to Github.
Error code 400 bad request, but returned as success · Issue #23813 · n8n-io/n8n

When adding the if, don’t I risk having flows that keep on running forever, if instagram would never return a 200?
How would I handle that best then?