/n8n-tutorials

How to retry failed workflows in n8n?

Learn how to retry failed workflows in n8n manually or automatically, set up retry attempts, implement custom retry logic, and monitor execution status for reliable automation.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free consultation

How to retry failed workflows in n8n?

To retry failed workflows in n8n, you can use the built-in retry functionality in the workflow execution history page. When a workflow execution fails, simply navigate to the executions list, find the failed execution, and click on the retry button. You can choose to retry from the beginning or from the node that failed, depending on your needs. For workflows that need automatic retries, you can also set up retry attempts within the workflow settings.

 

Understanding Workflow Failures in n8n

 

Before diving into the retry process, it's important to understand why workflows fail in n8n. Workflows can fail for various reasons including:

  • API rate limiting or temporary service outages
  • Network connectivity issues
  • Data validation errors
  • Authentication problems
  • Resource constraints or timeouts

When a workflow fails, n8n provides mechanisms to retry the execution, either manually or automatically.

 

Step 1: Accessing Failed Workflow Executions

 

To retry a failed workflow, first you need to locate the failed execution:

  1. Log in to your n8n instance
  2. Navigate to the main dashboard
  3. Click on "Executions" in the left sidebar menu
  4. Look for executions with a red "Failed" status indicator
  5. Alternatively, open the specific workflow and click on the "Executions" tab at the top

This will display a list of all workflow executions, including those that have failed.

 

Step 2: Examining the Failure

 

Before retrying, it's wise to understand why the workflow failed:

  1. Click on the failed execution to open the execution details
  2. Examine the execution path - nodes with red outlines indicate where failures occurred
  3. Click on the failed node to see the specific error message
  4. Review the error details to understand what went wrong

Understanding the failure reason helps determine if a simple retry will resolve the issue or if workflow modifications are needed.

 

Step 3: Manual Retry - From the Beginning

 

To retry the entire workflow from the start:

  1. From the execution details page, look for the "Retry" button in the top right corner
  2. Click on "Retry"
  3. Select "Retry workflow from beginning" from the dropdown menu
  4. Confirm your choice

This will create a new execution that runs the entire workflow from the start node.

 

Step 4: Manual Retry - From Failed Node

 

If you prefer to continue execution from the point of failure:

  1. From the execution details page, click the "Retry" button
  2. Select "Retry workflow from node [node name]" option
  3. Confirm your choice

This is especially useful for long-running workflows where previous steps completed successfully and you don't want to repeat them.

 

Step 5: Setting Up Automatic Retries

 

For workflows that might experience intermittent failures, you can configure automatic retries:

  1. Open the workflow you want to configure
  2. Click on the "Workflow" button in the top right corner
  3. Select "Settings" from the dropdown menu
  4. Scroll down to the "Error Workflow" section
  5. Check the "Retry on Error" option
  6. Set the "Max Attempts" to your desired number of retry attempts
  7. Configure "Retry Wait Time" to set delays between retries (in milliseconds)
  8. Click "Save" to apply these settings

With this configuration, n8n will automatically retry failed workflows according to your specifications.

 

Step 6: Implementing Node-Level Retry Logic

 

For more granular control, you can implement retry logic at the node level using the "Function" node:


// Example function node code for implementing retry logic
const maxRetries = 3;
const retryDelay = 2000; // milliseconds

async function executeWithRetry(operation, currentAttempt = 1) {
  try {
    return await operation();
  } catch (error) {
    if (currentAttempt < maxRetries) {
      // Wait before retrying
      await new Promise(resolve => setTimeout(resolve, retryDelay));
      // Retry with incremented attempt counter
      return executeWithRetry(operation, currentAttempt + 1);
    }
    // If max retries reached, rethrow the error
    throw new Error(`Failed after ${maxRetries} attempts: ${error.message}`);
  }
}

// Example usage
try {
  const result = await executeWithRetry(async () => {
    // Your operation that might fail
    const response = await $items[0].json.apiCall;
    if (!response.success) {
      throw new Error('API returned unsuccessful response');
    }
    return response.data;
  });
  
  // Continue with successful result
  return {
    json: {
      success: true,
      data: result
    }
  };
} catch (error) {
  // Handle final failure
  return {
    json: {
      success: false,
      error: error.message
    }
  };
}

This approach is useful when you need custom retry behavior for specific operations.

 

Step 7: Using Error Workflows for Advanced Retry Scenarios

 

For complex retry requirements, you can set up a dedicated error workflow:

  1. Create a new workflow dedicated to handling errors
  2. In your main workflow's settings, go to the "Error Workflow" section
  3. Instead of using "Retry on Error," select "Run Error Workflow"
  4. Choose your error-handling workflow from the dropdown
  5. Save the settings

In your error workflow, you can implement logic to:

  • Analyze the error type
  • Perform different actions based on error conditions
  • Implement custom retry logic with exponential backoff
  • Send notifications about failures
  • Log error details for later analysis

 

Step 8: Monitoring Retry Status

 

After initiating retries, it's important to monitor their status:

  1. Navigate back to the "Executions" list
  2. Look for new executions marked as "Retry" in their status
  3. Check if the retry execution succeeded (green status) or failed again (red status)
  4. For automatic retries, n8n will show multiple attempts in the execution history

You can see the execution history of each workflow to track all retry attempts and their outcomes.

 

Step 9: Addressing Persistent Failures

 

If a workflow continues to fail after multiple retries, deeper troubleshooting is needed:

  1. Check external service status if the workflow depends on third-party APIs
  2. Verify credentials and authentication settings
  3. Review payload data for format issues or unexpected values
  4. Check for rate limiting or quota issues
  5. Add "Debug" nodes before and after problematic nodes to inspect data

Sometimes, modifying the workflow design or adding error handling logic is necessary to resolve persistent failures.

 

Step 10: Implementing Best Practices for Reliable Workflows

 

To minimize the need for retries, follow these best practices:

  1. Add proper error handling using IF nodes to catch and handle potential errors
  2. Implement data validation before making API calls
  3. Use the "Split In Batches" node for processing large datasets to prevent timeouts
  4. Set appropriate timeout values for HTTP Request nodes
  5. Use webhooks with confirmation mechanisms for critical workflows
  6. Implement circuit breaker patterns for external service dependencies

These practices will make your workflows more resilient and reduce the frequency of failures requiring retries.

 

Advanced Configuration: Retry with Exponential Backoff

 

For sophisticated retry strategies, you can implement exponential backoff using a Function node:


// Function node code for exponential backoff retry strategy
const maxRetries = 5;
const baseDelay = 1000; // 1 second initial delay

async function retryWithExponentialBackoff(operation, attempt = 1) {
  try {
    return await operation();
  } catch (error) {
    if (attempt >= maxRetries) {
      throw new Error(`Operation failed after ${maxRetries} attempts: ${error.message}`);
    }
    
    // Calculate exponential backoff delay with jitter
    const delay = Math.floor(baseDelay _ Math.pow(2, attempt - 1) _ (0.5 + Math.random()));
    
    console.log(`Attempt ${attempt} failed. Retrying in ${delay}ms. Error: ${error.message}`);
    
    // Wait for calculated delay
    await new Promise(resolve => setTimeout(resolve, delay));
    
    // Retry with incremented counter
    return retryWithExponentialBackoff(operation, attempt + 1);
  }
}

// Example usage
return await retryWithExponentialBackoff(async () => {
  // The operation that might fail
  const response = await $items[0].json.makeApiCall();
  
  // Validate response
  if (!response.success) {
    throw new Error('API returned unsuccessful status');
  }
  
  return {
    json: {
      result: response.data,
      attempts: attempt
    }
  };
});

This approach gradually increases the wait time between retries, which is ideal for handling rate limiting or temporary service outages.

 

Conclusion

 

Retrying failed workflows in n8n can be done through both manual and automated methods. For occasional failures, the manual retry option from the executions history page is sufficient. For workflows prone to intermittent failures, configuring automatic retries in the workflow settings provides a more hands-off approach. For complex scenarios, custom retry logic using Function nodes or dedicated error workflows offers the most flexibility.

By understanding these retry mechanisms and implementing best practices for error handling, you can build more resilient workflows that recover gracefully from temporary failures, ensuring your automation processes remain reliable even in challenging conditions.

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022