Error & Retries Mechanism
Comprehensive guide to handling API errors and retry mechanisms
Why Retries Matter
Workflows can sometimes encounter interruptions due to paused, stopped, or shutdown statuses. Understanding why retries are important, when to retry, and how to do it effectively is essential for maintaining smooth operations and minimizing delays.
Account Rotation: A Smoother Process
Using account rotation for search and enrichment actions ensures retries are seamless and done on our end.
Here’s how it works:
- When an account becomes invalid or reaches its daily limit, the system automatically switches to another available account.
- If no valid accounts remain, the system uses the account with the limit reached and schedules the job to retry automatically once it’s ready.
To enable Account Rotation, include this parameter when launching a workflow via API:
Refresh & Resume Paused Jobs
Workflows may pause due to integration issues, such as a broken cookie. Here are several ways to address the issue.
-
Resume all paused jobs at once while updating the user’s cookies:
Use the POST Add or Update an Integration Account endpoint and set
resume_paused_jobs
totrue
:Request payload example:
-
To retry Specific Runs only: Update the user account cookies and use the POST Retry a Run endpoint:
Example payload:
-
For Shared Accounts: Share this link with the account owner to refresh the cookie manually:
https://app.captaindata.co/integrations/linkedin/accounts/{user_id}
.This avoids waiting for Captain Data’s (or your own) Chrome extension to update it (updates occur every 2 hours).
And then, use the POST Retry a Run endpoint.
For more information, see the related article: Add & Managing Users.
Should I retry stopped Runs (Jobs) or not?
-
Canceling Jobs:
You realize you did a mistake or the job is stuck for too long, you can cancel it using the POST Cancel a Run endpoint. This allows you to quickly stop any ongoing processes that are no longer needed.
-
Restarting Stopped Jobs:
After addressing the issue, restart the job using the POST Retry a Run endpoint. Ensure all necessary updates, such as fixing inputs or updating account credentials, are completed before retrying.
Managing Shutdown Job
Polling for Shutdown Jobs: Stop polling as soon as a job enters the Shutdown status; there’s no need to continue.
If you believe the inputs should work or need assistance, please contact us with all relevant details.
- Single input: You should receive a straightforward and clear error message for the shutdown status when running a single input. This is typically caused by an invalid cookie, so retrying is unnecessary.
- By batch (multiple inputs): If the API return the error
All inputs failed. Please correct them before retrying your job.
, it typically means the provided inputs are invalid. In this case, check Inputs - To gain more details regarding this error by inputs, use the Get a Run’s Inputs:
By understanding and using retries effectively, you can overcome interruptions and keep your workflows on track.
Common Errors & How-to Retry
Here’s a list of the most common errors you could come across; classified by API.