Apify Run Queue avatar
Apify Run Queue

Pricing

Pay per usage

Go to Store
Apify Run Queue

Apify Run Queue

Developed by

Lexis Solutions

Maintained by Community

Apify utility to queue runs until memory is available. Workaround to memory exceeded errors on Apify. This actor will retry starting actor starts with a delay. Open source and free!

5.0 (3)

Pricing

Pay per usage

7

Total users

5

Monthly users

5

Last modified

4 days ago

A utility actor that runs a list of actors with a retry mechanism. Avoids memory limit exceeded errors on Apify due to running too many runs in parallel.

Royston queue

Problem Statement 🤔

You have a large number of runs you want to start on Apify. However, sometimes your memory limit is exceeded and Apify will not let you start any more runs, and you end up with a lot of failed runs.

Solution 💡

You can use this actor to run your list of actors in parallel, and it will retry the actors that fail due to memory limit exceeded errors.

How it works 🤖

  • The actor will start running the actors one by one (ℹ️ but won't wait for them to finish). If an actor fails due to a memory limit exceeded error, the actor will wait for some time (default = 30 seconds) and retry.

  • The actor will keep track of the number of retries and the total number of runs.

  • The actor will run until all actors have started successfully, or failed due to a non-memory limit error (bad input, etc).

Disclaimer ⚠️

  1. This actor will not return results from the actors. Use webhooks to get the results from the actors.

  2. This actor will run until all actors have started successfully or failed due to a non-memory limit error. This means the run time can be very long. To avoid disruptions, set the actor timeout (under Actor > Settings) to a reasonable value. You can keep the memory limit low, as the actor is just doing scheduling and not processing any data.

Input 📥

The input is a JSON array of actor calls. Each actor call is an object with the following properties:

  • invocationId: (optional) Your custom ID for the invocation. You can use this to match input and output.
  • actorId: The ID of the actor to run.
  • input: The input to pass to the actor.
  • retryDelaySecs: The delay in seconds between retries.
  • timeoutSecs: The timeout in seconds for the actor call.
  • maxItems: The maximum number of items to process.
  • memory: The memory in MB to allocate for the actor call.
  • build: The build to use for the actor call.
  • webhooks: The webhooks to use for the actor call.

Output 📤

The output is a JSON array of actor calls. Each actor call is an object with the following properties:

  • actorId: The ID of the actor to run.
  • success: Whether the actor call was successful.
  • runId: The ID of the run.
  • retries: The number of retries.
  • error: The error message. If the actor call was successful, the error is null.

Example Input 📝

1{
2  "actorCalls": [
3    {
4      "actorId": "apify/website-content-crawler",
5      "invocationId": "my-custom-id",
6      "input": {
7        "startUrls": [
8          {
9            "url": "https://www.apify.com",
10            "label": "apify.com"
11          }
12        ]
13      },
14      "retryDelaySecs": 30,
15      "timeoutSecs": 300,
16      "maxItems": 100,
17      "memory": 2048,
18      "webhooks": [
19        {
20          "eventTypes": ["ACTOR.RUN.SUCCEEDED", "ACTOR.RUN.FAILED"],
21          "requestUrl": "https://example.com/webhook"
22        }
23      ]
24    }
25  ]
26}

Example Output 📤

1[
2  {
3    "invocationId": "my-custom-id",
4    "actorId": "apify/website-content-crawler",
5    "success": true,
6    "runId": "run_123",
7    "retries": 0,
8    "error": null
9  }
10]

FAQ

Doesn't Apify have a built-in retry mechanism?

Not yet. This actor is a workaround to avoid memory limit exceeded errors on Apify.

Can I use this actor for free?

Yes, you can use this actor for free. However, you will be charged for your usage on Apify.

How do I know how many runs I can start in parallel?

Your account is limited by how many GBs of RAM you have in your plan. Each actor consumes a set amount of RAM (configurable). You can calculate how many runs you can start in parallel by dividing your RAM by the RAM consumption of the actors you want to run.


Got feedback or need an extension?

Lexis Solutions is a certified Apify Expert. We can help you with custom solutions or data extraction projects.

Contact us on our website www.lexis.solutions or LinkedIn. Happy to help!