How to add retry system like in the code

I have running flow
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:

Hi @NISHANT_GARG Welcome!
In a code node, there is no difference like any other node, just go in settings, and there you would see this:


And just enable Retry on Fail

Also i do not actually recommend that, instead in your CODE have guard clauses and statements that would automatically loop around the object instead of actually repeating what the previous node did.

@NISHANT_GARG set up an Error Workflow — it catches any failed execution and can re-trigger the main flow automatically, works across all nodes not just the Code node. go to your main workflow Settings and point “Error Workflow” to this one:

save this as a separate workflow, then in your main flow go to Settings > Error Workflow and select it — any node that fails will re-execute the whole flow without touching individual node retry settings.